Skip to content

Commit

Permalink
first spike at a CI bdd tests against GKE
Browse files Browse the repository at this point in the history
  • Loading branch information
rawlingsj committed Feb 7, 2018
1 parent e0cc75d commit 56453a7
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 0 deletions.
37 changes: 37 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
pipeline {
environment {
GH_CREDS = credentials('jenkins-x-github')
GKE_SA = credentials('gke-sa')
}
agent {
label "jenkins-jx-base"
}
stages {
stage('CI Build') {
when {
branch 'PR-*'
}
environment {
CLUSTER_NAME = "JXCE-$BRANCH_NAME"
ZONE = "europe-west1-b"
PROJECT_ID = "jenkinsx-dev"
SERVICE_ACCOUNT_FILE = "$GKE_SA"
}
steps {
container('jx-base') {
sh "./jx/scripts/ci-gke.sh"
}
}
}

stage('Build and Push Release') {
when {
branch 'master'
}
steps {
// auto upgrade demo env
echo 'auto upgrades not yet implemented'
}
}
}
}
16 changes: 16 additions & 0 deletions jx/scripts/ci-gke.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env bash
set -e
set -x

gcloud auth activate-service-account --key-file $SERVICE_ACCOUNT_FILE

jx create cluster gke -n ${CLUSTER_NAME,,} \
--skip-login=true \
--batch-mode \
--project-id ${PROJECT_ID} \
--zone ${ZONE} \
--machine-type n1-standard-2 \
--num-nodes 2 \
--git-username $GH_CREDS_USR \
--git-api-token $GH_CREDS_PSW \
--git-provider-url github.com
2 changes: 2 additions & 0 deletions jx/scripts/release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env bash

0 comments on commit 56453a7

Please sign in to comment.