|
|
@@ -13,60 +13,11 @@ node{
|
|
|
checkout scm
|
|
|
}
|
|
|
|
|
|
- // stage("Stop Preprod Container")
|
|
|
- // {
|
|
|
- // echo e ;
|
|
|
- // }
|
|
|
-
|
|
|
- // stage("Stop Preprod Container")
|
|
|
- // {
|
|
|
- // sh "docker kill server-apache-preprod server-express-preprod | docker rm server-apache-preprod server-express-preprod || true"
|
|
|
- // sh 'docker system prune -f'
|
|
|
- // }
|
|
|
-
|
|
|
-
|
|
|
- def imageApache = stage("Build apache preprod")
|
|
|
- {
|
|
|
- docker.build("server-apache-preprod", "--no-cache --label traefik.enable=true --label traefik.http.routers.server-apache-preprod.rule='Host(`angular-preprod.foodgame.fr`)' --label traefik.http.routers.server-apache-preprod.entrypoints=websecure --label traefik.http.routers.server-apache-preprod.tls.certresolver=myresolver -f build/docker/httpd/Dockerfile .")
|
|
|
- }
|
|
|
-
|
|
|
- def imageExpress = stage("Build express preprod")
|
|
|
- {
|
|
|
- docker.build("server-express-preprod", "--no-cache -f express-server/Dockerfile express-server")
|
|
|
- }
|
|
|
- stage("Run Container express preprod")
|
|
|
- {
|
|
|
- containerSql=imageExpress.run("--name server-express-preprod -v /home/formation/workflow/mysql:/var/lib/mysql --network=web")
|
|
|
- }
|
|
|
-
|
|
|
- stage("Run Container apache preprod")
|
|
|
- {
|
|
|
- containerApache=imageApache.run("--name server-apache-preprod --link server-mysql-preprod:mysql --network=web")
|
|
|
- }
|
|
|
-
|
|
|
- /*stage("Run Container express preprod")
|
|
|
- {
|
|
|
- containerSql=imageExpress.run("--name server-express-preprod -v /home/projet/fatboar/${e}/mysql:/var/lib/mysql --network=web")
|
|
|
- }
|
|
|
-
|
|
|
- stage("Run Container apache preprod")
|
|
|
- {
|
|
|
- containerApache=imageApache.run("--name server-apache-preprod --link server-mysql-preprod:mysql --network=web")
|
|
|
- }*/
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- // stage("Wait mysql"){
|
|
|
- // imageSql.inside {
|
|
|
- // sh 'while ! mysqladmin ping -h0.0.0.0 --silent; do sleep 1; done'
|
|
|
- // }
|
|
|
- // }
|
|
|
- // stage("Run test"){
|
|
|
- // imageApache.inside {
|
|
|
- // sh "php /var/www/src/bin/console doctrine:schema:update --force"
|
|
|
- // sh "php /var/www/src/bin/phpunit"
|
|
|
- // }
|
|
|
- // }
|
|
|
+ stage('Stop Containers')
|
|
|
+ {
|
|
|
+ sh 'docker ps | grep "workflow_" -v | awk -F " " \'{ if(NR>1) print $1}\' |xargs docker kill |xargs docker rm || true'
|
|
|
+ sh 'docker system prune -f'
|
|
|
+ }
|
|
|
|
|
|
|
|
|
// stage("Push preprod images to nexus")
|
|
|
@@ -78,77 +29,9 @@ node{
|
|
|
// }
|
|
|
// }
|
|
|
|
|
|
- // stage('Test')
|
|
|
- // {
|
|
|
-
|
|
|
- // dir("${env.WORKSPACE}/angular-client")
|
|
|
- // {
|
|
|
- // // sh 'npm i @angular-devkit/build-angular'
|
|
|
-
|
|
|
- // try
|
|
|
- // {
|
|
|
- // sh 'npm run test-ci'
|
|
|
- // }
|
|
|
- // catch(err)
|
|
|
- // {
|
|
|
- // sh 'echo TEST FAILED'
|
|
|
- // junit 'target/surefire-reports/TESTS-TestSuite.xml/*.xml'
|
|
|
- // throw err
|
|
|
- // }
|
|
|
-
|
|
|
- // /*def karma = docker.image('trion/ng-cli-karma')
|
|
|
- // karma.pull()
|
|
|
-
|
|
|
- // try
|
|
|
- // {
|
|
|
- // karma.run(' -u $(id -u) -v ${WORKSPACE}:/app trion/ng-cli-karma ')
|
|
|
- // karma.inside
|
|
|
- // {
|
|
|
- // sh 'npm install'
|
|
|
-
|
|
|
- // try
|
|
|
- // {
|
|
|
- // sh ('./node_modules/karma/bin/karma start karma.conf.js')
|
|
|
- // }
|
|
|
- // catch(err)
|
|
|
- // {
|
|
|
- // sh 'echo TEST FAILED'
|
|
|
- // step([$class: 'JUnitResultArchiver', testResults: 'target/surefire-reports/TESTS-TestSuite.xml/*.xml', healthScaleFactor: 1.0])
|
|
|
- // throw err
|
|
|
- // }
|
|
|
- // sh 'echo DO SOMETHING ELSE AFTER TEST'
|
|
|
- // }
|
|
|
- // sh 'ls -al '
|
|
|
- // }
|
|
|
- // catch(err)
|
|
|
- // {
|
|
|
- // sh 'echo RUN DOCKER FAILED'
|
|
|
- // throw err
|
|
|
- // }*/
|
|
|
- // }
|
|
|
- // }
|
|
|
-
|
|
|
+
|
|
|
|
|
|
- stage('ls')
|
|
|
- {
|
|
|
- sh 'ls -ls'
|
|
|
- }
|
|
|
-<<<<<<< HEAD
|
|
|
|
|
|
- stage("Run Container apache preprod")
|
|
|
- {
|
|
|
- containerApache=imageApache.run("--name server-apache-preprod --link server-mysql-preprod:mysql --network=web")
|
|
|
- }*/
|
|
|
-
|
|
|
-
|
|
|
- // stage("Push preprod images to nexus")
|
|
|
- // {
|
|
|
- // /*docker.withRegistry('http://localhost:8083','885ef60c-9352-489a-bd1c-e4b695747c21')
|
|
|
- // {
|
|
|
- // imageApache.push('latest')
|
|
|
- // imageExpress.push('latest')
|
|
|
- // }*/
|
|
|
- // }
|
|
|
stage('SonarQube analysis')
|
|
|
{
|
|
|
def scannerHome = tool name: 'SonarQube Scanner', type: 'hudson.plugins.sonar.SonarRunnerInstallation';
|
|
|
@@ -176,6 +59,4 @@ node{
|
|
|
{
|
|
|
sh 'echo "Félicitation tout c\'est bien déroulé!"'
|
|
|
}
|
|
|
-=======
|
|
|
->>>>>>> dev
|
|
|
}
|