forked from semaphoreui/semaphore
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmake.sh
executable file
·65 lines (51 loc) · 1.24 KB
/
make.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
57
58
59
60
61
62
63
64
65
#!/bin/bash
set -e
BINDATA_ARGS="-o util/bindata.go -pkg util"
if [ "$1" == "watch" ]; then
BINDATA_ARGS="-debug ${BINDATA_ARGS}"
echo "Creating util/bindata.go with file proxy"
else
echo "Creating util/bindata.go"
fi
if [ "$1" == "ci_test" ]; then
echo "Creating CI Test config.json"
cat > config.json <<EOF
{
"mysql": {
"host": "127.0.0.1:3306",
"user": "ubuntu",
"pass": "",
"name": "circle_test"
},
"session_db": "127.0.0.1:6379",
"port": ":8010"
}
EOF
cd public
lessc css/semaphore.less > css/semaphore.css
jade html/*.jade html/*/*.jade html/*/*/*.jade &
cd -
fi
cd public
node ./bundler.js
cd -
echo "Adding bindata"
go-bindata $BINDATA_ARGS config.json db/migrations/ $(find ./public -type d -print)
if [ "$1" == "ci_test" ]; then
exit 0
fi
if [ "$1" == "watch" ]; then
cd public
nodemon -w js -i bundle.js -e js bundler.js &
nodemon -w css -e less --exec "lessc css/semaphore.less > css/semaphore.css" &
jade -w -P html/*.jade html/*/*.jade html/*/*/*.jade &
cd ../
reflex -r '\.go$' -s -d none -- sh -c 'go run cli/main.go'
exit 0
fi
cd cli
gox -os="linux darwin windows openbsd" -output="semaphore_{{.OS}}_{{.Arch}}" ./...
if [ "$CIRCLE_ARTIFACTS" != "" ]; then
rsync -a semaphore_* $CIRCLE_ARTIFACTS/
exit 0
fi