From 7d969cb7ae83994a3a1060bcb70366c1bfd39e71 Mon Sep 17 00:00:00 2001 From: richard Date: Sun, 5 Apr 2020 13:32:42 -0400 Subject: [PATCH] rewrite php Jenkinsfile --- dockerfiles/tasks/php/Jenkinsfile | 41 +++++++++++++++++++++++++++++-- 1 file changed, 39 insertions(+), 2 deletions(-) diff --git a/dockerfiles/tasks/php/Jenkinsfile b/dockerfiles/tasks/php/Jenkinsfile index f8a820f..42a3d83 100644 --- a/dockerfiles/tasks/php/Jenkinsfile +++ b/dockerfiles/tasks/php/Jenkinsfile @@ -8,9 +8,46 @@ pipeline { buildDiscarder(logRotator(numToKeepStr: '2')) } stages { - stage('Build Image') { +// stage('Build Images') { +// steps { +// build job: +// '_build_image', +// parameters: [ +// string(name: 'IMAGE', value: 'php'), +// string(name: 'VERSION', value: '7.2') +// ], +// quietPeriod: 1 +// } +// } + + stage('Build PHP Images') { steps { - build job: '_build_image', parameters: [string(name: 'IMAGE', value: 'php')], quietPeriod: 1 + def workdir = "dockerfiles/tasks/php" + parallel php70 { + def version = "7.0" + def dockerfile = "Dockerfile-70" + dir(workdir) { + docker.withRegistry('http://dkregistry.xai-corp.net:5000') { + def customImage = docker.build("dkregistry.xai-corp.net:5000/xaicorp/php:${version}", "-f ${dockerfile} .") + customImage.inside() { + sh "php --version | grep 'PHP 7.1'" + } + customImage.push() + } + } + }, php71 { + def version = "7.1" + def dockerfile = "Dockerfile-71" + dir(workdir) { + docker.withRegistry('http://dkregistry.xai-corp.net:5000') { + def customImage = docker.build("dkregistry.xai-corp.net:5000/xaicorp/php:${version}", "-f ${dockerfile} .") + customImage.inside() { + sh "php --version | grep 'PHP 7.1'" + } + customImage.push() + } + } + }, failFast: false } } }