Skip to content

Commit

Permalink
Update Makefile to include vagrant-cloud release target.
Browse files Browse the repository at this point in the history
  • Loading branch information
becw committed Sep 26, 2019
1 parent 258de72 commit c1d4a31
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 4 deletions.
20 changes: 20 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@

PACKER:=$(shell which packer)
PACKER_BUILD=build
VERSION=
BOX=palantir/drupalbox
.PHONY: drupalbox

all:
Expand 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
6 changes: 3 additions & 3 deletions docs/Updating-Existing-Box.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion drupalbox/drupalbox.json
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,6 @@
"ssh_username": "vagrant",
"update": "true",
"cloud_dest": "",
"cloud_version": "1.0.{{timestamp}}"
"cloud_version": ""
}
}

0 comments on commit c1d4a31

Please sign in to comment.