-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrelease.sh
executable file
·53 lines (42 loc) · 1.05 KB
/
release.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
#!/bin/bash -e
CASCADES_VERSION=$1
#OSARCHS=( "darwin/amd64" "linux/amd64" "linux/arm" "windows/amd64" );
OSARCHS=( "linux/amd64" );
source func.sh
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd $DIR
if [ "$CASCADES_VERSION" = "" ]; then
CASCADES_VERSION="DEV"
fi
if [ -d "$DIR/dist" ]; then
rm -rf $DIR/dist/*
else
mkdir -p $DIR/dist
fi
for v in "${OSARCHS[@]}"
do
suffix=`echo "${v}" | tr / _`
p="cascades-${CASCADES_VERSION}_${suffix}"
d="${DIR}/dist/${p}"
mkdir -p $d/components
# Compile
pushd $d
gox -verbose -output="cascades" -osarch="${v}" github.com/cascades-fbp/cascades/cmd/cascades
build_core
build_sockets
build_websockets
build_bonjour
build_influxdb
build_http
build_mqtt
popd
mkdir $d/examples
cp $DIR/examples/tick.fbp $d/examples/
cp $DIR/examples/tick.json $d/examples/
cp $DIR/examples/regexp2json.fbp $d/examples/
cd $DIR/dist && zip -9 -r "${p}.zip" "$p"
#cd $DIR/dist && tar -zcvf "${p}.tar.gz" $p
rm -rf $d
done
echo "DONE!"
exit 0