CI: Make build tag an acceptable docker name

Change-Id: I3a4b8a4a9c488ddabf9daf651dc1334222056f38
13.23
George Joseph 7 years ago
parent b97b39fe1b
commit 014f226bf1

@ -1,46 +1,46 @@
[ [
{ {
"name": "ari_a-d ", "name": "ari1",
"dir": "tests/CI/output/ari1", "dir": "tests/CI/output/ari1",
"testcmd": "--test-regex=tests/rest_api/[Ca-d]" "testcmd": "--test-regex=tests/rest_api/[Ca-d]"
}, },
{ {
"name": "ari_e-z ", "name": "ari2",
"dir": "tests/CI/output/ari2", "dir": "tests/CI/output/ari2",
"testcmd": "--test-regex=tests/rest_api/[e-z]" "testcmd": "--test-regex=tests/rest_api/[e-z]"
}, },
{ {
"name": "pjsip_a-f", "name": "pjs1",
"dir": "tests/CI/output/pjsip1", "dir": "tests/CI/output/pjsip1",
"testcmd": "--test-regex=tests/channels/pjsip/[a-f]" "testcmd": "--test-regex=tests/channels/pjsip/[a-f]"
}, },
{ {
"name": "pjsip_g-r", "name": "pjs2",
"dir": "tests/CI/output/pjsip2", "dir": "tests/CI/output/pjsip2",
"testcmd": "--test-regex=tests/channels/pjsip/[g-r]" "testcmd": "--test-regex=tests/channels/pjsip/[g-r]"
}, },
{ {
"name": "pjsip_s-z", "name": "pjs3",
"dir": "tests/CI/output/pjsip3", "dir": "tests/CI/output/pjsip3",
"testcmd": "--test-regex=tests/channels/pjsip/[s-z]" "testcmd": "--test-regex=tests/channels/pjsip/[s-z]"
}, },
{ {
"name": "sip_a-r ", "name": "sip1",
"dir": "tests/CI/output/sip1", "dir": "tests/CI/output/sip1",
"testcmd": "--test-regex=tests/channels/SIP/[Sa-r]" "testcmd": "--test-regex=tests/channels/SIP/[Sa-r]"
}, },
{ {
"name": "sip_s-z ", "name": "sip2",
"dir": "tests/CI/output/sip2", "dir": "tests/CI/output/sip2",
"testcmd": "--test-regex=tests/channels/SIP/[s-z]" "testcmd": "--test-regex=tests/channels/SIP/[s-z]"
}, },
{ {
"name": "iax2_locl", "name": "iax ",
"dir": "tests/CI/output/iax2_local", "dir": "tests/CI/output/iax2_local",
"testcmd": " -t tests/channels/iax2 -t tests/channels/local" "testcmd": " -t tests/channels/iax2 -t tests/channels/local"
}, },
{ {
"name": "pjsip_mwi", "name": "mwi ",
"dir": "tests/CI/output/extmwi", "dir": "tests/CI/output/extmwi",
"testcmd": "--test-regex=tests/channels/pjsip/.*mwi" "testcmd": "--test-regex=tests/channels/pjsip/.*mwi"
} }

@ -108,12 +108,13 @@ pipeline {
def dockerOptions = "--ulimit core=0 --ulimit nofile=10240 " + def dockerOptions = "--ulimit core=0 --ulimit nofile=10240 " +
" -v /srv/jenkins:/srv/jenkins:rw -v /srv/cache:/srv/cache:rw " + " -v /srv/jenkins:/srv/jenkins:rw -v /srv/cache:/srv/cache:rw " +
" --entrypoint=''" " --entrypoint=''"
def bt = env.BUILD_TAG.replaceAll(/[^a-zA-Z0-9_.-]/, '-')
def outputdir = "tests/CI/output/Testsuite" def outputdir = "tests/CI/output/Testsuite"
def img = docker.image(randomImage) def img = docker.image(randomImage)
img.pull() img.pull()
stage ("Build") { stage ("Build") {
img.inside(dockerOptions + " --name ${BUILD_TAG}-build") { img.inside(dockerOptions + " --name ${bt}-build") {
echo 'Building..' echo 'Building..'
env.CCACHE_DIR = "/srv/cache/ccache" env.CCACHE_DIR = "/srv/cache/ccache"
sh "./tests/CI/buildAsterisk.sh --output-dir=${outputdir} --cache-dir=/srv/cache" sh "./tests/CI/buildAsterisk.sh --output-dir=${outputdir} --cache-dir=/srv/cache"
@ -139,7 +140,7 @@ pipeline {
parallelTasks[groupName] = { parallelTasks[groupName] = {
stage (groupName) { stage (groupName) {
img.inside("${dockerOptions} --name ${BUILD_TAG}-${groupName}") { img.inside("${dockerOptions} --name ${bt}-${groupName}") {
lock("${JOB_NAME}.${NODE_NAME}.installer") { lock("${JOB_NAME}.${NODE_NAME}.installer") {
sh 'sudo ./tests/CI/installAsterisk.sh --user-group=jenkins:users' sh 'sudo ./tests/CI/installAsterisk.sh --user-group=jenkins:users'

@ -1,31 +1,31 @@
[ [
{ {
"name": "ari ", "name": "ari ",
"dir": "tests/CI/output/ari", "dir": "tests/CI/output/ari",
"testcmd": "-t tests/rest_api/" "testcmd": "-t tests/rest_api/"
}, },
{ {
"name": "pjsip ", "name": "pjs ",
"dir": "tests/CI/output/pjsip", "dir": "tests/CI/output/pjsip",
"testcmd": "-t tests/channels/pjsip" "testcmd": "-t tests/channels/pjsip"
}, },
{ {
"name": "sip ", "name": "sip ",
"dir": "tests/CI/output/sip", "dir": "tests/CI/output/sip",
"testcmd": "-t tests/channels/SIP" "testcmd": "-t tests/channels/SIP"
}, },
{ {
"name": "iax2_locl", "name": "iax ",
"dir": "tests/CI/output/iax2_local", "dir": "tests/CI/output/iax2_local",
"testcmd": " -t tests/channels/iax2 -t tests/channels/local" "testcmd": " -t tests/channels/iax2 -t tests/channels/local"
}, },
{ {
"name": "agi-apps ", "name": "apps",
"dir": "tests/CI/output/agi-apps", "dir": "tests/CI/output/agi-apps",
"testcmd": " -t tests/agi -t tests/apps -t blind-transfer-parkingtimeout" "testcmd": " -t tests/agi -t tests/apps -t blind-transfer-parkingtimeout"
}, },
{ {
"name": "other ", "name": "othr",
"dir": "tests/CI/output/other", "dir": "tests/CI/output/other",
"testcmd": " -T tests/(apps|agi|blind-transfer-parkingtimeout|rest_api|channels|realtime|example|skeleton_test|remote-test)" "testcmd": " -T tests/(apps|agi|blind-transfer-parkingtimeout|rest_api|channels|realtime|example|skeleton_test|remote-test)"
} }

@ -38,12 +38,13 @@ pipeline {
def dockerOptions = "--ulimit core=0 --ulimit nofile=10240 " + def dockerOptions = "--ulimit core=0 --ulimit nofile=10240 " +
" -v /srv/jenkins:/srv/jenkins:rw -v /srv/cache:/srv/cache:rw " + " -v /srv/jenkins:/srv/jenkins:rw -v /srv/cache:/srv/cache:rw " +
" --entrypoint=''" " --entrypoint=''"
def bt = env.BUILD_TAG.replaceAll(/[^a-zA-Z0-9_.-]/, '-')
def outputdir = "tests/CI/output/Testsuite" def outputdir = "tests/CI/output/Testsuite"
def img = docker.image(randomImage) def img = docker.image(randomImage)
img.pull() img.pull()
stage ("Build") { stage ("Build") {
img.inside(dockerOptions + " --name ${BUILD_TAG}-build") { img.inside(dockerOptions + " --name ${bt}-build") {
echo 'Building..' echo 'Building..'
env.CCACHE_DIR = "/srv/cache/ccache" env.CCACHE_DIR = "/srv/cache/ccache"
sh "./tests/CI/buildAsterisk.sh --output-dir=${outputdir} --cache-dir=/srv/cache" sh "./tests/CI/buildAsterisk.sh --output-dir=${outputdir} --cache-dir=/srv/cache"
@ -69,7 +70,7 @@ pipeline {
parallelTasks[groupName] = { parallelTasks[groupName] = {
stage (groupName) { stage (groupName) {
img.inside("${dockerOptions} --name ${BUILD_TAG}-${groupName}") { img.inside("${dockerOptions} --name ${bt}-${groupName}") {
lock("${JOB_NAME}.${NODE_NAME}.installer") { lock("${JOB_NAME}.${NODE_NAME}.installer") {
sh 'sudo ./tests/CI/installAsterisk.sh --user-group=jenkins:users' sh 'sudo ./tests/CI/installAsterisk.sh --user-group=jenkins:users'

@ -106,13 +106,12 @@ pipeline {
def r = currentBuild.startTimeInMillis % images.length def r = currentBuild.startTimeInMillis % images.length
def ri = images[(int)r] def ri = images[(int)r]
def randomImage = env.DOCKER_REGISTRY + "/" + ri; def randomImage = env.DOCKER_REGISTRY + "/" + ri;
def bt = env.BUILD_TAG.replaceAll(/[^a-zA-Z0-9_.-]/, '-')
def dockerOptions = "--ulimit core=0 --ulimit nofile=10240 " + def dockerOptions = "--ulimit core=0 --ulimit nofile=10240 " +
" -v /srv/jenkins:/srv/jenkins:rw -v /srv/cache:/srv/cache:rw " + " -v /srv/jenkins:/srv/jenkins:rw -v /srv/cache:/srv/cache:rw " +
" --entrypoint='' --name ${BUILD_TAG}-build" " --entrypoint='' --name ${bt}-build"
def outputdir = "tests/CI/output/UnitTests" def outputdir = "tests/CI/output/UnitTests"
def img = docker.image(randomImage) def img = docker.image(randomImage)
img.pull() img.pull()
img.inside(dockerOptions) { img.inside(dockerOptions) {

Loading…
Cancel
Save