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'],
|
choices: ['ansible', 'apidocjs', 'composer', 'mondrian', 'php'],
|
||||||
description: 'What image would you like to build?'
|
description: 'What image would you like to build?'
|
||||||
)
|
)
|
||||||
|
string(
|
||||||
|
name: 'VERSION',
|
||||||
|
default: 'latest',
|
||||||
|
description: 'what tag to apply to the image'
|
||||||
|
|
||||||
|
)
|
||||||
}
|
}
|
||||||
options {
|
options {
|
||||||
buildDiscarder(logRotator(numToKeepStr: '10'))
|
buildDiscarder(logRotator(numToKeepStr: '10'))
|
||||||
@@ -17,10 +23,22 @@ pipeline {
|
|||||||
checkout scm
|
checkout scm
|
||||||
sh 'ls'
|
sh 'ls'
|
||||||
|
|
||||||
dir("dockerfiles/tasks/$params.IMAGE") {
|
// dir("dockerfiles/tasks/$params.IMAGE") {
|
||||||
sh 'chmod +x build.sh && ls -l'
|
// 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()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
2
dockerfiles/tasks/php/Jenkinsfile
vendored
2
dockerfiles/tasks/php/Jenkinsfile
vendored
@@ -21,7 +21,6 @@ pipeline {
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
stage('Build PHP Images') {
|
stage('Build PHP Images') {
|
||||||
steps {
|
|
||||||
def workdir = "dockerfiles/tasks/php"
|
def workdir = "dockerfiles/tasks/php"
|
||||||
parallel php70 {
|
parallel php70 {
|
||||||
def version = "7.0"
|
def version = "7.0"
|
||||||
@@ -51,4 +50,3 @@ pipeline {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
9
dockerfiles/tasks/robo/Dockerfile
Normal file
9
dockerfiles/tasks/robo/Dockerfile
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
# php Robo task runner container
|
||||||
|
#
|
||||||
|
FROM dkregistry.xai-corp.net:5000/xaicorp/php:7.2-dev
|
||||||
|
MAINTAINER Richard Morgan <r_morgan@sympatico.ca>
|
||||||
|
|
||||||
|
RUN wget http://robo.li/robo.phar \
|
||||||
|
&& chmod +x robo.phar && sudo mv robo.phar /usr/bin/robo
|
||||||
|
|
||||||
|
ENTRYPOINT ['/usr/bin/robo']
|
||||||
12
dockerfiles/tasks/robo/build.sh
Executable file
12
dockerfiles/tasks/robo/build.sh
Executable file
@@ -0,0 +1,12 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
#if [[ -z "${DKREGISTRY_PASS}" ]]; then
|
||||||
|
# docker login -u richard -p $DKREGISTRY_PASS $DKREGISTRY
|
||||||
|
#fi
|
||||||
|
|
||||||
|
docker build --rm -f Dockerfile -t xaicorp/php-robo .
|
||||||
|
docker run --rm xaicorp/php-robo --version | grep 'ansible 2.0.'
|
||||||
|
docker tag xaicorp/php-robo dkregistry.xai-corp.net:5000/xaicorp/php-robo
|
||||||
|
#docker push dkregistry.xai-corp.net:5000/xaicorp/php-robo
|
||||||
|
|
||||||
Reference in New Issue
Block a user