Skip to content

Commit

Permalink
fix: env
Browse files Browse the repository at this point in the history
  • Loading branch information
Faulo committed Sep 5, 2024
1 parent c07227a commit 109df90
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions Jenkinsfile.Docker
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,27 @@ pipeline {
agent {
label 'jenkins && docker'
}
environment {
VHOST = "historischer-spieleabend.slothsoft.net"
SERVICE = "vhosts_historischer-spieleabend"
}
stages {
stage('Build image and run tests') {
steps {
script {
docker.build("$VHOST:latest", "--build-arg VHOST=$VHOST .").inside {
sh 'cp -r tests /var/www/tests'
sh 'cd /var/www'
sh 'composer install'
sh 'composer exec phpunit -- --log-junit report.xml'
junit 'report.xml'
withEnv(readFile('.env').split('\n') as List) {
docker.build("$VHOST:latest", "--build-arg VHOST=$VHOST .").inside {
sh 'cp -r tests /var/www/tests'
sh 'cd /var/www'
sh 'composer install'
sh 'composer exec phpunit -- --log-junit report.xml'
junit 'report.xml'
}
}
}
}
}
stage('Deploy vhost') {
steps {
sh "docker service update --force --image $VHOST:latest $SERVICE"
withEnv(readFile('.env').split('\n') as List) {
sh "docker service update --force --image $VHOST:latest $SERVICE"
}
}
}
}
Expand Down

0 comments on commit 109df90

Please sign in to comment.