mirror of
https://github.com/bvanroll/environment-ff-stage-euw1-gkecluster-primary-dev.git
synced 2025-08-29 12:02:41 +00:00
initial config based of jenkins-x/jenkins-x-boot-config with ref v1.0.82
This commit is contained in:
89
bdd/bdd.sh
Executable file
89
bdd/bdd.sh
Executable file
@@ -0,0 +1,89 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
set -x
|
||||
|
||||
if [ $# -ne 2 ]; then
|
||||
echo "Please provide the source and destination paths for configuration"
|
||||
exit -1
|
||||
fi
|
||||
SRC_PATH=$1
|
||||
DST_PATH=$2
|
||||
|
||||
export GH_USERNAME="jenkins-x-bot-test"
|
||||
export GH_EMAIL="jenkins-x@googlegroups.com"
|
||||
export GH_OWNER="jenkins-x-bot-test"
|
||||
|
||||
# fix broken `BUILD_NUMBER` env var
|
||||
export BUILD_NUMBER="$BUILD_ID"
|
||||
|
||||
JX_HOME="/tmp/jxhome"
|
||||
KUBECONFIG="/tmp/jxhome/config"
|
||||
|
||||
# lets avoid the git/credentials causing confusion during the test
|
||||
export XDG_CONFIG_HOME=$JX_HOME
|
||||
|
||||
mkdir -p $JX_HOME/git
|
||||
|
||||
jx --version
|
||||
|
||||
# replace the credentials file with a single user entry
|
||||
echo "https://$GH_USERNAME:$GH_ACCESS_TOKEN@github.com" > $JX_HOME/git/credentials
|
||||
|
||||
# setup GCP service account
|
||||
gcloud auth activate-service-account --key-file $GKE_SA
|
||||
|
||||
# setup git
|
||||
git config --global --add user.name JenkinsXBot
|
||||
git config --global --add user.email jenkins-x@googlegroups.com
|
||||
|
||||
echo "running the BDD tests with JX_HOME = $JX_HOME"
|
||||
|
||||
# setup jx boot parameters
|
||||
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_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"
|
||||
|
||||
# prepare the BDD configuration
|
||||
mkdir -p $DST_PATH
|
||||
cp -r `ls -A | grep -v "${DST_PATH}"` $DST_PATH
|
||||
cp $SRC_PATH/jx-requirements.yml $DST_PATH
|
||||
cp $SRC_PATH/parameters.yaml $DST_PATH/env
|
||||
cd $DST_PATH
|
||||
|
||||
# Rotate the domain to avoid cert-manager API rate limit
|
||||
if [[ "${DOMAIN_ROTATION}" == "true" ]]; then
|
||||
SHARD=$(date +"%l" | xargs)
|
||||
DOMAIN="${DOMAIN_PREFIX}${SHARD}${DOMAIN_SUFFIX}"
|
||||
if [[ -z "${DOMAIN}" ]]; then
|
||||
echo "Domain rotation enabled. Please set DOMAIN_PREFIX and DOMAIN_SUFFIX environment variables"
|
||||
exit -1
|
||||
fi
|
||||
echo "Using domain: ${DOMAIN}"
|
||||
sed -i "/^ *ingress:/,/^ *[^:]*:/s/domain: .*/domain: ${DOMAIN}/" jx-requirements.yml
|
||||
fi
|
||||
echo "Using jx-requirements.yml"
|
||||
cat jx-requirements.yml
|
||||
|
||||
# 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 $SRC_PATH/cluster.yaml \
|
||||
--gopath /tmp \
|
||||
--git-provider=github \
|
||||
--git-username $GH_USERNAME \
|
||||
--git-owner $GH_OWNER \
|
||||
--git-api-token $GH_ACCESS_TOKEN \
|
||||
--default-admin-password $JENKINS_PASSWORD \
|
||||
--no-delete-app \
|
||||
--no-delete-repo \
|
||||
--tests install \
|
||||
--tests test-create-spring
|
1
bdd/boot-local/README.md
Normal file
1
bdd/boot-local/README.md
Normal file
@@ -0,0 +1 @@
|
||||
## BDD test using JX Boot with Local secrets
|
18
bdd/boot-local/cluster.yaml
Normal file
18
bdd/boot-local/cluster.yaml
Normal file
@@ -0,0 +1,18 @@
|
||||
clusters:
|
||||
- name: boot-local
|
||||
args:
|
||||
- create
|
||||
- cluster
|
||||
- gke
|
||||
- --project-id=jenkins-x-bdd3
|
||||
- -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
|
39
bdd/boot-local/jx-requirements.yml
Normal file
39
bdd/boot-local/jx-requirements.yml
Normal file
@@ -0,0 +1,39 @@
|
||||
cluster:
|
||||
clusterName: bdd-boot-local
|
||||
environmentGitOwner: jenkins-x-bot-test
|
||||
project: jenkins-x-bdd3
|
||||
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: ""
|
||||
versionStream:
|
||||
ref: "master"
|
||||
url: https://github.com/jenkins-x/jenkins-x-versions.git
|
||||
webhook: prow
|
10
bdd/boot-local/parameters.yaml
Normal file
10
bdd/boot-local/parameters.yaml
Normal file
@@ -0,0 +1,10 @@
|
||||
adminUser:
|
||||
username: admin
|
||||
enableDocker: false
|
||||
gitProvider: github
|
||||
gpg: {}
|
||||
pipelineUser:
|
||||
github:
|
||||
host: github.com
|
||||
username: jenkins-x-bot-test
|
||||
email: jenkins-x@googlegroups.com
|
1
bdd/boot-vault/README.md
Normal file
1
bdd/boot-vault/README.md
Normal file
@@ -0,0 +1 @@
|
||||
## BDD test using JX Boot with Vault secrets
|
18
bdd/boot-vault/cluster.yaml
Normal file
18
bdd/boot-vault/cluster.yaml
Normal file
@@ -0,0 +1,18 @@
|
||||
clusters:
|
||||
- name: boot-vault
|
||||
args:
|
||||
- create
|
||||
- cluster
|
||||
- gke
|
||||
- --project-id=jenkins-x-bdd3
|
||||
- -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
|
42
bdd/boot-vault/jx-requirements.yml
Normal file
42
bdd/boot-vault/jx-requirements.yml
Normal file
@@ -0,0 +1,42 @@
|
||||
cluster:
|
||||
clusterName: bdd-boot-vault
|
||||
environmentGitOwner: jenkins-x-bot-test
|
||||
project: jenkins-x-bdd3
|
||||
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: vault
|
||||
repository: nexus
|
||||
storage:
|
||||
logs:
|
||||
enabled: false
|
||||
url: ""
|
||||
reports:
|
||||
enabled: false
|
||||
url: ""
|
||||
repository:
|
||||
enabled: false
|
||||
url: ""
|
||||
versionStream:
|
||||
ref: "master"
|
||||
url: https://github.com/jenkins-x/jenkins-x-versions.git
|
||||
vault:
|
||||
disableURLDiscovery: true
|
||||
webhook: prow
|
10
bdd/boot-vault/parameters.yaml
Normal file
10
bdd/boot-vault/parameters.yaml
Normal file
@@ -0,0 +1,10 @@
|
||||
adminUser:
|
||||
username: admin
|
||||
enableDocker: false
|
||||
gitProvider: github
|
||||
gpg: {}
|
||||
pipelineUser:
|
||||
github:
|
||||
host: github.com
|
||||
username: jenkins-x-bot-test
|
||||
email: jenkins-x@googlegroups.com
|
Reference in New Issue
Block a user