diff --git a/Makefile b/Makefile index 7549503..306401a 100644 --- a/Makefile +++ b/Makefile @@ -35,5 +35,17 @@ build-all: clean clean: rm -rf dist bin/docker-machine-driver-cloudca - +upload: + rm -f ./dist/docker-machine-driver-cloudca_${VERSION}_SWIFTURLS ; + SWIFT_ACCOUNT=`swift stat | grep Account: | sed s/Account:// | tr -d '[:space:]'` ; \ + SWIFT_URL=https://objects-qc.cloud.ca/v1 ; \ + SWIFT_CONTAINER=docker-machine-driver-cloudca ; \ + for FILE in `ls ./dist | grep -i docker-machine.*\.zip` ; do \ + echo "Uploading $$FILE to swift" ; \ + swift upload $${SWIFT_CONTAINER} ./dist/$$FILE --object-name ${VERSION}/$$FILE ; \ + echo "$${SWIFT_URL}/$${SWIFT_ACCOUNT}/$${SWIFT_CONTAINER}/${VERSION}/$$FILE" >> ./dist/docker-machine-driver-cloudca_${VERSION}_SWIFTURLS ; \ + done +release-notes: + ./release-notes.sh > ./dist/release.md ; +release: build-all upload release-notes .PHONY: init build install build-all clean diff --git a/README.md b/README.md index 61e5a62..59fc014 100644 --- a/README.md +++ b/README.md @@ -23,12 +23,13 @@ docker-machine create -d cloudca \ --cloudca-template "Ubuntu 16.04.01 HVM" \ --cloudca-compute-offering "1vCPU.1GB" \ --cloudca-network-id "bbefe8dd-bb3e-4f37-b467-b63f8334c15b" \ + --cloudca-root-disk-size-in-gb 60 \ --cloudca-additional-disk-offering "50GB - 50 IOPS Min." \ test-machine1 ``` **Notes:** * It is recommended to use Environment variables to store sensitive information like API keys. See the options below for the list of supported variables. -* The cloud.ca instances have limited disk space on their root volumes. In order to get more disk space for your Docker machines, use the `--cloudca-additional-disk-offering` option to specify an additional volume that Docker will be able to use. +* The cloud.ca instances have limited disk space on their root volumes. In order to get more disk space for your Docker machines, use the `--cloudca-root-disk-size-in-gb` if you have a resizable template or `--cloudca-additional-disk-offering` option to specify an additional volume that Docker will be able to use. ## Options @@ -40,6 +41,7 @@ docker-machine create -d cloudca \ |``--cloudca-template`` |``CLOUDCA_TEMPLATE`` |cloud.ca template name or ID |none |yes| |``--cloudca-compute-offering``|``CLOUDCA_COMPUTE_OFFERING``|cloud.ca compute offering name or ID|none |yes| |``--cloudca-network-id`` |``CLOUDCA_NETWORK_ID`` |cloud.ca network ID (where the machine will be deployed)|none |yes| +|``--cloudca-root-disk-size-in-gb`` |``CLOUDCA_ROOT_DISK_SIZE_IN_GB`` |cloud.ca root disk size in gb (for resizable templates) |size defined by template |no| |``--cloudca-additional-disk-offering``|``CLOUDCA_ADDITIONAL_DISK_OFFERING``|cloud.ca additional disk offering name or ID to attach to the machine|none |no| |``--cloudca-use-private-ip`` |``CLOUDCA_USE_PRIVATE_IP`` |Use a private IP to access the machine|false |no| |``--cloudca-ssh-user`` |``CLOUDCA_SSH_USER`` |cloud.ca SSH user|cca-user|no| diff --git a/cloudca.go b/cloudca.go index a76453a..a6a18ef 100644 --- a/cloudca.go +++ b/cloudca.go @@ -91,6 +91,7 @@ type Driver struct { MemoryInMb string NetworkId string VpcId string + RootDiskSizeInGb string AdditionalDiskOfferingId string AdditionalDiskSizeGb string AdditionalDiskIops string @@ -142,6 +143,11 @@ func (d *Driver) GetCreateFlags() []mcnflag.Flag { Usage: "cloud.ca memory in MB for custom compute offerings", EnvVar: "CLOUDCA_MEMORY_MB", }, + mcnflag.StringFlag{ + Name: "cloudca-root-disk-size-in-gb", + Usage: "cloud.ca root disk size in GB (for resizable templates)", + EnvVar: "CLOUDCA_ROOT_DISK_SIZE_GB", + }, mcnflag.StringFlag{ Name: "cloudca-additional-disk-offering", Usage: "cloud.ca additional disk offering name or ID to attach to the machine", @@ -222,6 +228,7 @@ func (d *Driver) SetConfigFromFlags(flags drivers.DriverOptions) error { } d.CpuCount = flags.String("cloudca-cpu-count") d.MemoryInMb = flags.String("cloudca-memory-mb") + d.RootDiskSizeInGb = flags.String("cloudca-root-disk-size-in-gb") if err := d.setNetwork(flags.String("cloudca-network-id")); err != nil { return err @@ -382,6 +389,13 @@ func (d *Driver) Create() error { memory, _ := strconv.Atoi(d.MemoryInMb) instanceToCreate.MemoryInMB = memory } + if d.RootDiskSizeInGb != "" { + rootDiskSizeInGb, err := strconv.Atoi(d.RootDiskSizeInGb) + if err != nil { + return err + } + instanceToCreate.RootVolumeSizeInGb = rootDiskSizeInGb + } if d.AdditionalDiskOfferingId != "" { instanceToCreate.UserData = userDataToMountVolume instanceToCreate.AdditionalDiskOfferingId = d.AdditionalDiskOfferingId diff --git a/glide.lock b/glide.lock index 652f098..599f397 100644 --- a/glide.lock +++ b/glide.lock @@ -1,8 +1,8 @@ -hash: 9c4a7f399e81ca9ffdbaf82626bea9668eb3c8d025b63110c39088640f9f4b7f -updated: 2017-04-11T11:08:15.061208815-04:00 +hash: e6b7f090140e81c7f6928331734c4dff8a3b3c3287f2f7973fab6f4eae92631c +updated: 2017-05-24T16:45:21.478919549-04:00 imports: - name: github.com/cloud-ca/go-cloudca - version: 04ff238f38fb6774027017b5b4445566b06762c2 + version: 21039f5a4375cdebddde9c7a0121ca6b5f56babb subpackages: - api - configuration @@ -13,7 +13,7 @@ imports: subpackages: - pkg/term - name: github.com/docker/machine - version: 15fd4c70403bab784d91031af02d9e169ce66412 + version: 5b274558ea6ca822c06dd407a4e774a0105c3f60 subpackages: - libmachine/drivers - libmachine/drivers/plugin diff --git a/glide.yaml b/glide.yaml index 7c59924..66f6e31 100644 --- a/glide.yaml +++ b/glide.yaml @@ -1,6 +1,7 @@ package: github.com/cloud-ca/docker-machine-driver-cloudca import: - package: github.com/cloud-ca/go-cloudca + version: v1.0.1 subpackages: - services/cloudca - package: github.com/docker/machine diff --git a/release-notes.sh b/release-notes.sh new file mode 100755 index 0000000..cbfa8c1 --- /dev/null +++ b/release-notes.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +VERSION="$(git describe --tags)" +function getUrl() { + echo $(cat ./dist/docker-machine-driver-cloudca_${VERSION}_SWIFTURLS | grep $1) +} + +echo "[DESCRIPTION HERE] + +# Issues fixed +[ISSUES HERE] + +# Downloads + +**macOS** +- 64-bit: $(getUrl darwin) + +**Linux** +- 64-bit: $(getUrl linux-amd64) +- 32-bit: $(getUrl linux-386) +- Arm: $(getUrl linux-arm) + +**Windows** +- 64-bit: $(getUrl windows-amd64) +- 32-bit: $(getUrl windows-386) +" \ No newline at end of file