forked from EamonKeane/airflow-GKE-k8sExecutor-helm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
36 lines (36 loc) · 1.27 KB
/
Jenkinsfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/usr/bin/groovy
pipeline {
agent {
kubernetes {
label 'airflow-k8s-executor'
yamlFile 'jenkinsPodTemplate.yml'
}
}
stages {
stage('Checkout code') {
steps {
container('jnlp'){
script{
inputFile = readFile('Jenkinsfile.json')
config = new groovy.json.JsonSlurperClassic().parseText(inputFile)
containerTag = env.BRANCH_NAME + '-' + env.GIT_COMMIT.substring(0, 7)
println "pipeline config ==> ${config}"
} // script
} // container('jnlp')
} // steps
} // stage
stage ('Push airflow to Chart Museum'){
steps{
container('gcloud-helm'){
//Push chart to chart musuem
sh "helm repo add ${config.helm.repoName} ${config.helm.repo}"
sh "sed -i.bak 's/tag:.*/tag: ${containerTag}/g' ${config.helm.helmFolder}/values.yaml"
sh "sed -i.bak 's/version:.*/version: 0.2.0-$env.BRANCH_NAME-latest/g' ${config.helm.helmFolder}/Chart.yaml"
sh "helm push ${config.helm.helmFolder}/ ${config.helm.repoName}"
sh "sed -i.bak 's/version:.*/version: 0.2.0-${containerTag}/g' ${config.helm.helmFolder}/Chart.yaml"
sh "helm push ${config.helm.helmFolder}/ ${config.helm.repoName}"
}
}
}
}
}