Created
February 4, 2016 10:12
-
-
Save OriPekelman/8e297e555d348c2c833c to your computer and use it in GitHub Desktop.
Jenkins Job To reset a platform project (used for demos)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# You should export the following variables: | |
# $API_TOKEN which you get from marketplace | |
# $PROJECT_ID the platform project like 'hzdp3vdw4poyg' | |
# $ENVIRONMENT for example 'master' | |
# $BACKUP_ID which you can get from the CLI | |
COMPOSER=$(command -v composer >/dev/null 2>&1) || true | |
if [ -z "$COMPOSER" ] && [ ! -f .build/composer.phar ]; then | |
mkdir -p .build | |
curl -sS https://getcomposer.org/composer.phar > .build/composer.phar | |
fi | |
cd .build | |
php composer.phar require platformsh/cli:@stable | |
PLATFORMSH_CLI_API_TOKEN=$API_TOKEN ./vendor/platformsh/cli/platform environment:restore --yes --project=$PROJECT_ID --environment=$ENVIRONMENT $BACKUP_ID |
Author
OriPekelman
commented
Feb 4, 2016
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment