pass through return code when calling destroy_app. allow custom git remote

This commit is contained in:
Michael Hobbs committed 2015-04-25 10:01:01 -07:00
1 parent 383deb2b1b
commit c8c4a6a0c6
1 file changed
+6 -2
+6 -2
View File
@@ -89,7 +89,9 @@ create_app() {
} }
destroy_app() { destroy_app() {
RC="$1"; RC=${RC:=0}
echo $TEST_APP | dokku apps:destroy $TEST_APP echo $TEST_APP | dokku apps:destroy $TEST_APP
return $RC
} }
add_domain() { add_domain() {
@@ -98,18 +100,20 @@ add_domain() {
deploy_app() { deploy_app() {
APP_TYPE="$1"; APP_TYPE=${APP_TYPE:="nodejs-express"} APP_TYPE="$1"; APP_TYPE=${APP_TYPE:="nodejs-express"}
GIT_REMOTE="$2"; GIT_REMOTE=${GIT_REMOTE:="dokku@dokku.me:$TEST_APP"}
TMP=$(mktemp -d -t "$TARGET.XXXXX") TMP=$(mktemp -d -t "$TARGET.XXXXX")
rmdir $TMP && cp -r ./tests/apps/$APP_TYPE $TMP rmdir $TMP && cp -r ./tests/apps/$APP_TYPE $TMP
cd $TMP cd $TMP
git init git init
git config user.email "robot@example.com" git config user.email "robot@example.com"
git config user.name "Test Robot" git config user.name "Test Robot"
git remote add target dokku@dokku.me:$TEST_APP echo "setting up remote: $GIT_REMOTE"
git remote add target $GIT_REMOTE
[[ -f gitignore ]] && mv gitignore .gitignore [[ -f gitignore ]] && mv gitignore .gitignore
git add . git add .
git commit -m 'initial commit' git commit -m 'initial commit'
git push target master || destroy_app git push target master || destroy_app $?
} }
setup_client_repo() { setup_client_repo() {