fix mac build script

This commit is contained in:
Vishwas Shashidhar 2019-08-28 15:28:49 +05:30
parent b2db06dea8
commit 4a5f7ff77d

View File

@ -15,7 +15,16 @@ if ! [ -x "$(command -v /usr/local/bin/packagesbuild)" ]; then
exit 1
fi
nvm use default
if ! [ -x "$(command -v gulp)" ]; then
echo 'Gulp does not exist! Install it for setting expiry!' >&2
exit 1
fi
if [ -z "$PARENT_BUILD_VERSION" ]; then
echo "PARENT_BUILD_VERSION is empty, setting default"
PARENT_BUILD_VERSION="0"
fi
NODE_VERSION=$(node --version)
echo "Node Version: ${NODE_VERSION}"
@ -35,11 +44,17 @@ echo "Setting default pod url to https://corporate.symphony.com"
sed -i -e 's/\"url\"[[:space:]]*\:[[:space:]]*\".*\"/\"url\":\"https:\/\/corporate.symphony.com\"/g' config/Symphony.config
# setup the build version
echo "Setting build version to ${PARENT_BUILD_VERSION}"
sed -i -e "s/\"buildNumber\"[[:space:]]*\:[[:space:]]*\".*\"/\"buildNumber\":\"${PARENT_BUILD_VERSION}\"/g" package.json
sed -i -e "s/\"buildNumber\"[[:space:]]*\:[[:space:]]*\".*\"/\"buildNumber\":\" ${PARENT_BUILD_VERSION}\"/g" package.json
# replace version number in pre-install script
echo "Setting package version in pre install script to ${PKG_VERSION}"
sed -i -e "s/CURRENT_VERSION=APP_VERSION/CURRENT_VERSION=${PKG_VERSION}/g" ./installer/mac/preinstall.sh
if [ -z "$EXPIRY_PERIOD" ]; then
echo 'Expiry period not set, so, not creating expiry for the build'
else
gulp setExpiry --period ${EXPIRY_PERIOD}
fi
echo "Running tests, code coverage, linting and building..."
npm run unpacked-mac