ClearBowl/Jenkinsfile

20 lines
1.1 KiB
Plaintext
Raw Normal View History

2019-11-30 18:22:21 +01:00
node {
cleanWs()
2019-11-30 18:28:14 +01:00
stage('Checkout') {
checkout([$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'RelativeTargetDirectory', relativeTargetDir: 'target']], submoduleCfg: [], userRemoteConfigs: [[credentialsId: 'fccada8f-3d71-4a57-951d-9aa9dbf6a7cf', url: 'ssh://git@git.wmi.amu.edu.pl:s416138/ClearBowl.git']]])
}
dir('target'){
docker.image('mysql:latest').withRun('-e "MYSQL_ROOT_PASSWORD=8fcXUlCgC6JCqpoWX64" -e "MYSQL_DATABASE=clearbowl" -e "MYSQL_USER=api" -e "MYSQL_PASSWORD=R23qarINlcALOk2nDg6LbJelaqk"') { c ->
docker.image('mysql:latest').inside("--link ${c.id}:db") {
stage("Initialize DB"){
sh 'while ! mysqladmin ping -hdb --silent; do sleep 1; done'
}
2019-11-16 20:53:54 +01:00
}
docker.image('circleci/php:7.4').inside("--link ${c.id}:db") {
2019-11-30 18:26:00 +01:00
stage("Build") { sh 'ls -alh && composer install && mv .env.example .env' }
stage("Test") { sh 'vendor/bin/phpunit' }
2019-11-16 20:53:54 +01:00
}
2019-11-30 18:28:14 +01:00
}
2019-11-16 20:53:54 +01:00
}
}