Skip to content

Instantly share code, notes, and snippets.

@daino3
Last active November 9, 2018 19:52
Show Gist options
  • Save daino3/c136bd5fd6751abf115a1e04edbc3c46 to your computer and use it in GitHub Desktop.
Save daino3/c136bd5fd6751abf115a1e04edbc3c46 to your computer and use it in GitHub Desktop.
#!/bin/sh
BOXNAME=`date +'vm_box_%m%d%Y_%H%M%S'`
vagrant destroy --force || exit $?
PACKAGING_BASE_BOX=1 vagrant up || exit $?
PACKAGING_BASE_BOX=1 vagrant package --out "$BOXNAME.box" || exit $?
vagrant box add $BOXNAME "./$BOXNAME.box" || exit $?
aws s3 cp "$BOXNAME.box" "s3://vagrant-boxes/" || exit $?
rm "./$BOXNAME.box"
echo "Set Vagrantfile box target to $BOXNAME and commit changes to VCS"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment