defensive coding for docbook-properties.sh
Quit with an error if the variable BRANCH is invalid. Change-Id: I878ae6cfec080ac360faa78707f377cfa0f3b93a
This commit is contained in:
parent
dde3d047d7
commit
8ba20e36c5
13
modules/jenkins/files/slave_scripts/docbook-properties.sh
Normal file → Executable file
13
modules/jenkins/files/slave_scripts/docbook-properties.sh
Normal file → Executable file
@ -10,17 +10,16 @@
|
||||
BRANCH=$ZUUL_REFNAME
|
||||
|
||||
# The master branch should get published to /trunk
|
||||
if [ $BRANCH == "master" ]
|
||||
then
|
||||
if [[ $BRANCH == "master" ]]; then
|
||||
DOC_RELEASE_PATH="trunk"
|
||||
DOC_COMMENTS_ENABLED=0
|
||||
fi
|
||||
|
||||
# The stable/<releasename> branch should get published to /releasename, such as icehouse or havana
|
||||
if [[ $BRANCH =~ ^stable/(.*)$ ]]
|
||||
then
|
||||
elif [[ $BRANCH =~ ^stable/(.*)$ ]]; then
|
||||
# The stable/<releasename> branch should get published to /releasename, such as icehouse or havana
|
||||
DOC_RELEASE_PATH=${BASH_REMATCH[1]}
|
||||
DOC_COMMENTS_ENABLED=1
|
||||
else
|
||||
echo "Error: Branch($BRANCH) is invalid"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "DOC_RELEASE_PATH=$DOC_RELEASE_PATH" >gerrit-doc.properties
|
||||
|
Loading…
x
Reference in New Issue
Block a user