-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathdeploy-build
executable file
·139 lines (111 loc) · 3.49 KB
/
deploy-build
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
#!/bin/bash
function run {
"$@"
local status=$?
if [ $status -ne 0 ]; then
echo "error with $1" >&2
exit 1
fi
return $status
}
lettert="t"
BUILDDATE=$( /bin/date +"%Y%m%d" )
if [ -e "./$BUILDDATE" ]; then
idx=$(< ./$BUILDDATE)
((idx++))
printf -v build "%s%03d" $BUILDDATE $idx
printf -v stridx "%d" $idx
else
printf -v build "%s%03d" $BUILDDATE 1
stridx="1"
fi
echo $build
##
## Make mainnet ABC build
##
run cd ../airbitz-core
run git pull
run cd deps
## Remove testnet string if it's still there
if grep -Fq "enable-testnet" recipes/libbitcoin/libbitcoin ; then
echo "removing testnet"
run sed -i -e 's/--enable-testnet //g' recipes/libbitcoin/libbitcoin
fi
run make abc.clean
if [ "$5" = "clean" ]; then
run make clean
fi
run make abc
##run git checkout recipes/libbitcoin/libbitcoin
##
## Make testnet ABC build
##
run cd ../../airbitz-core-testnet
run git pull
run cd deps
## Add testnet string if it's not there
if ! grep -Fq "enable-testnet" recipes/libbitcoin/libbitcoin ; then
run sed -i -e 's/--disable-shared/--disable-shared --enable-testnet/g' recipes/libbitcoin/libbitcoin
fi
run make abc.clean
if [ "$5" = "clean" ]; then
run make clean
fi
run make abc
run cd ../../airbitz-ios-gui/
run git pull
rm -rf Airbitz/ABC/*
run cp -a ../airbitz-core/deps/build/abc/abc-ios-universal/include/* AirBitz/ABC/
run cp -a ../airbitz-core/deps/build/abc/abc-ios-universal/lib/* AirBitz/ABC/
run agvtool new-marketing-version $1
run agvtool new-version -all $build
run xcodebuild -scheme Airbitz archive
run ./deploy-tf "$1" "$build" "$2" "$3" "$4"
##
## Revert edited files
##
#run git checkout Airbitz/Airbitz-Info.plist
#run git checkout Airbitz.xcodeproj/project.pbxproj
rm -rf Airbitz/ABC/*
run cp -a ../airbitz-core-testnet/deps/build/abc/abc-ios-universal/include/* AirBitz/ABC/
run cp -a ../airbitz-core-testnet/deps/build/abc/abc-ios-universal/lib/* AirBitz/ABC/
run agvtool new-marketing-version $1$lettert
run agvtool new-version -all $build
run xcodebuild -scheme Airbitz archive
run ./deploy-tf "$1$lettert" "$build" "$2" "$3" "$4" "testnet"
##
## Revert edited files
##
#run git checkout Airbitz/Airbitz-Info.plist
#run git checkout Airbitz.xcodeproj/project.pbxproj
echo $stridx > $BUILDDATE
#run /usr/bin/open "https://testflightapp.com/dashboard/builds/"
##
## Tag the commit ID with the build version
##
run git tag -a "${1}_${build}_ios" -m ""
run git push --tags
##
## Copy builds to build archives
##
if [ ! -d "../build-archives" ]; then
run mkdir ../build-archives
fi
if [ ! -d "../build-archives/ios" ]; then
run mkdir ../build-archives/ios
fi
if [ ! -d "../build-archives/ios/walletcore" ]; then
run mkdir ../build-archives/ios/walletcore
fi
if [ -e "../build-archives/ios/walletcore/${build}_${1}_ios" ]; then
exit 1
fi
run mkdir "../build-archives/ios/walletcore/${build}_${1}_ios"
if [ -e "../build-archives/ios/walletcore/${build}_${1}_ios_testnet" ]; then
exit 1
fi
run mkdir "../build-archives/ios/walletcore/${build}_${1}_ios_testnet"
run cp -a "../airbitz-core/deps/build/abc/abc-ios-universal/include/*" "../build-archives/ios/walletcore/${build}_${1}_ios/"
run cp -a "../airbitz-core/deps/build/abc/abc-ios-universal/lib/*" "../build-archives/ios/walletcore/${build}_${1}_ios/"
run cp -a "../airbitz-core-testnet/deps/build/abc/abc-ios-universal/include/*" "../build-archives/ios/walletcore/${build}_${1}_ios_testnet/"
run cp -a "../airbitz-core-testnet/deps/build/abc/abc-ios-universal/lib/*" "../build-archives/ios/walletcore/${build}_${1}_ios_testnet/"