-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathJenkinsfile
63 lines (62 loc) · 1.7 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
pipeline {
agent any
stages {
stage('lint') {
agent {
dockerfile {
filename 'Dockerfile-idea'
reuseNode true
}
}
steps {
sh 'rm -rf target/idea_inspections'
sh 'idea.sh inspect $WORKSPACE $WORKSPACE/.idea/inspectionProfiles/Project_Inspections.xml $WORKSPACE/target/idea_inspections -v2 -d $WORKSPACE/src'
}
post {
always {
recordIssues(tools: [ideaInspection(pattern: 'target/idea_inspections/*.xml')])
}
}
}
stage('build') {
agent {
docker {
label 'master'
image 'maven'
reuseNode true
}
}
steps {
sh 'mvn -B -DskipTests clean package'
}
}
stage('test') {
agent {
docker {
label 'master'
image 'maven'
reuseNode true
}
}
steps {
sh 'mvn -B test'
}
post {
always {
junit 'target/surefire-reports/*.xml'
}
}
}
stage('deploy') {
environment {
IMAGE_NAME='awesome-image'
IMAGE_TAG="$BUILD_TAG"
}
steps {
// BUILD_TAG must have at most 128 characters
sh "docker build -t $IMAGE_NAME:$BUILD_TAG ."
sh 'echo ./deploy.sh'
}
}
}
}