-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathJenkinsfile
More file actions
38 lines (33 loc) · 855 Bytes
/
Jenkinsfile
File metadata and controls
38 lines (33 loc) · 855 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
37
38
pipeline {
agent any
options {
buildDiscarder(logRotator(numToKeepStr:'3'))
}
stages {
stage('Checkout sources') {
steps {
checkout scm
}
}
stage('Build') {
agent {
dockerfile {
filename 'Dockerfile'
additionalBuildArgs "--build-arg BUILD_TAG=${BUILD_TAG}"
}
}
steps {
sh 'cp /build/openapi-repository/target/openapi-repository-*.zip .'
archiveArtifacts artifacts: 'openapi-repository-*.zip'
}
}
}
post {
always {
sh '''
docker images --filter "label=jenkins.build.tag=${BUILD_TAG}" -q | xargs -r docker rmi -f
'''
cleanWs()
}
}
}