-
Notifications
You must be signed in to change notification settings - Fork 28
/
Jenkinsfile_pushContainer
79 lines (60 loc) · 4.28 KB
/
Jenkinsfile_pushContainer
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
node {
stage('checkout') {
git branch: '${BRANCH}', url: 'https://github.com/sormas-foundation/SORMAS-Docker.git'
}
stage('DEPLOY to Netzlink Registry') {
if (env.DEPLOY_LOCAL.toBoolean()) {
echo 'Deploying locally....'
withCredentials([ usernamePassword(credentialsId: 'registry.netzlink.com', usernameVariable: 'MY_SECRET_USER_NLI', passwordVariable: 'MY_SECRET_USER_PASSWORD_NLI' )]) {
sh """
sed -i "/^GEO_TEMPLATE/d " ./.env
source ./.env
sudo buildah login -u $MY_SECRET_USER_NLI -p $MY_SECRET_USER_PASSWORD_NLI registry.netzlink.com
sudo buildah push -f v2s2 sormas-application registry.netzlink.com/hzibraunschweig/sormas-application:$SORMAS_DOCKER_VERSION
sudo buildah push -f v2s2 sormas-application registry.netzlink.com/hzibraunschweig/sormas-application:latest
sudo buildah push -f v2s2 sormas-postgres registry.netzlink.com/hzibraunschweig/sormas-postgres:$SORMAS_DOCKER_VERSION
sudo buildah push -f v2s2 sormas-postgres registry.netzlink.com/hzibraunschweig/sormas-postgres:latest
sudo buildah push -f v2s2 sormas-apache2 registry.netzlink.com/hzibraunschweig/sormas-apache2:$SORMAS_DOCKER_VERSION
sudo buildah push -f v2s2 sormas-apache2 registry.netzlink.com/hzibraunschweig/sormas-apache2:latest
sudo buildah push -f v2s2 sormas-pg-dump registry.netzlink.com/hzibraunschweig/sormas-pg-dump:$SORMAS_DOCKER_VERSION
sudo buildah push -f v2s2 sormas-pg-dump registry.netzlink.com/hzibraunschweig/sormas-pg-dump:latest
#sudo buildah push -f v2s2 sormas-letsencrypt registry.netzlink.com/hzibraunschweig/sormas-letsencrypt:$SORMAS_DOCKER_VERSION
#sudo buildah push -f v2s2 sormas-letsencrypt registry.netzlink.com/hzibraunschweig/sormas-letsencrypt:latest
sudo buildah push -f v2s2 sormas-keycloak registry.netzlink.com/hzibraunschweig/sormas-keycloak:$SORMAS_DOCKER_VERSION
sudo buildah push -f v2s2 sormas-keycloak registry.netzlink.com/hzibraunschweig/sormas-keycloak:latest
sudo buildah push -f v2s2 sormas-keycloak-postgres registry.netzlink.com/hzibraunschweig/keycloak-postgres:$SORMAS_DOCKER_VERSION
sudo buildah push -f v2s2 sormas-keycloak-postgres registry.netzlink.com/hzibraunschweig/keycloak-postgres:latest
#sudo buildah push -f v2s2 central-keycloak registry.netzlink.com/hzibraunschweig/central-keycloak:$SORMAS_DOCKER_VERSION
#sudo buildah push -f v2s2 central-keycloak registry.netzlink.com/hzibraunschweig/central-keycloak:latest
#sudo buildah push -f v2s2 central-redis registry.netzlink.com/hzibraunschweig/central-redis:$SORMAS_DOCKER_VERSION
#sudo buildah push -f v2s2 central-redis registry.netzlink.com/hzibraunschweig/central-redis:latest
"""
}
}
}
stage('DEPLOY to docker.io') {
echo 'Deploying to docker.io....'
withCredentials([ usernamePassword(credentialsId: 'dockerhub', usernameVariable: 'MY_SECRET_USER_DOCKER', passwordVariable: 'MY_SECRET_USER_PASSWORD_DOCKER' )]) {
withCredentials([ usernamePassword(credentialsId: 'registry.netzlink.com', usernameVariable: 'MY_SECRET_USER_NLI', passwordVariable: 'MY_SECRET_USER_PASSWORD_NLI' )]) {
sh """
sudo buildah rmi --prune
sudo buildah login -u $MY_SECRET_USER_NLI -p $MY_SECRET_USER_PASSWORD_NLI registry.netzlink.com
sudo buildah pull registry.netzlink.com/hzibraunschweig/sormas-apache2:$SORMAS_DOCKER_VERSION
sudo buildah logout
sudo buildah login -u $MY_SECRET_USER_DOCKER -p $MY_SECRET_USER_PASSWORD_DOCKER docker.io
sudo buildah push -f v2s2 hzibraunschweig/sormas-apache2:$SORMAS_DOCKER_VERSION hzibraunschweig/sormas-apache2:$SORMAS_DOCKER_VERSION
sudo buildah logout
"""
}
}
}
stage('DEPLOY to quay') {
echo 'Deploying to quay....'
withCredentials([ usernamePassword(credentialsId: 'quay_registry', usernameVariable: 'MY_SECRET_USER_QUAY', passwordVariable: 'MY_SECRET_USER_PASSWORD_QUAY' )]) {
withCredentials([ usernamePassword(credentialsId: 'registry.netzlink.com', usernameVariable: 'MY_SECRET_USER_NLI', passwordVariable: 'MY_SECRET_USER_PASSWORD_NLI' )]) {
sh """
"""
}
}
}
}