diff --git a/Makefile b/Makefile index de216c0..153f385 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,8 @@ PACKER:=$(shell which packer) PACKER_BUILD=build +VERSION= +BOX=palantir/drupalbox .PHONY: drupalbox all: @@ -13,3 +15,21 @@ vmware: $(PACKER) $(PACKER_BUILD) -only=vmware-iso -var-file=drupalbox/ubuntu.json -except=vagrant-cloud drupalbox/drupalbox.json drupalbox: virtualbox + +vagrant-cloud: +ifeq ($(VERSION),) + @echo + @echo This command will release a new version of $(BOX): + @echo + @vagrant cloud box show $(BOX) + @echo + + @echo "Please provied a version number by re-running with this syntax:" + @echo " make vagrant-cloud VERSION=1.2.3" + @echo +else + @echo + @echo Creating a new release: '$(BOX) $(VERSION)' + @echo + packer build -only=virtualbox-iso -var-file=drupalbox/ubuntu.json -var 'cloud_dest=$(BOX)' -var 'cloud_version=$(VERSION)' drupalbox/drupalbox.json +endif diff --git a/docs/Updating-Existing-Box.md b/docs/Updating-Existing-Box.md index 93b8641..5042752 100644 --- a/docs/Updating-Existing-Box.md +++ b/docs/Updating-Existing-Box.md @@ -24,13 +24,13 @@ packer build -var-file=drupalbox/ubuntu.json drupalbox/drupalbox.json packer build -only=virtualbox-iso -var-file=drupalbox/ubuntu.json drupalbox/drupalbox.json ``` -Both of these approaches run similar commands, but running packer directly gives you the opportunity to use flags to manipulate the build process in a one-off fashion. Try `packer --help build` for details. +Both of these approaches run similar commands, but running packer directly gives you the opportunity to use flags to manipulate the build process in a one-off fashion. Try `packer --help build` for details, and see the `Makefile` for this project's standard usage. ## Releasing a box to Vagrant Cloud ``` -vagrant login -packer build -only=virtualbox-iso -var-file=drupalbox/ubuntu.json -var 'cloud_dest=palantir/drupalbox' -var 'cloud_version=999' drupalbox/drupalbox.json +vagrant cloud auth login +make vagrant-cloud ``` ## Updating Ubuntu diff --git a/drupalbox/drupalbox.json b/drupalbox/drupalbox.json index 817ef9e..8099b03 100644 --- a/drupalbox/drupalbox.json +++ b/drupalbox/drupalbox.json @@ -269,6 +269,6 @@ "ssh_username": "vagrant", "update": "true", "cloud_dest": "", - "cloud_version": "1.0.{{timestamp}}" + "cloud_version": "" } }