-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathJenkinsfile
55 lines (49 loc) · 2.88 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
43
44
45
46
47
48
49
50
51
52
53
54
55
node {
stage('checkout') {
git branch: '${BRANCH}', url: 'https://github.com/hzi-braunschweig/SORMAS-central-data.git'
}
stage('reading from a file') {
script {
def props = readProperties file: '.env'
env.VERSION = props.VERSION
}
}
stage('Build container') {
echo 'Building align-local-central'
sh """
sudo buildah bud --pull-always --no-cache -t central-aligner:${VERSION} .
"""
echo 'Building infra-cleaner'
sh """
sudo buildah bud --pull-always --no-cache -f Dockerfile-Infra-Cleaner -t infra-cleaner:${VERSION} .
"""
echo 'Building central-verifier'
sh """
sudo buildah bud --pull-always --no-cache -f Dockerfile-Central-Verifier -t central-verifier:${VERSION} .
"""
echo 'Building insert-missing-name-dups'
sh """
sudo buildah bud --pull-always --no-cache -f Dockerfile-Insert-Missing-Name-Dups -t insert-missing-name-dups:${VERSION} .
"""
}
stage('Push image into registry') {
echo 'Deploying....'
withCredentials([ usernamePassword(credentialsId: 'registry.netzlink.com', usernameVariable: 'MY_SECRET_USER_NLI', passwordVariable: 'MY_SECRET_USER_PASSWORD_NLI' )]) {
sh """
sudo buildah login -u '$MY_SECRET_USER_NLI' -p '$MY_SECRET_USER_PASSWORD_NLI' registry.netzlink.com
sudo buildah push -f v2s2 central-aligner:${VERSION} registry.netzlink.com/hzibraunschweig/central-aligner:${VERSION}
sudo buildah push -f v2s2 central-aligner:${VERSION} registry.netzlink.com/hzibraunschweig/central-aligner:latest
sudo buildah push -f v2s2 central-aligner:${VERSION} registry.netzlink.com/hzibraunschweig/central-aligner:stable
sudo buildah push -f v2s2 infra-cleaner:${VERSION} registry.netzlink.com/hzibraunschweig/infra-cleaner:${VERSION}
sudo buildah push -f v2s2 infra-cleaner:${VERSION} registry.netzlink.com/hzibraunschweig/infra-cleaner:latest
sudo buildah push -f v2s2 infra-cleaner:${VERSION} registry.netzlink.com/hzibraunschweig/infra-cleaner:stable
sudo buildah push -f v2s2 central-verifier:${VERSION} registry.netzlink.com/hzibraunschweig/central-verifier:${VERSION}
sudo buildah push -f v2s2 central-verifier:${VERSION} registry.netzlink.com/hzibraunschweig/central-verifier:latest
sudo buildah push -f v2s2 central-verifier:${VERSION} registry.netzlink.com/hzibraunschweig/central-verifier:stable
sudo buildah push -f v2s2 insert-missing-name-dups:${VERSION} registry.netzlink.com/hzibraunschweig/insert-missing-name-dups:${VERSION}
sudo buildah push -f v2s2 insert-missing-name-dups:${VERSION} registry.netzlink.com/hzibraunschweig/insert-missing-name-dups:latest
sudo buildah push -f v2s2 insert-missing-name-dups:${VERSION} registry.netzlink.com/hzibraunschweig/insert-missing-name-dups:stable
"""
}
}
}