Skip to content

Commit 663970c

Browse files
committed
Change 'DD_COMPUTE_' prefix for environment variables to 'MCP_' (#4).
1 parent 6b87e72 commit 663970c

File tree

7 files changed

+164
-15
lines changed

7 files changed

+164
-15
lines changed

CHANGES.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Changes
2+
3+
## v0.3
4+
5+
Breaking changes:
6+
7+
* All environment variables that previously used the prefix `DD_COMPUTE_` have been changed to use the prefix `MCP_`.

CONTRIBUTING.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# Contributing
2+
3+
Contributions are welcome, and they are greatly appreciated! Every little bit helps, and credit will always be given.
4+
5+
You can contribute in many ways:
6+
7+
## Types of Contributions
8+
9+
### Report Bugs
10+
11+
Report bugs at https://github.com/DimensionDataResearch/docker-machine-driver-ddcloud/issues.
12+
13+
If you are reporting a bug, please include:
14+
15+
* Your operating system name and version.
16+
* Any details about your local setup that might be helpful in troubleshooting.
17+
* Detailed steps to reproduce the bug.
18+
19+
### Fix Bugs
20+
21+
Look through the GitHub issues for bugs. Anything tagged with "bug"
22+
and "help wanted" is open to whoever wants to implement it.
23+
24+
### Implement Features
25+
26+
Look through the GitHub issues for features. Anything tagged with "enhancement"
27+
and "help wanted" is open to whoever wants to implement it.
28+
29+
### Write Documentation
30+
31+
The Docker Machine driver for CloudControl could always use more documentation, whether as part of the
32+
official documentation, in GoDoc, or even on the web in blog posts, articles, and such.
33+
34+
### Submit Feedback
35+
36+
The best way to send feedback is to file an issue at https://github.com/DimensionDataResearch/docker-machine-driver-ddcloud/issues.
37+
38+
If you are proposing a feature:
39+
40+
* Explain in detail how it would work.
41+
* Keep the scope as narrow as possible, to make it easier to implement.
42+
* Remember that this is a volunteer-driven project, and that contributions are welcome :)
43+
44+
## Get Started!
45+
46+
Ready to contribute? Here's how to set up `docker-machine-driver-ddcloud` for local development.
47+
48+
1. Set up your build environment:
49+
* If you have Vagrant and VMWare / VirtualBox, you can run `vagrant up` to create a VM to work in.
50+
* The resulting VM will have your repository folder mapped into the VM as a shared folder (so you can use your regular editor on your machine, but run build commands in the VM).
51+
* Run `vagrant ssh` to connect to the VM.
52+
* Otherwise:
53+
1. Install Go version 1.6.x
54+
2. Make sure your GOPATH environment variable has been set.
55+
3. Run `go get -u github.com/DimensionDataResearch/docker-machine-driver-ddcloud`.
56+
4. Go to $GOPATH/src/github.com/DimensionDataResearch/docker-machine-driver-ddcloud.
57+
2. Run `make dev` to build the provider, then `make install` to make it available to execute.
58+
59+
## Pull Request Guidelines
60+
61+
Before you submit a pull request, check that it meets these guidelines:
62+
63+
1. Your pull request should target the [development/v1.0](https://github.com/DimensionDataResearch/docker-machine-driver-ddcloud/tree/development/v1.0) branch.
64+
2. The pull request should include tests (either unit or acceptance, as appropriate).
65+
3. If the pull request adds or changes functionality, the docs should be updated.
66+
67+
## Tips
68+
69+
To enable extended logging of CloudControl API request and responses, set the `MCP_EXTENDED_LOGGING` environment variable to "1".

CONTRIBUTORS.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Contributors
2+
3+
We'd like to thank the following people for their contributions to the CloudControl driver for Docker Machine:
4+
5+
* Adam Friedman ([@tintoy](https://github.com/tintoy))

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,27 +31,27 @@ If you're running on Windows, just remove the backslashes so the whole command i
3131
The driver supports all Docker Machine commands, and can be configured using the following command-line arguments (or environment variables):
3232

3333
* `ddcloud-user` - The user name used to authenticate to the CloudControl API.
34-
Environment: `DD_COMPUTE_USER`
34+
Environment: `MCP_USER`
3535
* `ddcloud-password` - The password used to authenticate to the CloudControl API.
36-
Environment: `DD_COMPUTE_PASSWORD`.
36+
Environment: `MCP_PASSWORD`.
3737
* `ddcloud-region` - The CloudControl region name (e.g. AU, NA, EU, etc).
38-
Environment: `DD_COMPUTE_REGION`.
38+
Environment: `MCP_REGION`.
3939
* `ddcloud-networkdomain` - The name of the target CloudControl network domain.
4040
* `ddcloud-datacenter` - The name of the CloudControl datacenter (e.g. NA1, AU9) in which the network domain is located.
4141
* `ddcloud-vlan` - The name of the target CloudControl VLAN.
4242
* `ddcloud-image-name` - The name of the OS image used to create the target machine.
4343
Note that only OS images are supported for now, not customer images. Additionally, the OS must be a Linux distribution supported by docker-machine.
4444
* `ddcloud-ssh-user` - The SSH username to use.
4545
Default: "root".
46-
Environment: `DD_COMPUTE_SSH_USER`
46+
Environment: `MCP_SSH_USER`
4747
* `ddcloud-ssh-key` - The SSH key file to use.
48-
Environment: `DD_COMPUTE_SSH_KEY`
48+
Environment: `MCP_SSH_KEY`
4949
* `ddcloud-ssh-port` - The SSH port to use.
5050
Default: 22.
51-
Environment: `DD_COMPUTE_SSH_PORT`
51+
Environment: `MCP_SSH_PORT`
5252
* `ddcloud-ssh-bootstrap-password` - The initial SSH password used to bootstrap SSH key authentication.
5353
This password is removed once the SSH key has been installed
54-
Environment: `DD_COMPUTE_SSH_BOOTSTRAP_PASSWORD`
54+
Environment: `MCP_SSH_BOOTSTRAP_PASSWORD`
5555
* `ddcloud-create-ssh-firewall-rule` - Automatically create a firewall rule to enable inbound SSH to the target server?
5656

5757
## Installing the provider

Vagrantfile

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# -*- mode: ruby -*-
2+
# vi: set ft=ruby :
3+
4+
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
5+
VAGRANTFILE_API_VERSION = "2"
6+
7+
$script = <<SCRIPT
8+
GOVERSION="1.7"
9+
SRCROOT="/opt/go"
10+
SRCPATH="/opt/gopath"
11+
# Get the ARCH
12+
ARCH=`uname -m | sed 's|i686|386|' | sed 's|x86_64|amd64|'`
13+
# Install Prereq Packages
14+
sudo apt-get update
15+
sudo apt-get upgrade -y
16+
sudo apt-get install -y build-essential curl git-core libpcre3-dev mercurial pkg-config zip
17+
# Install Go
18+
cd /tmp
19+
wget --quiet https://storage.googleapis.com/golang/go${GOVERSION}.linux-${ARCH}.tar.gz
20+
tar -xvf go${GOVERSION}.linux-${ARCH}.tar.gz
21+
sudo mv go $SRCROOT
22+
sudo chmod 775 $SRCROOT
23+
sudo chown vagrant:vagrant $SRCROOT
24+
# Setup the GOPATH; even though the shared folder spec gives the working
25+
# directory the right user/group, we need to set it properly on the
26+
# parent path to allow subsequent "go get" commands to work.
27+
sudo mkdir -p $SRCPATH
28+
sudo chown -R vagrant:vagrant $SRCPATH 2>/dev/null || true
29+
# ^^ silencing errors here because we expect this to fail for the shared folder
30+
cat <<EOF >/tmp/gopath.sh
31+
export GOPATH="$SRCPATH"
32+
export GOROOT="$SRCROOT"
33+
export PATH="$SRCROOT/bin:$SRCPATH/bin:\$PATH"
34+
EOF
35+
cat <<EOF >>~/.bashrc
36+
## Make sure we have the source for Docker Machine itself
37+
go get -u github.com/docker/machine
38+
## After login, change to docker-machine-driver-ddcloud directory
39+
cd /opt/gopath/src/github.com/DimensionDataResearch/docker-machine-driver-ddcloud
40+
EOF
41+
sudo mv /tmp/gopath.sh /etc/profile.d/gopath.sh
42+
sudo chmod 0755 /etc/profile.d/gopath.sh
43+
SCRIPT
44+
45+
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
46+
config.vm.box = "bento/ubuntu-14.04"
47+
config.vm.hostname = "docker-machine-driver-ddcloud"
48+
49+
config.vm.provision "shell", inline: $script, privileged: false
50+
config.vm.synced_folder '.', '/opt/gopath/src/github.com/DimensionDataResearch/docker-machine-driver-ddcloud'
51+
52+
["vmware_fusion", "vmware_workstation"].each do |p|
53+
config.vm.provider p do |v|
54+
v.vmx["memsize"] = "4096"
55+
v.vmx["numvcpus"] = "2"
56+
end
57+
end
58+
59+
config.vm.provider "virtualbox" do |v|
60+
v.memory = 4096
61+
v.cpus = 2
62+
end
63+
64+
config.vm.provider "parallels" do |prl|
65+
prl.memory = 4096
66+
prl.cpus = 2
67+
end
68+
end

driver.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -84,19 +84,19 @@ type Driver struct {
8484
func (driver *Driver) GetCreateFlags() []mcnflag.Flag {
8585
return []mcnflag.Flag{
8686
mcnflag.StringFlag{
87-
EnvVar: "DD_COMPUTE_USER",
87+
EnvVar: "MCP_USER",
8888
Name: "ddcloud-user",
8989
Usage: "The CloudControl user name",
9090
Value: "",
9191
},
9292
mcnflag.StringFlag{
93-
EnvVar: "DD_COMPUTE_PASSWORD",
93+
EnvVar: "MCP_PASSWORD",
9494
Name: "ddcloud-password",
9595
Usage: "The CloudControl password",
9696
Value: "",
9797
},
9898
mcnflag.StringFlag{
99-
EnvVar: "DD_COMPUTE_REGION",
99+
EnvVar: "MCP_REGION",
100100
Name: "ddcloud-region",
101101
Usage: "The CloudControl region name",
102102
Value: "",
@@ -122,25 +122,25 @@ func (driver *Driver) GetCreateFlags() []mcnflag.Flag {
122122
Value: DefaultImageName,
123123
},
124124
mcnflag.StringFlag{
125-
EnvVar: "DD_COMPUTE_SSH_USER",
125+
EnvVar: "MCP_SSH_USER",
126126
Name: "ddcloud-ssh-user",
127127
Usage: "The SSH username to use. Default: root",
128128
Value: "root",
129129
},
130130
mcnflag.StringFlag{
131-
EnvVar: "DD_COMPUTE_SSH_KEY",
131+
EnvVar: "MCP_SSH_KEY",
132132
Name: "ddcloud-ssh-key",
133133
Usage: "The SSH key file to use",
134134
Value: "",
135135
},
136136
mcnflag.IntFlag{
137-
EnvVar: "DD_COMPUTE_SSH_PORT",
137+
EnvVar: "MCP_SSH_PORT",
138138
Name: "ddcloud-ssh-port",
139139
Usage: "The SSH port. Default: 22",
140140
Value: 22,
141141
},
142142
mcnflag.StringFlag{
143-
EnvVar: "DD_COMPUTE_SSH_BOOTSTRAP_PASSWORD",
143+
EnvVar: "MCP_SSH_BOOTSTRAP_PASSWORD",
144144
Name: "ddcloud-ssh-bootstrap-password",
145145
Usage: "The initial SSH password used to bootstrap SSH key authentication",
146146
Value: "",

0 commit comments

Comments
 (0)