reset tasks/jenkinsfile

This commit is contained in:
2020-04-05 22:47:48 -04:00
parent 997bbca2f5
commit dbf603d828
2 changed files with 8 additions and 21 deletions

View File

@@ -6,12 +6,6 @@ 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'))
@@ -23,23 +17,16 @@ pipeline {
checkout scm checkout scm
sh 'ls' sh 'ls'
// dir("dockerfiles/tasks/$params.IMAGE") { withDockerRegistry(credentialsId: 'b11d7f1a-81ac-4daf-8842-56afc0d2370e', url: 'http://dkregistry.xai-corp.net:5000') {
// sh 'chmod +x build.sh && ls -l'
//
// sh './build.sh'
// }
def workdir = "dockerfiles/tasks/$params.IMAGE" dir("dockerfiles/tasks/$params.IMAGE") {
def dockerfile = 'Dockerfile' sh 'chmod +x build.sh && ls -l'
dir(workdir) { sh './build.sh'
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()
}
} }
}
} }
} }
} }

View File

@@ -20,7 +20,7 @@ pipeline {
def version = "7.0" def version = "7.0"
def dockerfile = "Dockerfile-70" def dockerfile = "Dockerfile-70"
dir(workdir) { dir(workdir) {
docker.withRegistry('http://dkregistry.xai-corp.net:5000') { docker.withRegistry('http://dkregistry.xai-corp.net:5000', 'b11d7f1a-81ac-4daf-8842-56afc0d2370e') {
def customImage = docker.build("dkregistry.xai-corp.net:5000/xaicorp/php:${version}", "-f ${dockerfile} .") def customImage = docker.build("dkregistry.xai-corp.net:5000/xaicorp/php:${version}", "-f ${dockerfile} .")
customImage.inside() { customImage.inside() {
sh "php --version | grep 'PHP 7.0'" sh "php --version | grep 'PHP 7.0'"
@@ -37,7 +37,7 @@ pipeline {
def version = "7.1" def version = "7.1"
def dockerfile = "Dockerfile-71" def dockerfile = "Dockerfile-71"
dir(workdir) { dir(workdir) {
docker.withRegistry('http://dkregistry.xai-corp.net:5000') { docker.withRegistry('http://dkregistry.xai-corp.net:5000', 'b11d7f1a-81ac-4daf-8842-56afc0d2370e') {
def customImage = docker.build("dkregistry.xai-corp.net:5000/xaicorp/php:${version}", "-f ${dockerfile} .") def customImage = docker.build("dkregistry.xai-corp.net:5000/xaicorp/php:${version}", "-f ${dockerfile} .")
customImage.inside() { customImage.inside() {
sh "php --version | grep 'PHP 7.1'" sh "php --version | grep 'PHP 7.1'"