2013-06-24 13:41:48 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2017-12-07 15:39:32 +01:00
|
|
|
# Copyright (c) Citrix Systems, Inc.
|
2013-06-24 13:41:48 +02:00
|
|
|
# All rights reserved.
|
2017-12-07 15:39:32 +01:00
|
|
|
#
|
|
|
|
# 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
|
2013-06-24 13:41:48 +02:00
|
|
|
# SUCH DAMAGE.
|
|
|
|
|
2017-01-18 14:33:36 +01:00
|
|
|
set -ex
|
2016-12-14 11:05:35 +01:00
|
|
|
|
2017-01-25 12:42:22 +01:00
|
|
|
SET_ENV_FILE="/cygdrive/c/env.sh"
|
|
|
|
if [ -f ${SET_ENV_FILE} ]; then
|
|
|
|
. ${SET_ENV_FILE}
|
|
|
|
fi
|
|
|
|
|
2013-06-24 13:41:48 +02:00
|
|
|
UNZIP="unzip -q -o"
|
|
|
|
|
|
|
|
mkdir_clean()
|
|
|
|
{
|
|
|
|
rm -rf $1 && mkdir -p $1
|
|
|
|
}
|
|
|
|
|
2017-01-18 14:33:36 +01:00
|
|
|
ROOT="$(cd -P "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
|
|
|
|
REPO="$(cd -P "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
|
|
SCRATCH_DIR=${ROOT}/scratch
|
|
|
|
OUTPUT_DIR=${ROOT}/output
|
2016-12-14 11:05:35 +01:00
|
|
|
|
2016-01-12 07:59:05 +01:00
|
|
|
source ${REPO}/Branding/branding.sh
|
|
|
|
source ${REPO}/mk/re-branding.sh
|
2013-06-24 13:41:48 +02:00
|
|
|
|
|
|
|
#build
|
2019-12-24 14:28:58 +01:00
|
|
|
MSBUILD=MSBuild.exe
|
|
|
|
SWITCHES="/m /verbosity:minimal /p:Configuration=Release /p:TargetFrameworkVersion=v4.6 /p:VisualStudioVersion=15.0"
|
2013-06-24 13:41:48 +02:00
|
|
|
|
2017-01-18 14:33:36 +01:00
|
|
|
${UNZIP} -d ${REPO}/XenOvfApi ${SCRATCH_DIR}/XenCenterOVF.zip
|
2019-12-17 15:23:26 +01:00
|
|
|
cd ${REPO} && "${MSBUILD}" ${SWITCHES} XenAdmin.sln
|
2013-06-24 13:41:48 +02:00
|
|
|
|
2017-01-18 14:33:36 +01:00
|
|
|
echo "INFO: Collecting unsigned files..."
|
2017-12-07 15:39:32 +01:00
|
|
|
mkdir_clean ${OUTPUT_DIR}/${BRANDING_BRAND_CONSOLE}Unsigned
|
|
|
|
cp -R ${REPO}/* ${OUTPUT_DIR}/${BRANDING_BRAND_CONSOLE}Unsigned
|
|
|
|
cd ${OUTPUT_DIR} && zip -q -r -m ${BRANDING_BRAND_CONSOLE}Unsigned.zip ${BRANDING_BRAND_CONSOLE}Unsigned
|
2017-01-18 14:33:36 +01:00
|
|
|
echo "Unsigned artifacts archived"
|
2016-02-01 15:04:47 +01:00
|
|
|
#build and sign the installers
|
|
|
|
. ${REPO}/mk/build-installers.sh
|
2013-06-24 13:41:48 +02:00
|
|
|
|
|
|
|
#build the tests
|
2015-07-22 10:36:15 +02:00
|
|
|
echo "INFO: Build the tests..."
|
2019-12-24 14:28:58 +01:00
|
|
|
cd ${REPO}/XenAdminTests && "${MSBUILD}" ${SWITCHES}
|
2013-06-24 13:41:48 +02:00
|
|
|
cp ${REPO}/XenAdmin/ReportViewer/* ${REPO}/XenAdminTests/bin/Release/
|
|
|
|
cd ${REPO}/XenAdminTests/bin/ && tar -czf XenAdminTests.tgz ./Release
|
2017-12-07 15:39:32 +01:00
|
|
|
cd ${REPO}/XenAdmin/TestResources && tar -cf ${OUTPUT_DIR}/XenCenterTestResources.tar *
|
2013-06-24 13:41:48 +02:00
|
|
|
cp ${REPO}/XenAdminTests/bin/XenAdminTests.tgz ${OUTPUT_DIR}/XenAdminTests.tgz
|
2016-01-22 06:50:12 +01:00
|
|
|
|
2018-02-09 16:00:07 +01:00
|
|
|
#include cfu validator binary in output directory
|
|
|
|
cd ${REPO}/CFUValidator/bin/Release && zip CFUValidator.zip ./{*.dll,CFUValidator.exe,XenCenterMain.exe}
|
|
|
|
cp ${REPO}/CFUValidator/bin/Release/CFUValidator.zip ${OUTPUT_DIR}/CFUValidator.zip
|
|
|
|
|
2019-09-02 14:54:45 +02:00
|
|
|
#now package the pdbs
|
|
|
|
|
2016-01-22 06:50:12 +01:00
|
|
|
cp ${REPO}/XenAdmin/bin/Release/{CommandLib.pdb,${BRANDING_BRAND_CONSOLE}.pdb,XenCenterLib.pdb,XenCenterMain.pdb,XenCenterVNC.pdb,XenModel.pdb,XenOvf.pdb,XenOvfTransport.pdb} \
|
2013-06-24 13:41:48 +02:00
|
|
|
${REPO}/xe/bin/Release/xe.pdb \
|
|
|
|
${REPO}/xva_verify/bin/Release/xva_verify.pdb \
|
2015-06-09 15:28:30 +02:00
|
|
|
${REPO}/XenServerHealthCheck/bin/Release/XenServerHealthCheck.pdb \
|
2013-06-24 13:41:48 +02:00
|
|
|
${OUTPUT_DIR}
|
|
|
|
|
2016-11-29 14:48:40 +01:00
|
|
|
cd ${OUTPUT_DIR} && tar cjf XenCenter.Symbols.tar.bz2 --remove-files *.pdb
|
2016-11-15 16:41:11 +01:00
|
|
|
|
2015-07-22 10:36:15 +02:00
|
|
|
echo "INFO: Build phase succeeded at "
|
2013-06-24 13:41:48 +02:00
|
|
|
date
|
|
|
|
|
|
|
|
set +u
|