rewrite php Jenkinsfile
This commit is contained in:
24
dockerfiles/tasks/Jenkinsfile
vendored
24
dockerfiles/tasks/Jenkinsfile
vendored
@@ -6,6 +6,12 @@ pipeline {
|
||||
choices: ['ansible', 'apidocjs', 'composer', 'mondrian', 'php'],
|
||||
description: 'What image would you like to build?'
|
||||
)
|
||||
string(
|
||||
name: 'VERSION',
|
||||
default: 'latest',
|
||||
description: 'what tag to apply to the image'
|
||||
|
||||
)
|
||||
}
|
||||
options {
|
||||
buildDiscarder(logRotator(numToKeepStr: '10'))
|
||||
@@ -17,10 +23,22 @@ pipeline {
|
||||
checkout scm
|
||||
sh 'ls'
|
||||
|
||||
dir("dockerfiles/tasks/$params.IMAGE") {
|
||||
sh 'chmod +x build.sh && ls -l'
|
||||
// dir("dockerfiles/tasks/$params.IMAGE") {
|
||||
// sh 'chmod +x build.sh && ls -l'
|
||||
//
|
||||
// sh './build.sh'
|
||||
// }
|
||||
|
||||
sh './build.sh'
|
||||
def workdir = "dockerfiles/tasks/$params.IMAGE"
|
||||
def dockerfile = 'Dockerfile'
|
||||
|
||||
dir(workdir) {
|
||||
docker.withRegistry('http://dkregistry.xai-corp.net:5000') {
|
||||
def customImage = docker.build("dkregistry.xai-corp.net:5000/xaicorp/${params.IMAGE}:${params.VERSION}", "-f ${dockerfile} .")
|
||||
customImage.inside() {
|
||||
}
|
||||
customImage.push()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user