Merge "Add a prefix variable to defaults as blank"
authorThanh Ha <thanh.ha@linuxfoundation.org>
Wed, 24 Jan 2018 14:57:36 +0000 (14:57 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Wed, 24 Jan 2018 14:57:36 +0000 (14:57 +0000)
check_prefix.sh [new file with mode: 0755]
jjb/releng-defaults.yaml
tox.ini

diff --git a/check_prefix.sh b/check_prefix.sh
new file mode 100755 (executable)
index 0000000..87a8427
--- /dev/null
@@ -0,0 +1,19 @@
+#!/bin/bash
+# SPDX-License-Identifier: EPL-1.0
+##############################################################################
+# Copyright (c) 2018 The Linux Foundation and others.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+##############################################################################
+# Ensures that the prefix MUST be set to blank
+#
+# The production prefix MUST always be a blank string.
+
+if grep 'prefix:' jjb/releng-defaults.yaml | grep -v "''"; then
+    echo "ERROR: A non-blank prefix is defined in jjb/releng-defaults.yaml"
+    echo "The prefix MUST be set to blank '' in production!"
+    exit 1
+fi
index 48e947e807b096f90092d63a1fafd6f595445955..080ace60f9fdf9a4612295190a69c757673838c5 100644 (file)
@@ -3,6 +3,7 @@
 
 - defaults:
     name: global
+    prefix: ''  # A prefix for job names sandbox for example: user-
 
     karaf-version: karaf4
     build-days-to-keep: 30
diff --git a/tox.ini b/tox.ini
index dc8e734f47bfac3651b4dfc69ace74a25bde7dc1..1429352c31009a9eaae7fb8f93b98685d19800db 100644 (file)
--- a/tox.ini
+++ b/tox.ini
@@ -25,6 +25,9 @@ commands = sphinx-build -b html -d {envtmpdir}/doctrees ./docs/ {toxinidir}/docs
 deps = flake8
 commands = flake8 scripts/
 
+[testenv:prefix]
+commands = ./check_prefix.sh
+
 [testenv:robot]
 commands = ./check_robot.sh