-
Notifications
You must be signed in to change notification settings - Fork 2
/
Jenkinsfile
34 lines (34 loc) · 1.09 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
#!/usr/bin/groovy
pipeline {
agent {
kubernetes {
label 'jenkins-open-source-helm'
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('Initialise Helm Jenkins'){
steps {
container('gcloud-helm'){
sh "helm repo add ${config.helm.opensourceRepo.repoName} ${config.helm.opensourceRepo.repo}"
//push cluster svc
sh "helm push ${config.helm.clusterSvcFolder}/ ${config.helm.opensourceRepo.repoName}"
//push jenkins
sh "helm push ${config.helm.jenkinsFolder}/ ${config.helm.opensourceRepo.repoName}"
}//container gcloud-helm
}//steps
}//stage
} // stages
} // pipeline