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

ci: set --pr-id flag #14

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
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
2 changes: 1 addition & 1 deletion .github/workflows/build_deploy_and_test.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Build, deploy and test
on: push
on: pull_request
defaults:
run:
shell: bash
Expand Down