-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
35 lines (33 loc) · 835 Bytes
/
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
pipeline {
agent {
node {
label 'jenkins-jnlp-with-docker'
}
}
stages {
stage('Build Jar') {
steps {
cleanWs()
checkout scm
sh '/opt/apache-maven-3.6.0/bin/mvn clean package -DskipTests'
}
}
stage('Build Image') {
steps {
script {
app = docker.build("nashpaz1/containertest")
}
}
}
stage('Push Image') {
steps {
script {
docker.withRegistry('https://registry.hub.docker.com', 'dockerhub') {
app.push("${BUILD_NUMBER}")
app.push("latest")
}
}
}
}
}
}