rewrite php Jenkinsfile

This commit is contained in:
2020-04-05 22:05:02 -04:00
parent 76a0182188
commit bf34d4a946
3 changed files with 60 additions and 34 deletions

View File

@@ -0,0 +1,19 @@
FROM openjdk:8
MAINTAINER r.morgan105@mail.com
RUN curl https://jenkins.xai-corp.net/jnlpJars/jenkins-cli.jar -o /usr/local/bin/jenkins-cli.jar \
&& chmod +x /usr/local/bin/jenkins-cli.jar
ENTRYPOINT [\
"java",\
"-jar",\
"/usr/local/bin/jenkins-cli.jar",\
"-s",\
"http://jenkins.xai-corp.net:8080/",\
"-webSocket",\
"-auth",\
"richard:110768be7c9cd91ec076fb14fe4f17463f"\
]
CMD ["declarative-linter", "<", "/opt/project/Jenkinsfile"]

View File

@@ -0,0 +1,6 @@
#!/usr/bin/env bash
set -e
docker build --rm -f Dockerfile -t xaicorp/jenkins-cli .
#docker run --rm xaicorp/jenkins-cli --version | grep 'ansible 2.0.'
#docker tag xaicorp/jenkins-cli dkregistry.xai-corp.net:5000/xaicorp/jenkins-cli

View File

@@ -1,3 +1,5 @@
def workdir = "dockerfiles/tasks/php"
pipeline { pipeline {
agent { label 'docker' } agent { label 'docker' }
triggers { triggers {
@@ -7,23 +9,14 @@ pipeline {
disableConcurrentBuilds() disableConcurrentBuilds()
buildDiscarder(logRotator(numToKeepStr: '2')) buildDiscarder(logRotator(numToKeepStr: '2'))
} }
stages { stages {
// stage('Build Images') { stage('Build PHP Images in Parallel') {
// steps { failFast false
// build job: parallel {
// '_build_image', stage("php70") {
// parameters: [ steps {
// string(name: 'IMAGE', value: 'php'), script {
// string(name: 'VERSION', value: '7.2')
// ],
// quietPeriod: 1
// }
// }
def workdir = "dockerfiles/tasks/php"
stage('Build PHP Images') {
parallel php70 {
def version = "7.0" def version = "7.0"
def dockerfile = "Dockerfile-70" def dockerfile = "Dockerfile-70"
dir(workdir) { dir(workdir) {
@@ -35,7 +28,12 @@ pipeline {
customImage.push() customImage.push()
} }
} }
}, php71 { }
}
}
stage ("php71") {
steps {
script {
def version = "7.1" def version = "7.1"
def dockerfile = "Dockerfile-71" def dockerfile = "Dockerfile-71"
dir(workdir) { dir(workdir) {
@@ -47,7 +45,10 @@ pipeline {
customImage.push() customImage.push()
} }
} }
}, failFast: false }
}
}
}
} }
} }
} }