-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathhelm-deploy.pipeline
52 lines (51 loc) · 1.89 KB
/
helm-deploy.pipeline
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
def GITHUB_REPO = 'https://github.com/devopscorner/golang-adot'
node {
parameters {
string(name: 'HELM_ENV', defaultValue: 'lab', description: 'Enter Environment')
string(name: 'HELM_VERSION', defaultValue: '1.4.0-rc', description: 'Enter Version Number')
string(name: 'HELM_REPO_PATH', defaultValue: 's3://devopscorner-adot-chart/lab', description: 'Enter Helm Repo S3 Path')
string(name: 'HELM_REPO_NAME', defaultValue: 'devopscorner-lab', description: 'Enter Helm Repo Name')
}
stage('Clone'){
checkout([$class: 'GitSCM', branches: [[name: '*/develop']], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'CloneOption', depth: 2, noTags: true, reference: '', shallow: true]], submoduleCfg: [], userRemoteConfigs: [[credentialsId: 'github', url: GITHUB_REPO]]])
}
stage('Helm Pack'){
withEnv([
"env=$HELM_ENV",
"ver=$HELM_VERSION",
"repo_path=$HELM_REPO_PATH",
"repo_name=$HELM_REPO_NAME",
]) {
dir("template"){
sh '''
export TERM=xterm
export PATH_SCRIPT=`pwd`
sh $PATH_SCRIPT/helm-pack-jenkins.sh $env $ver $repo_path $repo_name
'''
}
}
}
stage('Helm Push'){
withEnv([
"env=$HELM_ENV",
"ver=$HELM_VERSION",
"repo_path=$HELM_REPO_PATH",
"repo_name=$HELM_REPO_NAME",
]) {
dir("template"){
sh '''
export TERM=xterm
export PATH_SCRIPT=`pwd`
sh $PATH_SCRIPT/helm-push-jenkins.sh $env $ver $repo_path $repo_name
'''
}
}
}
stage('Helm Update'){
sh '''
export TERM=xterm
export PATH_SCRIPT=`pwd`
helm repo update
'''
}
}