Skip to content

Commit

Permalink
Use Terminus CLU (#203)
Browse files Browse the repository at this point in the history
* Use Terminus CLU for CircleCI
* Use Terminus CLU for GitLab
* Exit on errors for BitBucket CLU job
  • Loading branch information
ataylorme authored Oct 25, 2019
1 parent ecc8d39 commit 623f4c4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 15 deletions.
6 changes: 5 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -217,9 +217,13 @@ jobs:
name: setup-environment-vars
command: /build-tools-ci/scripts/set-environment

- run:
name: Authenticate with Terminus
command: terminus -n auth:login --machine-token="$TERMINUS_TOKEN"

- run:
name: run composer lock updater
command: set -e && clu https://${GITHUB_TOKEN}:[email protected]/${CI_PROJECT_USERNAME}/${CI_PROJECT_REPONAME}.git | sed -e "s/${GITHUB_TOKEN}/[REDACTED]/g"
command: set -e && terminus project:clu $TERMINUS_SITE

workflows:
version: 2
Expand Down
14 changes: 1 addition & 13 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -155,19 +155,7 @@ test:behat:cleanup:

schedule:composer:update:
stage: updates
variables:
# The default set of CI credentials do not contain the necessary permissions in GitLab for our operations.
LAB_CORE_TOKEN: $GITLAB_TOKEN
LAB_CORE_USER: $CI_REGISTRY_USER
LAB_CORE_HOST: "https://$CI_SERVER_HOST"
GIT_STRATEGY: none
script:
# The default repository URL uses a token without permission to write so replace it with ours.
- FULL_REPOSITORY_URL=$(sed 's|'"$CI_JOB_TOKEN"'|'"$GITLAB_TOKEN"'|' <<< "$CI_REPOSITORY_URL")
# lab tries to use CI variables with improper permissions.
- unset CI_PROJECT_URL
- unset CI_REGISTRY_USER
- unset CI_JOB_TOKEN
- set -e && clu --provider=gitlab $FULL_REPOSITORY_URL
- set -e && terminus project:clu $TERMINUS_SITE
only:
- schedules
2 changes: 1 addition & 1 deletion bitbucket-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,4 +127,4 @@ pipelines:
- export CI_PROJECT_NAME=$BITBUCKET_REPO_FULL_NAME && echo $CI_PROJECT_NAME
- /build-tools-ci/scripts/set-environment
- terminus -n auth:login --machine-token="$TERMINUS_TOKEN"
- terminus project:clu $TERMINUS_SITE
- set -e && terminus project:clu $TERMINUS_SITE

0 comments on commit 623f4c4

Please sign in to comment.