mirror of
https://github.com/wardviaene/kubernetes-course.git
synced 2026-07-12 15:19:17 +00:00
39 lines
969 B
Plaintext
39 lines
969 B
Plaintext
pipeline {
|
|
agent {
|
|
kubernetes {
|
|
label 'helm-pod'
|
|
serviceAccount 'jenkins-helm'
|
|
containerTemplate {
|
|
name 'helm-pod'
|
|
image 'wardviaene/helm-s3'
|
|
ttyEnabled true
|
|
command 'cat'
|
|
}
|
|
}
|
|
}
|
|
stages {
|
|
stage('Run helm') {
|
|
steps {
|
|
container('helm-pod') {
|
|
git url: 'git://github.com/wardviaene/kubernetes-course.git', branch: 'master'
|
|
sh '''
|
|
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)
|
|
if [ $DEPLOYED == 0 ] ; then
|
|
helm install --name ${PACKAGE} my-charts/${PACKAGE}
|
|
else
|
|
helm upgrade ${PACKAGE} my-charts/${PACKAGE}
|
|
fi
|
|
echo "deployed!"
|
|
'''
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|