Skip to content
This repository has been archived by the owner on Jun 8, 2020. It is now read-only.

Commit

Permalink
version 1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
vahaah committed Apr 11, 2016
1 parent 5d0f336 commit 5547184
Show file tree
Hide file tree
Showing 104 changed files with 20,542 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
docker-machine-driver-vscale
*.log
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Changelog

## 1.0.0 (2016-04-11)

Initial public release
96 changes: 96 additions & 0 deletions Godeps/Godeps.json

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

5 changes: 5 additions & 0 deletions Godeps/Readme

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

32 changes: 32 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
GODEP_BIN := $(GOPATH)/bin/godep
GODEP := $(shell [ -x $(GODEP_BIN) ] && echo $(GODEP_BIN) || echo '')

# Initialize version flag
GO_LDFLAGS := -X $(shell go list ./).GitCommit=$(shell git rev-parse --short HEAD 2>/dev/null)

default: build

bin/docker-machine-driver-vscale:
go build -i -ldflags "$(GO_LDFLAGS)" \
-o ./bin/docker-machine-driver-vscale ./bin

build: clean bin/docker-machine-driver-vscale

clean:
$(RM) bin/docker-machine-driver-vscale

install: bin/docker-machine-driver-vscale
cp -f ./bin/docker-machine-driver-vscale $(GOPATH)/bin/

test-acceptance:
test/integration/run-bats.sh test/integration/bats/

dep-save:
$(if $(GODEP), , \
$(error Please install godep: go get github.com/tools/godep))
$(GODEP) save $(shell go list ./... | grep -v vendor/)

dep-restore:
$(if $(GODEP), , \
$(error Please install godep: go get github.com/tools/godep))
$(GODEP) restore -v
62 changes: 61 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,61 @@
# docker-machine-vscale
# Docker Machine Vscale Driver

This is a plugin for [Docker Machine](https://docs.docker.com/machine/) allowing
to create Doker hosts on [Vscale]( http://vscale.io ) cloud services.

## Installation

To install this plugin manually, download the binary `docker-machine-driver-vscale`
and make it available by `$PATH`, for example by putting it to `/usr/local/bin/`:

```console
$ curl -L https://github.com/vahaah/docker-machine-vscale/releases/download/v1.0.0/docker-machine-driver-vscale > /usr/local/bin/docker-machine-driver-vscale

$ chmod +x /usr/local/bin/docker-machine-driver-vscale
```

The latest version of `docker-machine-driver-vscale` binary is available on
the ["Releases"](https://github.com/vahaah/docker-machine-vscale/releases) page.

## Usage

After compile you can use driver for creating docker hosts.
Get Vscale access token from [your profile](https://vscale.io/panel/settings/tokens/) then run:

```console
$ docker-machine create -d vscale --vscale-access-token YOUR_VSCALE_ACCESS_TOKEN machine_name
```

Available options:

- `--vscale-access-token`: Access token.
- `--vscale-location`: Server location.
- `--vscale-rplan`: Server size.
- `--vscale-made-from`: Server type

Environment variables and default values:

| CLI option | Environment variable | Default |
|-------------------------------|-----------------------------|-----------------------------|
| `--vscale-access-token` | `VSCALE_ACCESS_TOKEN` | - |
| `--vscale-location` | `VSCALE_LOCATION` | `spb0` |
| `--vscale-rplan` | `VSCALE_RPLAN` | `small` |
| `--vscale-made-from` | `VSCALE_MADE_FROM` | `ubuntu_14.04_64_002_master`|

## Development

### Build from Source
If you wish to work on Parallels Driver for Docker machine, you'll first need
[Go](http://www.golang.org) installed (version 1.5+ is required).
Make sure Go is properly installed, including setting up a [GOPATH](http://golang.org/doc/code.html#GOPATH).

Run these commands to build the plugin binary:

```bash
$ go get -d github.com/vahaah/docker-machine-vscale
$ cd $GOPATH/github.com/vahaah/docker-machine-vscale
$ make build
```

After the build is complete, `bin/docker-machine-driver-vscale` binary will
be created. If you want to copy it to the `${GOPATH}/bin/`, run `make install`.
41 changes: 41 additions & 0 deletions bin/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
package main

import (
"os"
"path"

"github.com/vahaah/docker-machine-vscale"
"github.com/codegangsta/cli"
"github.com/docker/machine/libmachine/drivers/plugin"
)

var appHelpTemplate = `This is a Docker Machine plugin for Vscale.
Plugin binaries are not intended to be invoked directly.
Please use this plugin through the main 'docker-machine' binary.
Version: {{.Version}}{{if or .Author .Email}}
Author:{{if .Author}}
{{.Author}}{{if .Email}} - <{{.Email}}>{{end}}{{else}}
{{.Email}}{{end}}{{end}}
{{if .Flags}}
Options:
{{range .Flags}}{{.}}
{{end}}{{end}}
Commands:
{{range .Commands}}{{.Name}}{{with .ShortName}}, {{.}}{{end}}{{ "\t" }}{{.Usage}}
{{end}}
`

func main() {
cli.AppHelpTemplate = appHelpTemplate
app := cli.NewApp()
app.Name = path.Base(os.Args[0])
app.Usage = "This is a Docker Machine plugin binary. Please use it through the main 'docker-machine' binary."
app.Author = "Alex Vakhitov"
app.Email = "https://github.com/vahaah/docker-machine-vscale/"
app.Version = vscale.FullVersion()
app.Action = func(c *cli.Context) {
plugin.RegisterDriver(vscale.NewDriver("", ""))
}

app.Run(os.Args)
}
18 changes: 18 additions & 0 deletions vendor/github.com/codegangsta/cli/.travis.yml

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

21 changes: 21 additions & 0 deletions vendor/github.com/codegangsta/cli/LICENSE

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

Loading

0 comments on commit 5547184

Please sign in to comment.