Repository navigation
Expand file tree
/
Copy pathdeploy.sh
More file actions
executable file
·64 lines (52 loc) · 1.65 KB
/
Copy pathdeploy.sh
File metadata and controls
executable file
·64 lines (52 loc) · 1.65 KB
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
#!/bin/bash
if [ $# -lt 1 ] ; then
echo "usage: deploy.sh architecture [push]"
exit 1
fi
ARCH=$1
PUSH=$2
function generate_license() {
OUTFILE=dist/${ARCH}/LICENSE
# patchtool
echo -e "patchtool\n" > $OUTFILE
cat ./LICENSE >> $OUTFILE
# bzip2
echo -e "\n---\n" >> $OUTFILE
echo -e "bzip2\n" >> $OUTFILE
cat src/lib/external_lib/bzip2/LICENSE >> $OUTFILE
# bsdiff
echo -e "\n---\n" >> $OUTFILE
echo -e "bsdiff\n" >> $OUTFILE
cat src/lib/external_lib/bsdiff/LICENSE >> $OUTFILE
}
function refresh_dist() {
if [[ "$ARCH" == "win64" ]]; then
cp build/src/cli/patchgen.exe dist/${ARCH}/
cp build/src/cli/patchapply.exe dist/${ARCH}/
cp build/src/cli/selfapply.exe dist/${ARCH}/
fi
if [[ "$ARCH" == "win32" ]]; then
cp build/src/cli/patchgen.exe dist/${ARCH}/
cp build/src/cli/patchapply.exe dist/${ARCH}/
cp build/src/cli/selfapply.exe dist/${ARCH}/
fi
if [[ "$ARCH" == "macos" ]]; then
cp build/src/cli/patchgen dist/${ARCH}/
cp build/src/cli/patchapply dist/${ARCH}/
cp build/src/cli/selfapply dist/${ARCH}/
fi
}
# push
if [[ "$PUSH" == "push" ]]; then
if [[ "$ARCH" == "win32" ]]; then
# in order to escape win binary push simultaneously
sleep 30
fi
git checkout ${TRAVIS_BRANCH}
git pull https://${GITHUB_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git ${TRAVIS_BRANCH}
refresh_dist
generate_license
git add ./dist/${ARCH}
git commit -m "[ci skip] commit by Travis CI (JOB ${TRAVIS_JOB_NUMBER})"
git push https://${GITHUB_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git ${TRAVIS_BRANCH}
fi