-
Notifications
You must be signed in to change notification settings - Fork 29
/
Jenkinsfile
74 lines (74 loc) · 1.51 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
pipeline {
agent {
kubernetes {
yamlFile 'build-agent.yaml'
defaultContainer 'maven'
idleMinutes 1
}
}
environment {
APP_NAME = "sample-api-service"
IMAGE_REGISTRY = "rmkanda"
}
stages {
stage('Setup') {
parallel {
stage('Install Dependencies') {
steps {
container('maven') {
sh './mvnw install -DskipTests -Dspotbugs.skip=true -Ddependency-check.skip=true'
}
}
}
}
}
stage('Build') {
steps {
container('maven') {
sh './mvnw package -DskipTests -Dspotbugs.skip=true -Ddependency-check.skip=true'
}
}
}
stage('Static Analysis') {
parallel {
stage('Unit Tests') {
steps {
container('maven') {
sh './mvnw test'
}
}
}
}
}
stage('Package') {
steps {
container('docker-tools') {
sh "docker build . -t ${APP_NAME}"
}
}
}
stage('Publish') {
steps {
container('docker-tools') {
echo "Publishing docker image"
// sh "docker push ${APP_NAME}"
}
}
}
stage('Deploy to Dev') {
steps {
container('docker-tools') {
echo "Deploying the app"
// sh "kubectl apply -f k8s.yaml"
}
}
}
stage('Promote to Prod') {
steps {
container('docker-tools') {
echo "Promote to Prod"
}
}
}
}
}