-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathJenkinsfile
60 lines (58 loc) · 1.76 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
51
52
53
54
55
56
57
58
59
60
pipeline {
agent any
environment {
//be sure to replace "texanraj/welcomeapp" with your own Docker image
DOCKER_IMAGE_NAME = "texanraj/welcomeapp"
}
stages {
stage('Build Docker Image') {
when {
branch 'master'
}
steps {
script {
app = docker.build(DOCKER_IMAGE_NAME)
}
}
}
stage('Push Docker Image') {
when {
branch 'master'
}
steps {
script {
docker.withRegistry('https://registry.hub.docker.com', 'docker_hub_login') {
app.push("${env.BUILD_NUMBER}")
app.push("latest")
}
}
}
}
stage('Scan Docker Image Using Aqua') {
when {
branch 'master'
}
steps {
script {
aqua customFlags: '', hideBase: false, hostedImage: DOCKER_IMAGE_NAME, localImage: '', locationType: 'hosted', notCompliesCmd: '', onDisallowed: 'ignore', policies: '', register: false, registry: 'Docker Hub', showNegligible: true
}
}
}
stage('DeployToProduction') {
when {
branch 'master'
}
steps {
// input 'Deploy to Production?'
// milestone(1)
script {
kubernetesDeploy(
kubeconfigId: 'kubeconfig',
configs: 'welcomeapp.yaml',
enableConfigSubstitution: true
)
}
}
}
}
}