-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile.deploy
55 lines (55 loc) · 2.18 KB
/
Jenkinsfile.deploy
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
pipeline {
agent any
options {
buildDiscarder(logRotator(numToKeepStr: '10'))
skipDefaultCheckout()
ansiColor('xterm')
}
parameters {
string(name: 'VERSION', defaultValue: 'master')
}
stages {
stage('Checkout') {
steps {
checkout scm
sh 'git checkout $VERSION'
}
}
stage('Build') {
agent {
docker {
image 'maven:3.9.6-eclipse-temurin-17-alpine'
reuseNode true
}
}
steps {
sh 'mvn clean install'
}
}
stage('Deploy') {
steps {
sh 'mv target docker'
dir ('docker') {
withCredentials([
string(credentialsId: 'keystore-password', variable: 'KEYSTORE_PASSWORD'),
string(credentialsId: 'db-root-password', variable: 'DB_ROOT_PASSWORD'),
string(credentialsId: 'support-email-password', variable: 'SUPPORT_EMAIL_PASSWORD'),
string(credentialsId: 'destrostudios-auth-private-key-passphrase', variable: 'AUTH_PRIVATE_KEY_PASSPHRASE'),
file(credentialsId: 'destrostudios-auth-private-key', variable: 'AUTH_PRIVATE_KEY')
]) {
sh 'openssl rsa -in $AUTH_PRIVATE_KEY -passin pass:$AUTH_PRIVATE_KEY_PASSPHRASE -outform DER -out private.der'
sh 'openssl rsa -in $AUTH_PRIVATE_KEY -passin pass:$AUTH_PRIVATE_KEY_PASSPHRASE -pubout -outform PEM -out public.pem'
sh 'openssl pkcs12 -export -in /etc/letsencrypt/live/anselm-kuesters.de/cert.pem -inkey /etc/letsencrypt/live/anselm-kuesters.de/privkey.pem -certfile /etc/letsencrypt/live/anselm-kuesters.de/chain.pem -out keystore.p12 -passout pass:$KEYSTORE_PASSWORD -name destrostudios'
sh 'docker compose build --no-cache'
sh 'docker compose up -d'
}
}
}
}
}
post {
always {
cleanWs()
}
}
}