Skip to content
This repository has been archived by the owner on Feb 27, 2024. It is now read-only.

Commit

Permalink
Merge pull request #67 from ccojocar/volumes-for-secrets
Browse files Browse the repository at this point in the history
fix: set the environment variables directly from secrets instead of using step credential command
  • Loading branch information
jenkins-x-bot authored Sep 13, 2019
2 parents a8b0822 + a288946 commit a6cae54
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 8 deletions.
13 changes: 5 additions & 8 deletions bdd/bdd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ export GH_USERNAME="jenkins-x-bot-test"
export GH_EMAIL="[email protected]"
export GH_OWNER="cb-kubecd"

export GH_CREDS_PSW="$(jx step credential -s jenkins-x-bot-test-github)"
export JENKINS_CREDS_PSW="$(jx step credential -s test-jenkins-user)"

# fix broken `BUILD_NUMBER` env var
export BUILD_NUMBER="$BUILD_ID"

Expand All @@ -37,11 +34,11 @@ git config --global --add user.email [email protected]
echo "running the BDD tests with JX_HOME = $JX_HOME"

# setup jx boot parameters
export JX_VALUE_ADMINUSER_PASSWORD="$JENKINS_CREDS_PSW"
export JX_VALUE_ADMINUSER_PASSWORD="$JENKINS_PASSWORD"
export JX_VALUE_PIPELINEUSER_USERNAME="$GH_USERNAME"
export JX_VALUE_PIPELINEUSER_EMAIL="$GH_EMAIL"
export JX_VALUE_PIPELINEUSER_TOKEN="$GH_CREDS_PSW"
export JX_VALUE_PROW_HMACTOKEN="$GH_CREDS_PSW"
export JX_VALUE_PIPELINEUSER_TOKEN="$GH_ACCESS_TOKEN"
export JX_VALUE_PROW_HMACTOKEN="$GH_ACCESS_TOKEN"

# TODO temporary hack until the batch mode in jx is fixed...
export JX_BATCH_MODE="true"
Expand Down Expand Up @@ -79,8 +76,8 @@ jx step bdd \
--git-provider=github \
--git-username $GH_USERNAME \
--git-owner $GH_OWNER \
--git-api-token $GH_CREDS_PSW \
--default-admin-password $JENKINS_CREDS_PSW \
--git-api-token $GH_ACCESS_TOKEN \
--default-admin-password $JENKINS_PASSWORD \
--no-delete-app \
--no-delete-repo \
--tests install \
Expand Down
10 changes: 10 additions & 0 deletions jenkins-x-bdd-local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,16 @@ pipelineConfig:
value: /secrets/bdd/sa.json
- name: DOMAIN_ROTATION
value: "false"
- name: GH_ACCESS_TOKEN
valueFrom:
secretKeyRef:
name: jenkins-x-bot-test-github
key: password
- name: JENKINS_PASSWORD
valueFrom:
secretKeyRef:
name: test-jenkins-user
key: password
agent:
image: gcr.io/jenkinsxio/builder-go-maven
stages:
Expand Down
10 changes: 10 additions & 0 deletions jenkins-x-bdd-vault.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,16 @@ pipelineConfig:
value: ".bdd.jenkins-x.rocks"
- name: GKE_SA
value: /secrets/bdd/sa.json
- name: GH_ACCESS_TOKEN
valueFrom:
secretKeyRef:
name: jenkins-x-bot-test-github
key: password
- name: JENKINS_PASSWORD
valueFrom:
secretKeyRef:
name: test-jenkins-user
key: password
agent:
image: gcr.io/jenkinsxio/builder-go-maven
stages:
Expand Down

0 comments on commit a6cae54

Please sign in to comment.