2019-11-30 18:22:21 +01:00
|
|
|
node {
|
2019-11-30 18:33:05 +01:00
|
|
|
cleanWs()
|
|
|
|
stage('Checkout') {
|
|
|
|
checkout([$class: 'GitSCM', branches: [[name: '*/master']], browser: [$class: 'GogsGit', repoUrl: 'https://git.wmi.amu.edu.pl/s416138/ClearBowl.git'], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'RelativeTargetDirectory', relativeTargetDir: 'target']], submoduleCfg: [], userRemoteConfigs: [[credentialsId: 'jenkins_git.wmi.amu.edu.pl', url: 'git@git.wmi.amu.edu.pl:s416138/ClearBowl.git']]])
|
|
|
|
}
|
2019-11-30 18:28:14 +01:00
|
|
|
dir('target'){
|
2019-11-30 18:19:13 +01:00
|
|
|
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
|
|
|
}
|
2019-11-30 18:43:11 +01:00
|
|
|
docker.image('circleci/php:7.4').inside("--user 0:0 --link ${c.id}:db") {
|
2019-11-30 18:39:18 +01:00
|
|
|
stage("Prepare container") { sh 'docker-php-ext-install -j$(nproc) pdo_mysql' }
|
2019-11-30 18:38:04 +01:00
|
|
|
stage("Build") { sh 'composer install && mv .env.example .env' }
|
2019-11-30 18:19:13 +01:00
|
|
|
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
|
|
|
}
|
|
|
|
}
|