testing support
Some checks failed
SHS Gitea/shstk/pipeline/head Something is wrong with the build of this commit
Some checks failed
SHS Gitea/shstk/pipeline/head Something is wrong with the build of this commit
This commit is contained in:
16
Jenkinsfile
vendored
16
Jenkinsfile
vendored
@@ -1,6 +1,10 @@
|
||||
@Library('SHS.Platforms') _
|
||||
def build_docker(dist, release_dir) {
|
||||
def build_docker(dist, release_dir, is_testing) {
|
||||
def image_name = "${dist.docker_image}-shstk"
|
||||
if (is_testing) {
|
||||
image_name += "-test"
|
||||
}
|
||||
|
||||
echo "Build image ${image_name}"
|
||||
def args = ""
|
||||
for (arg in dist.docker_build_options) {
|
||||
@@ -23,18 +27,24 @@ node {
|
||||
stage("Download SRC") {
|
||||
checkout scm
|
||||
}
|
||||
|
||||
|
||||
def currentBranch = "${env.BRANCH_NAME}"
|
||||
def is_testing = currentBranch.toLowerCase().contains("test")
|
||||
|
||||
def pl = new org.SHS.Platforms(this)
|
||||
pl.get()
|
||||
|
||||
def rel_dir = sh(script: "pwd", returnStdout: true).trim() + '/release'
|
||||
if (is_testing) {
|
||||
rel_dir += "-test"
|
||||
}
|
||||
echo "Release to ${rel_dir}"
|
||||
sh "rm -rvf ${rel_dir}"
|
||||
sh "mkdir -p ${rel_dir}"
|
||||
|
||||
def _msg = "Built images:"
|
||||
pl.forEach ({ dist ->
|
||||
_msg += build_docker(dist, rel_dir)
|
||||
_msg += build_docker(dist, rel_dir, is_testing)
|
||||
},
|
||||
stageSuffix: "-shstk",
|
||||
ondemand: true
|
||||
|
||||
Reference in New Issue
Block a user