-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
50 lines (44 loc) · 1.19 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
49
50
#! groovy
pipeline {
agent {
kubernetes {
defaultContainer 'kaniko-crane'
yamlFile 'jnlp.yaml'
}
}
environment {
GITHASH = GIT_COMMIT.take(7)
}
stages {
stage('Build Docker Image') {
steps {
container('kaniko-crane') {
sh 'auto/kaniko-build.sh'
}
}
}
// stage('Scan Docker Image') {
// steps {
// container('trivy') {
// sh "auto/trivy.sh"
// }
// }
// }
stage('Push Docker Image') {
steps {
container('kaniko-crane') {
sh 'auto/kaniko-push.sh'
}
}
}
stage('Update Image Tag in Github') {
steps {
container('argocd-auto-sync') {
withCredentials([[$class: 'UsernamePasswordMultiBinding', credentialsId: 'github-app-weijilab', usernameVariable: 'GH_APPID', passwordVariable: 'GH_TOKEN']]) {
sh "auto/argocd-auto-sync ${GH_TOKEN}"
}
}
}
}
}
}