Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Volumes #41

Merged
merged 2 commits into from
May 6, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 13 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ Options:
--scaleway-name Assign a name [$SCALEWAY_NAME]
--scaleway-organization Scaleway organization [$SCALEWAY_ORGANIZATION]
--scaleway-token Scaleway token [$SCALEWAY_TOKEN]
--scaleway-volumes Attach additional volume (e.g., 50G) [$SCALEWAY_VOLUMES]
--swarm Configure Machine with Swarm
--swarm-addr addr to advertise for Swarm (default: detect and use the machine IP)
--swarm-discovery Discovery service to use with Swarm
Expand Down Expand Up @@ -132,23 +133,25 @@ $ curl --silent http://212.47.248.251 | head -n1 # you can also open your browse

## Options

|Option Name |Description |Default Value |required|
|----------------------------------------------------------------|-------------------|--------------|--------|
|``--scaleway-organization`` or ``$SCALEWAY_ORGANIZATION`` |Organization UUID |none |yes |
|``--scaleway-token`` or ``$SCALEWAY_TOKEN`` |Token UUID |none |yes |
|``--scaleway-name`` or ``$SCALEWAY_NAME`` |Server name |none |no |
|``--scaleway-commercial-type`` or ``$SCALEWAY_COMMERCIAL_TYPE`` |Commercial type |VC1S |no |
|``--scaleway-image`` or ``$SCALEWAY_IMAGE`` |Server image |ubuntu-xenial |no |
|``--scaleway-debug`` or ``$SCALEWAY_DEBUG`` |Toggle debugging |false |no |
|``--scaleway-ip`` or ``$SCALEWAY_IP`` |Server IP |"" |no |
|Option Name |Description |Default Value |required|
|----------------------------------------------------------------|-------------------------|--------------|--------|
|``--scaleway-organization`` or ``$SCALEWAY_ORGANIZATION`` |Organization UUID |none |yes |
|``--scaleway-token`` or ``$SCALEWAY_TOKEN`` |Token UUID |none |yes |
|``--scaleway-name`` or ``$SCALEWAY_NAME`` |Server name |none |no |
|``--scaleway-commercial-type`` or ``$SCALEWAY_COMMERCIAL_TYPE`` |Commercial type |VC1S |no |
|``--scaleway-image`` or ``$SCALEWAY_IMAGE`` |Server image |ubuntu-xenial |no |
|``--scaleway-debug`` or ``$SCALEWAY_DEBUG`` |Toggle debugging |false |no |
|``--scaleway-ip`` or ``$SCALEWAY_IP`` |Server IP |"" |no |
|``--scaleway-volumes`` or ``$SCALEWAY_VOLUMES`` |Attach additional volume |"" |no |

---

## Changelog

### master (unreleased)

* Add `--scaleway-ip` ([#37](https://github.com/scaleway/docker-machine-driver-scaleway/issues/37))
* Add `--scaleway-volumes` ([#37](https://github.com/scaleway/docker-machine-driver-scaleway/issues/37))
* Add `--scaleway-ip` ([#40](https://github.com/scaleway/docker-machine-driver-scaleway/issues/40))

View full [commits list](https://github.com/scaleway/docker-machine-driver-scaleway/compare/v1.1.0...master)

Expand Down
20 changes: 14 additions & 6 deletions driver/scaleway.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ type Driver struct {
name string
image string
ip string
volumes string
stopping bool
created bool
// size string
// userDataFile string
// ipv6 bool
}
Expand Down Expand Up @@ -88,6 +88,7 @@ func (d *Driver) SetConfigFromFlags(flags drivers.DriverOptions) (err error) {
d.name = flags.String("scaleway-name")
d.image = flags.String("scaleway-image")
d.ip = flags.String("scaleway-ip")
d.volumes = flags.String("scaleway-volumes")
return
}

Expand Down Expand Up @@ -134,6 +135,12 @@ func (d *Driver) GetCreateFlags() []mcnflag.Flag {
Usage: "Specifies the IP address",
Value: "",
},
mcnflag.StringFlag{
EnvVar: "SCALEWAY_VOLUMES",
Name: "scaleway-volumes",
Usage: "Attach additional volume (e.g., 50G)",
Value: "",
},
mcnflag.BoolFlag{
EnvVar: "SCALEWAY_DEBUG",
Name: "scaleway-debug",
Expand Down Expand Up @@ -213,11 +220,12 @@ func (d *Driver) Create() (err error) {
d.IPID = ip.IP.ID
}
d.ServerID, err = api.CreateServer(cl, &api.ConfigCreateServer{
ImageName: d.image,
CommercialType: d.CommercialType,
Name: d.name,
Bootscript: defaultBootscript,
IP: d.IPID,
ImageName: d.image,
CommercialType: d.CommercialType,
Name: d.name,
Bootscript: defaultBootscript,
AdditionalVolumes: d.volumes,
IP: d.IPID,
Env: strings.Join([]string{"AUTHORIZED_KEY",
strings.Replace(string(publicKey[:len(publicKey)-1]), " ", "_", -1)}, "="),
})
Expand Down