forked from jenkins-x/jenkins-x-boot-config
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: add initial bdd tests for local secrets
Signed-off-by: Cosmin Cojocar <[email protected]>
- Loading branch information
Showing
6 changed files
with
156 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
## BDD test using JX Boot with Local secrets |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
set -x | ||
|
||
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)" | ||
export GKE_SA="$(jx step credential -k bdd-credentials.json -s bdd-secret -f sa.json)" | ||
|
||
# fix broken `BUILD_NUMBER` env var | ||
export BUILD_NUMBER="$BUILD_ID" | ||
|
||
JX_HOME="/tmp/jxhome" | ||
KUBECONFIG="/tmp/jxhome/config" | ||
|
||
mkdir -p $JX_HOME | ||
|
||
jx --version | ||
jx step git credentials | ||
|
||
gcloud auth activate-service-account --key-file $GKE_SA | ||
|
||
# lets setup git | ||
git config --global --add user.name JenkinsXBot | ||
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_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" | ||
|
||
# TODO temporary hack until the batch mode in jx is fixed... | ||
export JX_BATCH_MODE="true" | ||
|
||
# prepare the BDD configuration | ||
mkdir bdd-config | ||
cp -rvf * bdd-config | ||
cp bdd/boot-local/jx-requirements.yml bdd-config | ||
cp bdd/boot-local/parameters.yaml bdd-config/env | ||
cd bdd-config | ||
|
||
# TODO hack until we fix boot to do this too! | ||
helm init --client-only | ||
helm repo add jenkins-x https://storage.googleapis.com/chartmuseum.jenkins-x.io | ||
|
||
jx step bdd \ | ||
--use-revision \ | ||
--versions-repo https://github.com/jenkins-x/jenkins-x-versions.git \ | ||
--config bdd/boot-local/cluster.yaml \ | ||
--gopath /tmp \ | ||
--git-provider=github \ | ||
--git-username $GH_USERNAME \ | ||
--git-owner $GH_OWNER \ | ||
--git-api-token $GH_CREDS_PSW \ | ||
--default-admin-password $JENKINS_CREDS_PSW \ | ||
--no-delete-app \ | ||
--no-delete-repo \ | ||
--tests install \ | ||
--tests test-create-spring |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
clusters: | ||
- name: boot-local | ||
args: | ||
- create | ||
- cluster | ||
- gke | ||
- --project-id=jenkins-x-bdd2 | ||
- -m=n1-standard-2 | ||
- --min-num-nodes=3 | ||
- --max-num-nodes=5 | ||
- -z=europe-west1-c | ||
- --skip-login | ||
- --skip-installation | ||
commands: | ||
- command: jx | ||
args: | ||
- boot | ||
- -b |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
cluster: | ||
clusterName: bdd-boot | ||
environmentGitOwner: cb-kubecd | ||
project: jenkins-x-bdd2 | ||
provider: gke | ||
zone: europe-west1-c | ||
environments: | ||
- key: dev | ||
owner: "" | ||
repository: "" | ||
- key: staging | ||
owner: "" | ||
repository: "" | ||
- key: production | ||
owner: "" | ||
repository: "" | ||
ingress: | ||
domain: "" | ||
externalDNS: false | ||
tls: | ||
email: "" | ||
enabled: false | ||
production: false | ||
kaniko: true | ||
secretStorage: local | ||
storage: | ||
logs: | ||
enabled: false | ||
url: "" | ||
reports: | ||
enabled: false | ||
url: "" | ||
repository: | ||
enabled: false | ||
url: "" | ||
webhook: prow | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
adminUser: | ||
username: admin | ||
enableDocker: false | ||
gitProvider: github | ||
gpg: {} | ||
pipelineUser: | ||
github: | ||
host: github.com | ||
username: jenkins-x-bot-test | ||
email: [email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
buildPack: none | ||
pipelineConfig: | ||
pipelines: | ||
pullRequest: | ||
pipeline: | ||
options: | ||
containerOptions: | ||
resources: | ||
limits: | ||
cpu: 4 | ||
memory: 6144Mi | ||
requests: | ||
cpu: 1 | ||
memory: 2048Mi | ||
environment: | ||
- name: GOPROXY | ||
value: http://jenkins-x-athens-proxy:80 | ||
agent: | ||
image: gcr.io/jenkinsxio/builder-go-maven:0.1.645 | ||
stages: | ||
- name: ci | ||
steps: | ||
- command: bdd/boot-local/ci.sh | ||
name: runci |