22
33set -e
44
5- export SCRIPT_DIR=` dirname $0 `
5+ SCRIPT_DIR=$( dirname " $0 " )
6+ export SCRIPT_DIR
67
78# Includes
8- . $SCRIPT_DIR /update_build_number
9- . $SCRIPT_DIR /update_version
10- . $SCRIPT_DIR /update_keychain
9+ . " $SCRIPT_DIR /update_build_number"
10+ . " $SCRIPT_DIR /update_version"
11+ . " $SCRIPT_DIR /update_keychain"
1112
12- GIT_COMMIT=` git rev-parse --short HEAD`
13- GIT_BRANCH=` git rev-parse --abbrev-ref HEAD`
14- GIT_TAG=` git describe --tags --exact-match --match " v*" 2> /dev/null || echo " " `
15- GIT_DIRTY=` test -n " $( git status --porcelain) " && echo true || echo false`
16- GIT_LOG=` git log -1 --pretty=format:%s`
13+ GIT_COMMIT=$( git rev-parse --short HEAD)
14+ GIT_BRANCH=$( git rev-parse --abbrev-ref HEAD)
15+ GIT_TAG=$( git describe --GIT_TAGs --exact-match --match " v*" 2> /dev/null || echo " " )
16+ GIT_DIRTY=$( test -n " $( git status --porcelain) " && echo true || echo false)
17+ GIT_LOG=$( git log -1 --pretty=format:%s)
18+ export GIT_COMMIT GIT_BRANCH GIT_TAG GIT_DIRTY GIT_LOG
19+
20+ BUILD=
21+ VERSION=
22+ export BUILD VERSION
1723
1824silent=0
1925
@@ -33,32 +39,31 @@ say ()
3339if [ " $CI_SERVER_NAME " = " GitLab CI" ];
3440then
3541 say " GitLab CI detected."
36- branch =$CI_BUILD_REF_NAME
37- build= $CI_BUILD_ID
38- commit= $CI_BUILD_REF
39- tag= ${GIT_TAG : 1}
42+ GIT_BRANCH =$CI_BUILD_REF_NAME
43+ GIT_COMMIT= $CI_BUILD_REF
44+ VERSION= ${GIT_TAG : 1}
45+ BUILD= $CI_BUILD_ID
4046fi
4147
4248import_certs
4349import_provisions
4450
45- if [ -n " $tag " ];
51+ if [ -n " $GIT_TAG " ];
4652then
47- say " Preparing for Beta Release $tag "
53+ say " Preparing for Beta Release $GIT_TAG "
4854
49- update_build_number $build
50- update_version $tag
55+ update_build_number " $BUILD "
56+ update_version " $VERSION "
5157
5258 make release-beta
5359
54- elif [ " $branch " = " master" ];
60+ elif [ " $GIT_BRANCH " = " master" ];
5561then
5662 say " Preparing for Alpha Release"
5763
58- update_build_number $build
64+ update_build_number " $BUILD "
5965
6066 make release-alpha
61- ipa build -c Alpha
6267
6368else
6469 say " Preparing for Development Release"
0 commit comments