Skip to content

Instantly share code, notes, and snippets.

@austinpray
Last active August 27, 2015 22:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save austinpray/d067346e447910f9d70a to your computer and use it in GitHub Desktop.
Save austinpray/d067346e447910f9d70a to your computer and use it in GitHub Desktop.
Test trellis
#!/usr/bin/env bash
set -eo pipefail
source ./CONFIG
(cd $T_DIR; vagrant destroy -f)
rm -rf ./.tmp
export TEST_TEMP=.tmp
export T_DIR=$TEST_TEMP/trellis
export B_DIR=$TEST_TEMP/site
export T_COMMIT=8a84639257bdeaceb3b440823e2ac78c5c17906a
export B_COMMIT=5dc485e1058e3a32c218e8d90c9abb5929f16cd4
#!/usr/bin/env bash
set -eo pipefail
vagrant destroy -f
vagrant vagrant up
CODE=$(curl -s -I -o /dev/null -w "%{http_code}" http://example.dev/bogus-url-lol)
if [ "$CODE" == "404" ]
then
echo "404"
exit 0
else
echo $CODE
exit 1
fi
#!/usr/bin/env bash
set -eo pipefail
cp test-bisect-run.sh .tmp/trellis
(
cd .tmp/trellis
git bisect start HEAD 373fe77e90e5208fc96a9def301bb9e17b66f2ac
git bisect run ./test-bisect-run.sh
git bisect reset
)
echo "lol"
#!/usr/bin/env bash
set -eo pipefail
source ./CONFIG
[ ! -e $TEST_TEMP ] && mkdir $TEST_TEMP
[ ! -e $T_DIR ] && git clone https://github.com/roots/trellis.git $T_DIR
(cd $T_DIR; git checkout $T_COMMIT)
[ ! -e $B_DIR ] && git clone https://github.com/roots/bedrock.git $B_DIR
(cd $B_DIR; git checkout $B_COMMIT)
(
cd $T_DIR
[ ! -e ./vendor ] && ansible-galaxy install -r requirements.yml
VM_STATUS=$(vagrant status --machine-readable | grep 'default,state,' | cut -d',' -f4)
echo "VM is $VM_STATUS"
if [ "$VM_STATUS" != "running" ]
then
vagrant up
fi
)
curl -vsI http://example.dev/
curl -vsI http://example.dev/sdfsdfrsgv
curl -vsI http://example.dev/completelybogus
echo "done";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment