forked from feedhenry/rhmap-backups
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
42 lines (36 loc) · 1.32 KB
/
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
36
37
38
39
40
41
42
#!groovy
// https://github.com/feedhenry/fh-pipeline-library
@Library('fh-pipeline-library') _
stage('Trust') {
enforceTrustedApproval()
}
fhBuildNode(['label': 'openshift']) {
final String COMPONENT = "backups"
final String VERSION = "1.0.0"
final String BUILD = env.BUILD_NUMBER
final String DOCKER_HUB_ORG = "rhmap"
final String DOCKER_HUB_REPO = COMPONENT
final String CHANGE_URL = env.CHANGE_URL
stage('Build Image') {
final Map params = [
fromDir: '.',
buildConfigName: COMPONENT,
imageRepoSecret: "dockerhub",
outputImage: "docker.io/${DOCKER_HUB_ORG}/${DOCKER_HUB_REPO}:${VERSION}-${BUILD}"
]
buildWithDockerStrategy params
archiveArtifacts writeBuildInfo('rhmap-backups', "${VERSION}-${BUILD}")
}
if (env.BRANCH_NAME && env.BRANCH_NAME == 'master') {
stage('Build Latest Image') {
final Map params = [
fromDir: '.',
buildConfigName: COMPONENT,
imageRepoSecret: "dockerhub",
outputImage: "docker.io/${DOCKER_HUB_ORG}/${DOCKER_HUB_REPO}:latest"
]
buildWithDockerStrategy params
archiveArtifacts writeBuildInfo('rhmap-backups', "${VERSION}-${BUILD}")
}
}
}