Skip to content

Commit

Permalink
ci: set --pr-id flag
Browse files Browse the repository at this point in the history
  • Loading branch information
vinmassaro authored Aug 31, 2022
1 parent bee6843 commit be99689
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions .ci/deploy/pantheon/dev-multidev
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,15 @@ terminus build:gitignore:cut
# Authenticate with Terminus
terminus -n auth:login --machine-token="$TERMINUS_TOKEN"

if [[ $CI_BRANCH != $DEFAULT_BRANCH ]]
if [[ "$CI_BRANCH" != "$DEFAULT_BRANCH" ]]
then
# Create a new multidev environment (or push to an existing one)
terminus -n build:env:create "$TERMINUS_SITE.dev" "$TERMINUS_ENV" --yes
if [ -n "$PR_NUMBER" ]; then
# Create a new multidev environment (or push to an existing one) with PR id set
terminus -n build:env:create "$TERMINUS_SITE.dev" "$TERMINUS_ENV" --yes --pr-id="$PR_NUMBER"
else
# Create a new multidev environment (or push to an existing one)
terminus -n build:env:create "$TERMINUS_SITE.dev" "$TERMINUS_ENV" --yes
fi
else
# Push to the dev environment
terminus -n build:env:push "$TERMINUS_SITE.dev" --yes
Expand All @@ -37,10 +42,10 @@ fi
terminus -n drush "$TERMINUS_SITE.$TERMINUS_ENV" -- cr

# Clear the environment cache
terminus -n env:clear-cache $TERMINUS_SITE.$TERMINUS_ENV
terminus -n env:clear-cache "$TERMINUS_SITE"."$TERMINUS_ENV"

# Ensure secrets are set
terminus -n secrets:set "$TERMINUS_SITE.$TERMINUS_ENV" token "${GH_TOKEN:-$GITHUB_TOKEN}" --file='.build-secrets/tokens.json' --clear --skip-if-empty
# Delete old multidev environments associated
# with a PR that has been merged or closed.
terminus -n build:env:delete:pr $TERMINUS_SITE --yes
terminus -n build:env:delete:pr "$TERMINUS_SITE" --yes

1 comment on commit be99689

@github-actions
Copy link

Choose a reason for hiding this comment

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

Visit Site

Created multidev environment ci-24 for vmassaro-test.

Please sign in to comment.