From 4a7a12da446bcbeac706e012ae10c5bcbfd7247a Mon Sep 17 00:00:00 2001 From: Edward Viaene Date: Fri, 3 Aug 2018 13:53:26 +0000 Subject: [PATCH] serviceAccount --- helm/jenkins/Jenkinsfile.deploy | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/helm/jenkins/Jenkinsfile.deploy b/helm/jenkins/Jenkinsfile.deploy index d29548d..caa1ea0 100644 --- a/helm/jenkins/Jenkinsfile.deploy +++ b/helm/jenkins/Jenkinsfile.deploy @@ -2,22 +2,13 @@ pipeline { agent { kubernetes { label 'helm-pod' - defaultContainer 'jnlp' - yaml """ -apiVersion: v1 -kind: Pod -metadata: - labels: - some-label: helm-pod -spec: - serviceAccount: jenkins - containers: - - name: helm-pod - image: wardviaene/helm-s3 - command: - - cat - tty: true -""" + serviceAccount 'jenkins' + containerTemplate { + name 'helm-pod' + image 'wardviaene/helm-s3' + ttyEnabled true + command 'cat' + } } } stages { @@ -29,7 +20,7 @@ spec: HELM_BUCKET=helm-rytcufor PACKAGE=demo-chart export AWS_REGION=eu-west-1 - + cp -r /home/helm/.helm ~ helm repo add my-charts s3://${HELM_BUCKET}/charts DEPLOYED=$(helm list |grep -E "^${PACKAGE}" |grep DEPLOYED |wc -l) @@ -38,6 +29,7 @@ spec: else helm upgrade ${PACKAGE} my-charts/${PACKAGE} fi + echo "deployed!" ''' } }