-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathJenkinsfile
39 lines (39 loc) · 1.22 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
@Library('concordium-pipelines') _
pipeline {
agent any
environment {
image_repo = "concordium/transaction-logger"
image_name = "${image_repo}:${image_tag}"
}
stages {
stage('dockerhub-login') {
environment {
// Defines 'CRED_USR' and 'CRED_PSW'
// (see 'https://www.jenkins.io/doc/book/pipeline/jenkinsfile/#handling-credentials').
CRED = credentials('jenkins-dockerhub')
}
steps {
sh 'docker login --username "${CRED_USR}" --password "${CRED_PSW}"'
}
}
stage('build') {
steps {
sh '''\
docker build \
--build-arg=build_image="${build_image}" \
--label=build_image="${build_image}" \
--build-arg=base_image="${base_image}" \
--label=base_image="${base_image}" \
--tag="${image_name}" \
--pull \
.
'''.stripIndent()
}
}
stage('push') {
steps {
sh 'docker push "${image_name}"'
}
}
}
}