Skip to content
This repository has been archived by the owner on Jan 26, 2024. It is now read-only.

Commit

Permalink
Merge pull request #13 from johnmccabe/FEAT/master/port-to-golang
Browse files Browse the repository at this point in the history
Port vmpooler-bitbar to Go
  • Loading branch information
johnmccabe authored Jul 4, 2018
2 parents 6e5cfda + 1a312f4 commit 1a878eb
Show file tree
Hide file tree
Showing 558 changed files with 238,387 additions and 378 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
vmpooler-bitbar
170 changes: 170 additions & 0 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions Gopkg.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[[constraint]]
name = "github.com/johnmccabe/go-bitbar"
version = "0.3.0"

[[constraint]]
name = "github.com/johnmccabe/go-vmpooler"
version = "0.0.3"

[prune]
go-tests = true
unused-packages = true
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
vmpooler-bitbar

Copyright (C) 2016 Puppet
Copyright (C) 2018 John McCabe

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
60 changes: 43 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,36 @@

## What is this?

Vmpooler-bitbar is a small ruby plugin for [@matryer's BitBar application](https://github.com/matryer/bitbar) built on top of [@braincain's vmfloaty](https://github.com/briancain/vmfloaty) which shows the status of all of your vmpooler instances and allows quick access to actions such as ssh'ing to a node or deleting an instance... and more.
Vmpooler-bitbar is plugin for [@matryer's BitBar application](https://github.com/matryer/bitbar) built on top of the [go-bitbar](https://github.com/johnmccabe/go-bitbar), and [go-vmpooler](https://github.com/johnmccabe/go-vmpooler) libraries which shows the status of all of your vmpooler instances and allows quick access to actions such as ssh'ing to a node or deleting an instance... and more.

Too much talk, have a look at it in action.

![demo video showing vmpooler-bitbar in action](https://raw.githubusercontent.com/johnmccabe/vmpooler-bitbar/gh-pages/images/vmpooler-bitbar.gif)

## Features

- updates every `30s`, see [here](https://github.com/matryer/bitbar#configure-the-refresh-time) if you want to change the refresh interval - I don't recommend setting it lower than 30s.
- shows all active vms created using your token
- vms with < 1hr before their deletion are highlighted in red
- quick access to some details of each vm, tags etc
- ssh directly to a vm from the menu
- [x] updates every `30s`, see
- [x] shows all active vms created using your token
- [x] vms with < 1hr before their deletion are highlighted in red
- [x] quick access to some details of each vm
- [ ] Display Tags
- [ ] Detect Frankenbuilt PE instances
- [x] ssh directly to a vm from the menu
- OSX Terminal supported by default
- [iTerm2 can be used instead](#using-iterm2-instead-of-osx-terminal)
- delete a vm from the menu
- extend the lifetime of a vm from the menu
- delete all vms from the menu
- extend the lifetime of all vms from the menu
- [click on an item to copy it to the clipboard](#copying-hostname-etc)
- create a new vm from the menu (available templates pulled from vmpooler, with new vms tagged with `created_by=vmpooler-bitbar`)
- integrates with the OSX Notification Centre
- [x] delete a vm from the menu
- [x] extend the lifetime of a vm from the menu
- [x] delete all vms from the menu
- [x] extend the lifetime of all vms from the menu
- [x] [click on an item to copy it to the clipboard](#copying-hostname-etc)
- [x] create a new vm from the menu (available templates pulled from vmpooler, with new vms tagged with `created_by=vmpooler-bitbar`)
- [ ] integrates with the OSX Notification Centre

## Getting Started

### Prerequisites

- vmfloaty should be installed and configured, with the vmpooler `url`, `user` and `token` set in your `~/.vmfloaty.yml` config file (see the [vmfloaty docs](https://github.com/briancain/vmfloaty#example-workflow) for information on obtaining a token). If you are able to run `floaty token status` then you should be good to go.
- You must have a vmpooler token, refer to the vmfloaty documentation/confluence for instructions.
- for the SSH to vmpooler instance action to work you should have the vmpooler ssh key added to the ssh agent, `ssh-add /path/to/priv/key`.

### Install BitBar
Expand All @@ -46,11 +48,35 @@ If this is your first time installing BitBar you will be prompted to choose/crea

Any executable scripts copied to this directory will be rendered in the menubar by BitBar and it is here we will copy the vmpooler-bitbar script.

### Add the vmpooler-bitbar plugin
### Install vmpooler-bitbar

Copy `vmpooler-bitbar.30s.rb` to your BitBar plugins directory.
Install using the provider Homebrew tap.

From the BitBar menu select `refresh all` to have BitBar rescan the plugins directory and you should see the `VM: <number of vms>` appear in your menubar.
$ brew tap johnmccabe/vmpooler-bitbar
$ brew install vmpooler-bitbar

### Configuring

Before vmpooler-bitbar becomes available you must configure the plugin:

$ vmpooler-bitbar config

Follow the prompts, pressing `?` for more details of each field, you will be prompted for the following:

- vmpooler API endpoint (for example, `https://vmpooler.mycompany.net/api/v1`)
- vmpooler token (for example, `kpy2fn8sgjkcbyn896yilzqxwjlnfake`)

Once configured you can then make the plugin available to BitBar:

$ vmpooler-bitbar install

You will be prompted for a refresh interval, I recommend using the default `30s` recommendation.

If you wish to alter the refresh interval you can just run the `vmpooler-bitbar install` command a second time.

Note: When installing for the fist time you will need to manually restart the BitBar App, or select Preferences/Refresh all from its dropdowns.

###

## Tips

Expand Down
Loading

0 comments on commit 1a878eb

Please sign in to comment.