2013-06-24 13:41:48 +02:00
|
|
|
# Copyright (c) Citrix Systems Inc.
|
|
|
|
# All rights reserved.
|
|
|
|
#
|
|
|
|
# Redistribution and use in source and binary forms,
|
|
|
|
# with or without modification, are permitted provided
|
|
|
|
# that the following conditions are met:
|
|
|
|
#
|
|
|
|
# * Redistributions of source code must retain the above
|
|
|
|
# copyright notice, this list of conditions and the
|
|
|
|
# following disclaimer.
|
|
|
|
# * Redistributions in binary form must reproduce the above
|
|
|
|
# copyright notice, this list of conditions and the
|
|
|
|
# following disclaimer in the documentation and/or other
|
|
|
|
# materials provided with the distribution.
|
|
|
|
#
|
|
|
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
|
|
|
|
# CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
|
|
|
# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
|
|
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
|
|
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
|
|
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
|
|
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
|
|
|
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
|
|
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
|
|
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
|
|
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
|
|
|
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
|
|
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
# SUCH DAMAGE.
|
|
|
|
|
|
|
|
set -eu
|
|
|
|
|
2015-01-19 17:39:21 +01:00
|
|
|
DISABLE_PUSH=1
|
2013-06-24 13:41:48 +02:00
|
|
|
source "$( cd -P "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/declarations.sh"
|
|
|
|
|
2016-04-14 12:41:47 +02:00
|
|
|
source ${XENADMIN_DIR}/mk/copy-build-output.sh
|
|
|
|
|
2013-06-24 13:41:48 +02:00
|
|
|
if [ ${XS_BRANCH} = "trunk" ]
|
|
|
|
then
|
|
|
|
TRUNK_COLOUR=$(sh ${REPO}/mk/colour.sh)
|
|
|
|
TRUNK_COLOUR_L=$(echo ${TRUNK_COLOUR} | tr [:upper:] [:lower:])
|
|
|
|
if [ ${TRUNK_COLOUR_L} != "green" ]
|
|
|
|
then
|
2013-12-17 17:55:44 +01:00
|
|
|
echo "trunk is not green, disabling push"
|
2013-06-24 13:41:48 +02:00
|
|
|
DISABLE_PUSH=1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
#update local xenadmin-ref.hg repository
|
2015-06-08 12:43:27 +02:00
|
|
|
cp ${OUTPUT_DIR}/{manifest,latest-*-build,xcversion} ${ROOT}/xenadmin-ref.hg
|
2016-03-03 17:13:36 +01:00
|
|
|
cd ${ROOT}/xenadmin-ref.hg && hg commit -u Jenkins -m "Latest successful build ${get_BUILD_ID}"
|
2013-06-24 13:41:48 +02:00
|
|
|
|
2013-07-30 13:42:43 +02:00
|
|
|
if [ ${XS_BRANCH} = "trunk" ]
|
|
|
|
then
|
|
|
|
echo "Pushes are disabled on trunk."
|
|
|
|
else
|
|
|
|
if [ -z "${DISABLE_PUSH+xxx}" ]
|
|
|
|
then
|
|
|
|
cd ${ROOT}/xenadmin-ref.hg && hg push
|
|
|
|
else
|
|
|
|
echo "pushing to ssh://hg has been disabled"
|
|
|
|
fi
|
|
|
|
fi
|
2013-06-24 13:41:48 +02:00
|
|
|
|
|
|
|
set +u
|