rewrite php Jenkinsfile
This commit is contained in:
69
dockerfiles/tasks/php/Jenkinsfile
vendored
69
dockerfiles/tasks/php/Jenkinsfile
vendored
@@ -1,3 +1,5 @@
|
||||
def workdir = "dockerfiles/tasks/php"
|
||||
|
||||
pipeline {
|
||||
agent { label 'docker' }
|
||||
triggers {
|
||||
@@ -7,47 +9,46 @@ pipeline {
|
||||
disableConcurrentBuilds()
|
||||
buildDiscarder(logRotator(numToKeepStr: '2'))
|
||||
}
|
||||
|
||||
stages {
|
||||
// stage('Build Images') {
|
||||
// steps {
|
||||
// build job:
|
||||
// '_build_image',
|
||||
// parameters: [
|
||||
// string(name: 'IMAGE', value: 'php'),
|
||||
// string(name: 'VERSION', value: '7.2')
|
||||
// ],
|
||||
// quietPeriod: 1
|
||||
// }
|
||||
// }
|
||||
|
||||
def workdir = "dockerfiles/tasks/php"
|
||||
|
||||
stage('Build PHP Images') {
|
||||
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'"
|
||||
stage('Build PHP Images in Parallel') {
|
||||
failFast false
|
||||
parallel {
|
||||
stage("php70") {
|
||||
steps {
|
||||
script {
|
||||
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()
|
||||
}
|
||||
}
|
||||
}
|
||||
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'"
|
||||
stage ("php71") {
|
||||
steps {
|
||||
script {
|
||||
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()
|
||||
}
|
||||
}
|
||||
}
|
||||
customImage.push()
|
||||
}
|
||||
}
|
||||
}, failFast: false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user