-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathJenkinsfile
32 lines (32 loc) · 963 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
def tag = ["master":"latest", "develop":"develop" ]
pipeline {
options {
buildDiscarder(logRotator(numToKeepStr: '30'))
timestamps()
disableConcurrentBuilds()
}
agent { label 'd3-build-agent' }
stages {
stage('Build') {
when {
beforeAgent true
expression { return (env.GIT_BRANCH in tag || env.TAG_NAME) }
}
agent { label 'd3-build-agent' }
steps {
script {
docker_tag = env.TAG_NAME ? env.TAG_NAME : tag[env.GIT_BRANCH]
def iC = docker.build("nexus.iroha.tech:19002/d3-deploy/back-office-admin:${docker_tag}")
docker.withRegistry('https://nexus.iroha.tech:19002', 'nexus-d3-docker') {
iC.push()
}
}
}
}
}
post {
cleanup {
cleanWs()
}
}
}