1
1
mirror of https://github.com/qvacua/vimr.git synced 2024-11-28 11:35:35 +03:00
vimr/bin/build.sh

80 lines
2.2 KiB
Bash
Raw Normal View History

2016-10-14 13:31:51 +03:00
#!/bin/bash
2016-10-14 15:26:14 +03:00
# For jenkins
2016-10-14 13:31:51 +03:00
set -e
set -x
2016-10-14 13:31:51 +03:00
2016-10-22 11:06:54 +03:00
# for utf-8 for python script
export LC_CTYPE=en_US.UTF-8
2016-10-14 13:31:51 +03:00
export PATH=/usr/local/bin:$PATH
# # parameters
2016-10-14 15:26:14 +03:00
# - BRANCH
# - IS_SNAPSHOT
# - MARKETING_VERSION
# - RELEASE_NOTES
2016-11-03 22:23:41 +03:00
# - UPDATE_APPCAST
2016-10-14 13:31:51 +03:00
if [ "${IS_SNAPSHOT}" = false ] && [ "${MARKETING_VERSION}" == "" ] ; then
echo "### ERROR If not snapshot, then the marketing version must be set!"
exit 1
fi
if [ "${RELEASE_NOTES}" == "" ] ; then
echo "### ERROR No release notes!"
exit 1
fi
2016-11-10 17:16:20 +03:00
if [ "${IS_SNAPSHOT}" = false ] && [ "${UPDATE_APPCAST}" = false ] ; then
echo "### ERROR Not updating appcast for release!"
exit 1
fi
2016-11-10 17:16:20 +03:00
if [ "${IS_SNAPSHOT}" = false ] && [ "${BRANCH}" != "master" ] ; then
echo "### ERROR Not building master for release!"
exit 1
fi
2016-11-10 17:16:20 +03:00
if [ "${IS_SNAPSHOT}" = true ] && [ "${BRANCH}" == "master" ] ; then
echo "### ERROR Building master for snapshot!"
exit 1
fi
2016-10-22 11:12:39 +03:00
echo "### Installing some python packages"
pip install requests
pip install Markdown
2016-10-15 10:38:09 +03:00
echo "### Building VimR"
2016-10-14 13:46:15 +03:00
./bin/prepare_repositories.sh
2016-10-14 13:51:49 +03:00
./bin/clean_old_builds.sh
2016-10-14 13:46:15 +03:00
./bin/set_new_versions.sh ${IS_SNAPSHOT} "${MARKETING_VERSION}"
2016-10-17 23:35:29 +03:00
./bin/build_vimr.sh true
2016-10-14 13:31:51 +03:00
BUNDLE_VERSION=$(agvtool what-version | sed '2q;d' | sed -E 's/ +(.+)/\1/')
MARKETING_VERSION=$(agvtool what-marketing-version | tail -n 1 | sed -E 's/.*of "(.*)" in.*/\1/')
COMPOUND_VERSION="v${MARKETING_VERSION}-${BUNDLE_VERSION}"
2016-10-14 16:58:58 +03:00
TAG=${COMPOUND_VERSION}
2016-10-15 01:09:57 +03:00
if [ "${IS_SNAPSHOT}" = true ] ; then
TAG="snapshot/${COMPOUND_VERSION}"
fi
2016-10-14 16:58:58 +03:00
VIMR_FILE_NAME="VimR-${COMPOUND_VERSION}.tar.bz2"
2016-10-14 13:31:51 +03:00
2016-10-15 10:38:09 +03:00
echo "### Bundle version: ${BUNDLE_VERSION}"
echo "### Marketing version: ${MARKETING_VERSION}"
echo "### Compund version: ${COMPOUND_VERSION}"
echo "### Tag: ${TAG}"
echo "### VimR archive file name: ${VIMR_FILE_NAME}"
2016-10-14 13:31:51 +03:00
2016-10-15 10:38:09 +03:00
./bin/commit_and_push_tags.sh "${BRANCH}" "${TAG}"
2016-10-24 23:28:48 +03:00
./bin/create_github_release.sh "${COMPOUND_VERSION}" "${TAG}" "${VIMR_FILE_NAME}" "${RELEASE_NOTES}" ${IS_SNAPSHOT}
2016-11-03 22:23:41 +03:00
if [ "${UPDATE_APPCAST}" = true ] ; then
./bin/set_appcast.py "build/Release/${VIMR_FILE_NAME}" "${BUNDLE_VERSION}" "${MARKETING_VERSION}" "${TAG}" ${IS_SNAPSHOT}
./bin/commit_and_push_appcast.sh "${BRANCH}" "${COMPOUND_VERSION}" ${IS_SNAPSHOT}
fi
2016-10-15 10:38:09 +03:00
echo "### Built VimR"