-
Notifications
You must be signed in to change notification settings - Fork 1
/
Jenkinsfile
48 lines (44 loc) · 1.96 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
37
38
39
40
41
42
43
44
45
46
47
48
#!/usr/bin/env groovy
node {
stage("Init"){
sh "curl -fsSL -o helm-v3.2.4-linux-amd64.tar.gz https://get.helm.sh/helm-v3.2.4-linux-amd64.tar.gz"
sh "tar -zxvf helm-v3.2.4-linux-amd64.tar.gz"
sh "mv linux-amd64/helm /usr/local/bin/helm"
}
stage ("Checkout and Package Charts") {
// Checkout PR Code
def scmVars = checkout scm
// Publish helm charts to test-automation repository
withCredentials([usernamePassword(credentialsId: "helmautomation",
passwordVariable: 'AUTOMATION_APIKEY', usernameVariable: 'AUTOMATION_USERNAME')]) {
// Perform Chart packaging
sh "git remote -v"
sh "helm dependency update ./test/"
sh "helm package --version 1.0.0 ./test/"
// sh "git remote set-url origin https://github.com/pegaautomationuser/helmcharts.git"
// sh "git config remote.origin.url https://github.com/pegaautomationuser/helmcharts.git"
sh "ls -al"
sh "git clone https://pegaautomationuser:${AUTOMATION_APIKEY}@github.com/pegaautomationuser/helmcharts.git --branch=gh-pages gh-pages"
sh "pwd"
sh "env | grep PWD"
sh "mv test-1.0.0.tgz gh-pages/"
sh "ls -al"
sh "cd gh-pages"
sh "pwd"
dir("gh-pages"){
sh "git remote -v"
sh "pwd"
sh "ls -al"
sh "helm repo index --merge index.yaml --url https://pegaautomationuser.github.io/helmcharts/ ."
sh "cat index.yaml"
sh "git config user.email [email protected]"
sh "git config user.name ${AUTOMATION_USERNAME}"
sh "git status"
sh "git remote -v"
sh "git add ."
sh "git commit -m \"Jenkins build to publish test artefacts\""
sh "git push -u origin gh-pages"
}
}
}
}