Skip to content

Commit

Permalink
updated to utilize sed and correct attempts failures
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Sakurada authored and Mark Sakurada committed Apr 10, 2012
1 parent 3c7a214 commit 77a8f5b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
3 changes: 3 additions & 0 deletions README.md
Expand Up @@ -100,6 +100,9 @@ Sample scripts currently include:
* update-db.sh: Run drush updatedb to perform database updates. * update-db.sh: Run drush updatedb to perform database updates.
* db-scrub.sh: Scrub important information from a Drupal database. * db-scrub.sh: Scrub important information from a Drupal database.
* drupal-tests.sh: Run Drupal simpletests. * 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 ## Supported hooks


Expand Down
10 changes: 4 additions & 6 deletions samples/rollback_demo/rollback.sh
Expand Up @@ -33,8 +33,9 @@ if [ "$ATTEMPTS" -le 0 ]; then
fi fi


#now set the variable and append it into the settings file. #now set the variable and append it into the settings file.
let "ATTEMPS-=1" ORIGATTEMPTS=$ATTEMPTS
echo "ATTEMPS=$ATTEMPS">> $HOME/rollback_settings let "ATTEMPTS-=1"
sed -i "s/ATTEMPTS=$ORIGATTEMPTS/ATTEMPTS=$ATTEMPTS/" $HOME/rollback_settings


#initialize exit code so we can exit with 0 after rollback #initialize exit code so we can exit with 0 after rollback
extcode=0 extcode=0
Expand Down Expand Up @@ -69,10 +70,7 @@ else


#simpletests passed! Inform user then clear and set rollback_settings to new code base #simpletests passed! Inform user then clear and set rollback_settings to new code base
echo "Testing passed on deploy of $deployedtag" echo "Testing passed on deploy of $deployedtag"
echo "ORIGSOURCE='$deployedtag'"> $HOME/rollback_settings sed -i "s/ORIGSOURCE=$ORIGSOURCE/ORIGSOURCE=$deployedtag/" $HOME/rollback_settings
echo "TESTS='$TESTS'">> $HOME/rollback_settings
echo "ATTEMPS=$ATTEMPS">> $HOME/rollback_settings

extcode=0 extcode=0


fi fi
Expand Down

0 comments on commit 77a8f5b

Please sign in to comment.