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

Commit 1a878eb

Browse files
authored
Merge pull request #13 from johnmccabe/FEAT/master/port-to-golang
Port vmpooler-bitbar to Go
2 parents 6e5cfda + 1a312f4 commit 1a878eb

File tree

558 files changed

+238387
-378
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

558 files changed

+238387
-378
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
vmpooler-bitbar

Gopkg.lock

Lines changed: 170 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Gopkg.toml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[[constraint]]
2+
name = "github.com/johnmccabe/go-bitbar"
3+
version = "0.3.0"
4+
5+
[[constraint]]
6+
name = "github.com/johnmccabe/go-vmpooler"
7+
version = "0.0.3"
8+
9+
[prune]
10+
go-tests = true
11+
unused-packages = true

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
vmpooler-bitbar
22

3-
Copyright (C) 2016 Puppet
3+
Copyright (C) 2018 John McCabe
44

55
Licensed under the Apache License, Version 2.0 (the "License");
66
you may not use this file except in compliance with the License.

README.md

Lines changed: 43 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,36 @@
22

33
## What is this?
44

5-
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.
5+
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.
66

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

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

1111
## Features
1212

13-
- 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.
14-
- shows all active vms created using your token
15-
- vms with < 1hr before their deletion are highlighted in red
16-
- quick access to some details of each vm, tags etc
17-
- ssh directly to a vm from the menu
13+
- [x] updates every `30s`, see
14+
- [x] shows all active vms created using your token
15+
- [x] vms with < 1hr before their deletion are highlighted in red
16+
- [x] quick access to some details of each vm
17+
- [ ] Display Tags
18+
- [ ] Detect Frankenbuilt PE instances
19+
- [x] ssh directly to a vm from the menu
1820
- OSX Terminal supported by default
1921
- [iTerm2 can be used instead](#using-iterm2-instead-of-osx-terminal)
20-
- delete a vm from the menu
21-
- extend the lifetime of a vm from the menu
22-
- delete all vms from the menu
23-
- extend the lifetime of all vms from the menu
24-
- [click on an item to copy it to the clipboard](#copying-hostname-etc)
25-
- create a new vm from the menu (available templates pulled from vmpooler, with new vms tagged with `created_by=vmpooler-bitbar`)
26-
- integrates with the OSX Notification Centre
22+
- [x] delete a vm from the menu
23+
- [x] extend the lifetime of a vm from the menu
24+
- [x] delete all vms from the menu
25+
- [x] extend the lifetime of all vms from the menu
26+
- [x] [click on an item to copy it to the clipboard](#copying-hostname-etc)
27+
- [x] create a new vm from the menu (available templates pulled from vmpooler, with new vms tagged with `created_by=vmpooler-bitbar`)
28+
- [ ] integrates with the OSX Notification Centre
2729

2830
## Getting Started
2931

3032
### Prerequisites
3133

32-
- 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.
34+
- You must have a vmpooler token, refer to the vmfloaty documentation/confluence for instructions.
3335
- 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`.
3436

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

4749
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.
4850

49-
### Add the vmpooler-bitbar plugin
51+
### Install vmpooler-bitbar
5052

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

53-
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.
55+
$ brew tap johnmccabe/vmpooler-bitbar
56+
$ brew install vmpooler-bitbar
57+
58+
### Configuring
59+
60+
Before vmpooler-bitbar becomes available you must configure the plugin:
61+
62+
$ vmpooler-bitbar config
63+
64+
Follow the prompts, pressing `?` for more details of each field, you will be prompted for the following:
65+
66+
- vmpooler API endpoint (for example, `https://vmpooler.mycompany.net/api/v1`)
67+
- vmpooler token (for example, `kpy2fn8sgjkcbyn896yilzqxwjlnfake`)
68+
69+
Once configured you can then make the plugin available to BitBar:
70+
71+
$ vmpooler-bitbar install
72+
73+
You will be prompted for a refresh interval, I recommend using the default `30s` recommendation.
74+
75+
If you wish to alter the refresh interval you can just run the `vmpooler-bitbar install` command a second time.
76+
77+
Note: When installing for the fist time you will need to manually restart the BitBar App, or select Preferences/Refresh all from its dropdowns.
78+
79+
###
5480

5581
## Tips
5682

0 commit comments

Comments
 (0)