-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile
More file actions
41 lines (41 loc) · 1.13 KB
/
Jenkinsfile
File metadata and controls
41 lines (41 loc) · 1.13 KB
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
#!groovy
pipeline {
environment {
registry = "vinaytr/rps-ant"
registryCredentials = 'docker-credentials'
}
agent any
stages {
stage('Clone the Git Repository') {
steps {
git credentialsId: 'git-credentials', url: 'https://github.com/9538541430/rps-ant.git'
}
}
stage('Building docker image') {
steps {
sh 'echo Building docker image'
script {
buildDate = new Date()
image = docker.build("${registry}:$BUILD_NUMBER")
}
}
}
stage('Registry-Push') {
steps {
sh 'echo Registry-push'
script {
docker.withRegistry('', registryCredentials) {
image.push()
image.push('latest')
}
}
}
}
stage('CleanUp workspace') {
steps {
sh ' echo CleanUp'
sh "docker rmi ${registry}:${BUILD_NUMBER}"
}
}
}
}