#26 Enable docker build
This commit is contained in:
29
build/Jenkinsfile
vendored
29
build/Jenkinsfile
vendored
@@ -29,6 +29,7 @@ pipeline {
|
|||||||
git config commit.gpgsign true
|
git config commit.gpgsign true
|
||||||
git config tag.gpgSign true
|
git config tag.gpgSign true
|
||||||
|
|
||||||
|
// We need to pass the repo url in -Darguments again because of insane maven lifecycle forking
|
||||||
pkgx mvn release:prepare -B \
|
pkgx mvn release:prepare -B \
|
||||||
-s build/settings.xml \
|
-s build/settings.xml \
|
||||||
-Dpassword="${GITEA_CREDS_PSW}" \
|
-Dpassword="${GITEA_CREDS_PSW}" \
|
||||||
@@ -52,7 +53,7 @@ pipeline {
|
|||||||
-s build/settings.xml \
|
-s build/settings.xml \
|
||||||
-DdryRun=${DRY_RUN} \
|
-DdryRun=${DRY_RUN} \
|
||||||
-Drepository.url=${REPO_URL} \
|
-Drepository.url=${REPO_URL} \
|
||||||
-Darguments="-DskipTests"
|
-Darguments="-Drepository.url=${REPO_URL} -DskipTests"
|
||||||
'''
|
'''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -63,20 +64,20 @@ pipeline {
|
|||||||
script {
|
script {
|
||||||
sh "pwd"
|
sh "pwd"
|
||||||
sh "ls -R"
|
sh "ls -R"
|
||||||
def jarPath = sh(script: "ls web-container/target/checkout/target/*.jar | head -n 1", returnStdout: true).trim()
|
def jarPath = sh(script: "ls target/checkout/web-container/target/*.jar | head -n 1", returnStdout: true).trim()
|
||||||
def releaseVer = sh(script: "pkgx mvn help:evaluate -Dexpression=project.version -q -DforceStdout -f web-container/target/checkout/pom.xml", returnStdout: true).trim()
|
def releaseVer = sh(script: "pkgx mvn help:evaluate -Dexpression=project.version -q -DforceStdout -f target/checkout/web-container/pom.xml", returnStdout: true).trim()
|
||||||
|
|
||||||
// docker.withRegistry("${env.DOCKER_REGISTRY}", '') {
|
docker.withRegistry("${env.DOCKER_REGISTRY}", '') {
|
||||||
// def customImage = docker.build("${env.DOCKER_REGISTRY}/my-app:${releaseVer}",
|
def customImage = docker.build("${env.DOCKER_REGISTRY}/my-app:${releaseVer}",
|
||||||
// "-f build/Dockerfile --build-arg JAR_FILE=${jarPath} .")
|
"-f build/Dockerfile --build-arg JAR_FILE=${jarPath} .")
|
||||||
//
|
|
||||||
// if (params.DRY_RUN) {
|
if (params.DRY_RUN) {
|
||||||
// echo "DRY_RUN - do not push image to registry"
|
echo "DRY_RUN - do not push image to registry"
|
||||||
// }
|
}
|
||||||
// else {
|
else {
|
||||||
// customImage.push("latest")
|
customImage.push("latest")
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user