-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile
More file actions
36 lines (36 loc) · 963 Bytes
/
Jenkinsfile
File metadata and controls
36 lines (36 loc) · 963 Bytes
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
pipeline {
agent {
label 'Build'
}
environment {
version = '0.1.0'
}
stages {
stage('Build Docker Image version') {
steps {
script {
dockerImage = docker.build("${REGISTRY}/${image}:${version}")
}
}
}
stage('Push Docker Image') {
steps {
script {
docker.withRegistry("http://${REGISTRY}", "${registryCredential}") {
dockerImage.push()
dockerImage.push('latest')
}
}
}
}
stage('Cleanup') {
steps {
script {
sh "docker rmi ${REGISTRY}/${image}:${version}"
sh "docker rmi ${REGISTRY}/${image}:latest"
sh "docker system prune -a -f"
}
}
}
}
}