[Asterisk-code-review] CI: Make build tag an acceptable docker name (asterisk[13])

George Joseph asteriskteam at digium.com
Mon Jul 16 10:44:53 CDT 2018


George Joseph has submitted this change and it was merged. ( https://gerrit.asterisk.org/9439 )

Change subject: CI: Make build tag an acceptable docker name
......................................................................

CI: Make build tag an acceptable docker name

Change-Id: I3a4b8a4a9c488ddabf9daf651dc1334222056f38
---
M tests/CI/gateTestGroups.json
M tests/CI/gates.jenkinsfile
M tests/CI/periodic-dailyTestGroups.json
M tests/CI/periodics-daily.jenkinsfile
M tests/CI/unittests.jenkinsfile
5 files changed, 23 insertions(+), 22 deletions(-)

Approvals:
  George Joseph: Looks good to me, approved; Approved for Submit



diff --git a/tests/CI/gateTestGroups.json b/tests/CI/gateTestGroups.json
index f8ce047..7c8b917 100644
--- a/tests/CI/gateTestGroups.json
+++ b/tests/CI/gateTestGroups.json
@@ -1,46 +1,46 @@
 [
 	{
-		"name": "ari_a-d  ",
+		"name": "ari1",
 		"dir": "tests/CI/output/ari1",
 		"testcmd": "--test-regex=tests/rest_api/[Ca-d]"
 	},
 	{
-		"name": "ari_e-z  ",
+		"name": "ari2",
 		"dir": "tests/CI/output/ari2",
 		"testcmd": "--test-regex=tests/rest_api/[e-z]"
 	},
 	{
-		"name": "pjsip_a-f",
+		"name": "pjs1",
 		"dir": "tests/CI/output/pjsip1",
 		"testcmd": "--test-regex=tests/channels/pjsip/[a-f]"
 	},
 	{
-		"name": "pjsip_g-r",
+		"name": "pjs2",
 		"dir": "tests/CI/output/pjsip2",
 		"testcmd": "--test-regex=tests/channels/pjsip/[g-r]"
 	},
 	{
-		"name": "pjsip_s-z",
+		"name": "pjs3",
 		"dir": "tests/CI/output/pjsip3",
 		"testcmd": "--test-regex=tests/channels/pjsip/[s-z]"
 	},
 	{
-		"name": "sip_a-r  ",
+		"name": "sip1",
 		"dir": "tests/CI/output/sip1",
 		"testcmd": "--test-regex=tests/channels/SIP/[Sa-r]"
 	},
 	{
-		"name": "sip_s-z  ",
+		"name": "sip2",
 		"dir": "tests/CI/output/sip2",
 		"testcmd": "--test-regex=tests/channels/SIP/[s-z]"
 	},
 	{
-		"name": "iax2_locl",
+		"name": "iax ",
 		"dir": "tests/CI/output/iax2_local",
 		"testcmd": " -t tests/channels/iax2 -t tests/channels/local"
 	},
 	{
-		"name": "pjsip_mwi",
+		"name": "mwi ",
 		"dir": "tests/CI/output/extmwi",
 		"testcmd": "--test-regex=tests/channels/pjsip/.*mwi"
 	}
diff --git a/tests/CI/gates.jenkinsfile b/tests/CI/gates.jenkinsfile
index 7df6a8e..0705ab7 100644
--- a/tests/CI/gates.jenkinsfile
+++ b/tests/CI/gates.jenkinsfile
@@ -108,12 +108,13 @@
 					def dockerOptions = "--ulimit core=0 --ulimit nofile=10240 " +
 						" -v /srv/jenkins:/srv/jenkins:rw -v /srv/cache:/srv/cache:rw " +
 						" --entrypoint=''"
+					def bt = env.BUILD_TAG.replaceAll(/[^a-zA-Z0-9_.-]/, '-')
 					def outputdir = "tests/CI/output/Testsuite"
 					def img = docker.image(randomImage)
 					img.pull()
 
 					stage ("Build") {
-						img.inside(dockerOptions + " --name ${BUILD_TAG}-build") {
+						img.inside(dockerOptions + " --name ${bt}-build") {
 							echo 'Building..'
 							env.CCACHE_DIR = "/srv/cache/ccache"
 							sh "./tests/CI/buildAsterisk.sh --output-dir=${outputdir} --cache-dir=/srv/cache"
@@ -139,7 +140,7 @@
 						parallelTasks[groupName] = {
 							stage (groupName) {
 
-								img.inside("${dockerOptions} --name ${BUILD_TAG}-${groupName}") {
+								img.inside("${dockerOptions} --name ${bt}-${groupName}") {
 
 									lock("${JOB_NAME}.${NODE_NAME}.installer") {
 										sh 'sudo ./tests/CI/installAsterisk.sh  --user-group=jenkins:users'
diff --git a/tests/CI/periodic-dailyTestGroups.json b/tests/CI/periodic-dailyTestGroups.json
index 4e60ba0..b8c8e9b 100644
--- a/tests/CI/periodic-dailyTestGroups.json
+++ b/tests/CI/periodic-dailyTestGroups.json
@@ -1,31 +1,31 @@
 [
 	{
-		"name": "ari      ",
+		"name": "ari ",
 		"dir": "tests/CI/output/ari",
 		"testcmd": "-t tests/rest_api/"
 	},
 	{
-		"name": "pjsip    ",
+		"name": "pjs ",
 		"dir": "tests/CI/output/pjsip",
 		"testcmd": "-t tests/channels/pjsip"
 	},
 	{
-		"name": "sip      ",
+		"name": "sip ",
 		"dir": "tests/CI/output/sip",
 		"testcmd": "-t tests/channels/SIP"
 	},
 	{
-		"name": "iax2_locl",
+		"name": "iax ",
 		"dir": "tests/CI/output/iax2_local",
 		"testcmd": " -t tests/channels/iax2 -t tests/channels/local"
 	},
 	{
-		"name": "agi-apps ",
+		"name": "apps",
 		"dir": "tests/CI/output/agi-apps",
 		"testcmd": " -t tests/agi -t tests/apps -t blind-transfer-parkingtimeout"
 	},
 	{
-		"name": "other    ",
+		"name": "othr",
 		"dir": "tests/CI/output/other",
 		"testcmd": " -T tests/(apps|agi|blind-transfer-parkingtimeout|rest_api|channels|realtime|example|skeleton_test|remote-test)"
 	}
diff --git a/tests/CI/periodics-daily.jenkinsfile b/tests/CI/periodics-daily.jenkinsfile
index b84334a..fd9fa6b 100644
--- a/tests/CI/periodics-daily.jenkinsfile
+++ b/tests/CI/periodics-daily.jenkinsfile
@@ -38,12 +38,13 @@
 					def dockerOptions = "--ulimit core=0 --ulimit nofile=10240 " +
 						" -v /srv/jenkins:/srv/jenkins:rw -v /srv/cache:/srv/cache:rw " +
 						" --entrypoint=''"
+					def bt = env.BUILD_TAG.replaceAll(/[^a-zA-Z0-9_.-]/, '-')
 					def outputdir = "tests/CI/output/Testsuite"
 					def img = docker.image(randomImage)
 					img.pull()
 
 					stage ("Build") {
-						img.inside(dockerOptions + " --name ${BUILD_TAG}-build") {
+						img.inside(dockerOptions + " --name ${bt}-build") {
 							echo 'Building..'
 							env.CCACHE_DIR = "/srv/cache/ccache"
 							sh "./tests/CI/buildAsterisk.sh --output-dir=${outputdir} --cache-dir=/srv/cache"
@@ -69,7 +70,7 @@
 						parallelTasks[groupName] = {
 							stage (groupName) {
 
-								img.inside("${dockerOptions} --name ${BUILD_TAG}-${groupName}") {
+								img.inside("${dockerOptions} --name ${bt}-${groupName}") {
 
 									lock("${JOB_NAME}.${NODE_NAME}.installer") {
 										sh 'sudo ./tests/CI/installAsterisk.sh  --user-group=jenkins:users'
diff --git a/tests/CI/unittests.jenkinsfile b/tests/CI/unittests.jenkinsfile
index d9f28e7..83fd462 100644
--- a/tests/CI/unittests.jenkinsfile
+++ b/tests/CI/unittests.jenkinsfile
@@ -106,13 +106,12 @@
 					def r = currentBuild.startTimeInMillis % images.length
 					def ri = images[(int)r]
 					def randomImage = env.DOCKER_REGISTRY + "/" + ri;
+					def bt = env.BUILD_TAG.replaceAll(/[^a-zA-Z0-9_.-]/, '-')
 					def dockerOptions = "--ulimit core=0 --ulimit nofile=10240 " +
 						" -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 img = docker.image(randomImage)
 					img.pull()
 					img.inside(dockerOptions) {

-- 
To view, visit https://gerrit.asterisk.org/9439
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-MessageType: merged
Gerrit-Change-Id: I3a4b8a4a9c488ddabf9daf651dc1334222056f38
Gerrit-Change-Number: 9439
Gerrit-PatchSet: 1
Gerrit-Owner: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Jenkins2
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180716/2745c746/attachment-0001.html>


More information about the asterisk-code-review mailing list