Skip to content

Instantly share code, notes, and snippets.

@OriPekelman
Created February 4, 2016 10:12
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 OriPekelman/8e297e555d348c2c833c to your computer and use it in GitHub Desktop.
Save OriPekelman/8e297e555d348c2c833c to your computer and use it in GitHub Desktop.
Jenkins Job To reset a platform project (used for demos)
# 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
@OriPekelman
Copy link
Author

screen shot 2016-02-04 at 11 08 08

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment