-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.sh
executable file
·54 lines (42 loc) · 1.44 KB
/
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
#!/bin/bash
export PROJECT_ROOT=`pwd`
export BUILD_DIR=${PROJECT_ROOT}/build
export RELEASE_DIR=${PROJECT_ROOT}/release
function create_dir {
FOLDER_NAME=$1
if [ ! -d ${FOLDER_NAME} ]; then
mkdir ${FOLDER_NAME}
fi
}
# Find current branch
CURRENT=`git branch | grep '\*' | awk ' {print $2}'`
create_dir ${BUILD_DIR}
create_dir ${RELEASE_DIR}
# Export current branch to build directory
export ISF_BUILD=${BUILD_DIR}/isf
export ISF_RELEASE=${RELEASE_DIR}/isf
# clean old builds
rm -rf ${ISF_BUILD}
rm -rf ${ISF_RELEASE}
# release ISF
create_dir ${ISF_BUILD}
git archive ${CURRENT} | tar -x -C ${ISF_BUILD}
# release submodules
git submodule update
git submodule foreach --recursive 'git archive --verbose HEAD | tar -x -C ${ISF_BUILD}/$path'
# Copy required files to release directory
create_dir ${ISF_RELEASE}
cp -rfv ${ISF_BUILD}/modules/chirptext/chirptext ${ISF_RELEASE}/
cp -rfv ${ISF_BUILD}/modules/lelesk/lelesk ${ISF_RELEASE}/
cp -rfv ${ISF_BUILD}/modules/puchikarui/puchikarui ${ISF_RELEASE}/
cp -rfv ${ISF_BUILD}/modules/yawlib/yawlib ${ISF_RELEASE}/
cp -rfv ${ISF_BUILD}/data ${ISF_RELEASE}/
cp -rfv ${ISF_BUILD}/coolisf ${ISF_RELEASE}/
cp -rfv ${ISF_BUILD}/isf ${ISF_RELEASE}/
cp -rfv ${ISF_BUILD}/setup.py ${ISF_RELEASE}/
cp -rfv ${ISF_BUILD}/LICENSE ${ISF_RELEASE}/
cp -rfv ${ISF_BUILD}/requirements.txt ${ISF_RELEASE}/
cp -rfv ${ISF_BUILD}/README.md ${ISF_RELEASE}/
cd ${RELEASE_DIR}
tar -zcvf isf.tar.gz isf
ls -l ${RELEASE_DIR}