Permalink
Browse files

updated to utilize sed and correct attempts failures

  • Loading branch information...
1 parent 3c7a214 commit 77a8f5b760462bdb13c483a61774f89af4fdd510 Mark Sakurada committed Apr 10, 2012
Showing with 7 additions and 6 deletions.
  1. +3 −0 README.md
  2. +4 −6 samples/rollback_demo/rollback.sh
View
@@ -100,6 +100,9 @@ Sample scripts currently include:
* update-db.sh: Run drush updatedb to perform database updates.
* db-scrub.sh: Scrub important information from a Drupal database.
* drupal-tests.sh: Run Drupal simpletests.
+* rollback.sh: Run designated simpletest testing againsts a branch/tag and rollback on failure.
+* newrelic.sh: Example of Acquia Hosting Cloud Hook to notify New Relic API of code version deployments.
+
## Supported hooks
@@ -33,8 +33,9 @@ if [ "$ATTEMPTS" -le 0 ]; then
fi
#now set the variable and append it into the settings file.
-let "ATTEMPS-=1"
-echo "ATTEMPS=$ATTEMPS">> $HOME/rollback_settings
+ORIGATTEMPTS=$ATTEMPTS
+let "ATTEMPTS-=1"
+sed -i "s/ATTEMPTS=$ORIGATTEMPTS/ATTEMPTS=$ATTEMPTS/" $HOME/rollback_settings
#initialize exit code so we can exit with 0 after rollback
extcode=0
@@ -69,10 +70,7 @@ else
#simpletests passed! Inform user then clear and set rollback_settings to new code base
echo "Testing passed on deploy of $deployedtag"
- echo "ORIGSOURCE='$deployedtag'"> $HOME/rollback_settings
- echo "TESTS='$TESTS'">> $HOME/rollback_settings
- echo "ATTEMPS=$ATTEMPS">> $HOME/rollback_settings
-
+ sed -i "s/ORIGSOURCE=$ORIGSOURCE/ORIGSOURCE=$deployedtag/" $HOME/rollback_settings
extcode=0
fi

0 comments on commit 77a8f5b

Please sign in to comment.