forked from ByteriX/BxTextField
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
57 lines (45 loc) · 1018 Bytes
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#
# build.sh
# version 1.1
#
# Created by Sergey Balalaev on 02.03.17.
# Copyright (c) 2017 ByteriX. All rights reserved.
#
PROJECT_NAME="BxTextField"
APP_CONFIG_PATH="./build.config"
TEMPLATE_SPEC_PATH="${PROJECT_NAME}.templatespec"
WORK_SPEC_PATH="${PROJECT_NAME}.podspec"
VAR_NAME="VERSION_NUMBER"
# Create execution
checkExit(){
if [ $? != 0 ]; then
echo "Building failed\n"
clear
exit 1
fi
}
tag(){
git tag -f -a "${VERSION_NUMBER}" -m build
git push -f --tags
}
clear(){
rm -f -d "${WORK_SPEC_PATH}"
rm -f -d "${WORK_SPEC_PATH}-e"
}
# Load Config
if [[ "$1" != "" ]]
then
CUSTOM_BUILD=1
echo "VERSION_NUMBER=$1" > "$APP_CONFIG_PATH"
fi
. "$APP_CONFIG_PATH"
cp -rf "${TEMPLATE_SPEC_PATH}" "${WORK_SPEC_PATH}"
checkExit
sed -i -e "s/$VAR_NAME/$VERSION_NUMBER/" "${WORK_SPEC_PATH}"
checkExit
tag
checkExit
pod trunk push "${WORK_SPEC_PATH}" --allow-warnings --verbose
checkExit
clear
curl "http://207.254.41.223:4567/redeploy/${PROJECT_NAME}/latest"