Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always backup live before deployment. #689

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions robo-components/DeploymentTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,9 @@ public function deployPantheonSync(string $env = 'test', bool $do_deploy = TRUE)
->stopOnFail();

if ($do_deploy) {
if ($env == 'live') {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To actually implement what @mariano-dagostino suggested, add the environment variable to .travis.yml to allow it conditionally. Like DEPLOY_AUTOBACKUP=true or similar, then getenv here. Also mind that we are inside DDEV, so we need to pass it: https://ddev.readthedocs.io/en/stable/users/extend/customization-extendibility/#providing-custom-environment-variables-to-a-container , https://github.com/Gizra/drupal-starter/blob/main/ci-scripts/prepare_deploy.sh#L26

$task->exec("terminus backup:create $pantheon_terminus_environment");
}
$task->exec("terminus env:deploy $pantheon_terminus_environment");
}

Expand Down