-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile-k8s
46 lines (37 loc) · 1.05 KB
/
Jenkinsfile-k8s
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
pipeline {
agent {
kubernetes {
yamlFile 'kaniko-builder.yaml'
}
}
environment {
APP_NAME = "complete-prodcution-e2e-pipeline"
RELEASE = "1.0.0"
DOCKER_USER = "dmancloud"
DOCKER_PASS = 'dockerhub'
IMAGE_NAME = "${DOCKER_USER}" + "/" + "${APP_NAME}"
IMAGE_TAG = "${RELEASE}-${BUILD_NUMBER}"
/* JENKINS_API_TOKEN = credentials("JENKINS_API_TOKEN") */
}
stages {
stage("Cleanup Workspace") {
steps {
cleanWs()
}
}
stage("Checkout from SCM"){
steps {
git branch: 'main', credentialsId: 'github', url: 'https://github.com/dmancloud/complete-prodcution-e2e-pipeline'
}
}
stage('Build & Push with Kaniko') {
steps {
container(name: 'kaniko', shell: '/busybox/sh') {
sh '''#!/busybox/sh
/kaniko/executor --dockerfile `pwd`/Dockerfile --context `pwd` --destination=${IMAGE_NAME}:${IMAGE_TAG} --destination=${IMAGE_NAME}:latest
'''
}
}
}
}
}