testing support
Some checks failed
SHS Gitea/shstk/pipeline/head Something is wrong with the build of this commit

This commit is contained in:
2024-11-15 14:18:56 +03:00
parent 71b3272d1b
commit 100421bed6
2 changed files with 14 additions and 4 deletions

16
Jenkinsfile vendored
View File

@@ -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