ogcore/Jenkinsfile

47 lines
1.3 KiB
Groovy

pipeline {
agent {
node {
label 'jenkins-slave'
}
}
stages {
stage('Build Environmen') {
steps {
sh 'docker compose up --build -d'
}
}
stage('Install dependencies') {
steps {
sh 'docker exec ogcore-php composer install'
sh 'docker exec ogcore-php php bin/console lexik:jwt:generate-keypair --overwrite'
sh 'docker exec ogcore-php php bin/console doctrine:migrations:migrate --no-interaction'
sh 'docker exec ogcore-php php bin/console doctrine:fixtures:load --no-interaction'
}
}
stage('Tests') {
steps {
sh 'docker compose exec php bin/phpunit --log-junit phpunit.xml'
}
}
}
post {
always {
xunit (
testTimeMargin: '3000',
thresholdMode: 'percent',
thresholds: [
skipped: 0,
unstable: 0,
failed: 0
],
tools: [
PHPUnitJunit(
pattern: 'phpunit.xml'
)
]
)
}
}
}