2016-01-05 00:32:53 +01:00
|
|
|
#!/bin/bash
|
2016-01-06 12:38:01 +01:00
|
|
|
set -e
|
2016-03-18 23:03:28 +01:00
|
|
|
|
2016-01-05 00:32:53 +01:00
|
|
|
BINDATA_ARGS="-o util/bindata.go -pkg util"
|
|
|
|
|
2016-03-18 23:03:28 +01:00
|
|
|
if [ "$1" == "watch" ]; then
|
2016-01-05 00:32:53 +01:00
|
|
|
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
|
2016-05-24 00:59:45 +02:00
|
|
|
|
|
|
|
cd public
|
|
|
|
lessc css/semaphore.less > css/semaphore.css
|
|
|
|
jade html/*.jade html/*/*.jade html/*/*/*.jade &
|
|
|
|
cd -
|
2016-01-05 00:32:53 +01:00
|
|
|
fi
|
|
|
|
|
2016-03-18 23:03:28 +01:00
|
|
|
cd public
|
|
|
|
node ./bundler.js
|
|
|
|
cd -
|
|
|
|
|
2016-01-06 12:20:07 +01:00
|
|
|
echo "Adding bindata"
|
|
|
|
|
2016-05-24 11:55:48 +02:00
|
|
|
go-bindata $BINDATA_ARGS config.json db/migrations/ $(find ./public -type d -print)
|
2016-01-05 00:32:53 +01:00
|
|
|
|
2016-05-21 01:47:09 +02:00
|
|
|
if [ "$1" == "ci_test" ]; then
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2016-03-18 23:03:28 +01:00
|
|
|
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" &
|
2016-04-30 09:52:33 +02:00
|
|
|
jade -w -P html/*.jade html/*/*.jade html/*/*/*.jade &
|
|
|
|
|
|
|
|
cd ../
|
2016-05-24 11:55:48 +02:00
|
|
|
reflex -r '\.go$' -s -d none -- sh -c 'go run cli/main.go'
|
2016-04-30 09:52:33 +02:00
|
|
|
exit 0
|
2016-03-18 23:03:28 +01:00
|
|
|
fi
|
|
|
|
|
2016-05-24 11:55:48 +02:00
|
|
|
cd cli
|
|
|
|
gox -os="linux darwin windows openbsd" -output="semaphore_{{.OS}}_{{.Arch}}" ./...
|
2016-05-23 22:08:28 +02:00
|
|
|
|
|
|
|
if [ "$CIRCLE_ARTIFACTS" != "" ]; then
|
|
|
|
rsync -a semaphore_* $CIRCLE_ARTIFACTS/
|
|
|
|
exit 0
|
2016-06-02 20:26:51 +02:00
|
|
|
fi
|