diff --git a/scripts/build-mac.sh b/scripts/build-mac.sh index 82cb50c5..b02c464e 100755 --- a/scripts/build-mac.sh +++ b/scripts/build-mac.sh @@ -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