forked from madhubkk/restapp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
32 lines (32 loc) · 840 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
pipeline {
agent any
triggers {
pollSCM('H/2 * * * *')
}
environment {
IMAGE="simple-1.0"
}
stages {
stage('restapp build'){
steps{
sh 'echo Building ${BRANCH_NAME} ....'
sh 'sh $JENKINS_HOME/tools/hudson.tasks.Maven_MavenInstallation/M3/bin/mvn -e clean install'
}
}
stage('Build Docker Image'){
steps {
sh """
docker build -t opsmx11/restapp:${IMAGE} .
echo \"${IMAGE}\" > restapp.txt
"""
}
}
stage('Push Image'){
steps {
withCredentials([usernamePassword(credentialsId: 'Docker-hub-devcredentials', usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD')]) {
}
// sh "sudo docker push opsmx11/restapp:${IMAGE}"
}
}
}
}