2018-09-17 03:44:58 +00:00
|
|
|
---
|
|
|
|
version: 0.5
|
|
|
|
|
2018-09-20 21:02:47 +00:00
|
|
|
env:
|
|
|
|
VDB_PATH: /root/go_projects/src/github.com/vulcanize/vulcanizedb
|
|
|
|
VDB_PG_USER: vulcanize
|
|
|
|
VDB_PG_PW: vulcanize
|
|
|
|
|
2018-09-17 03:44:58 +00:00
|
|
|
networks:
|
|
|
|
staging:
|
|
|
|
hosts:
|
|
|
|
- root@147.75.96.51
|
2018-09-20 21:02:47 +00:00
|
|
|
prod:
|
|
|
|
hosts:
|
|
|
|
- root@147.75.197.13
|
2018-09-17 03:44:58 +00:00
|
|
|
|
|
|
|
targets:
|
|
|
|
deploy:
|
|
|
|
- remove
|
|
|
|
- transfer
|
|
|
|
- buildPostgraphile
|
|
|
|
- buildVDB
|
2018-09-20 21:02:47 +00:00
|
|
|
- migrate
|
2018-09-17 03:44:58 +00:00
|
|
|
- lightSync
|
|
|
|
- postgraphile
|
|
|
|
|
|
|
|
commands:
|
|
|
|
remove:
|
|
|
|
desc: remove old vulcanizedb
|
2018-09-20 21:02:47 +00:00
|
|
|
run: rm -rf $VDB_PATH && rm -rf /usr/local/vulcanizedb && mkdir -p $VDB_PATH
|
2018-09-17 03:44:58 +00:00
|
|
|
transfer:
|
2018-09-17 19:07:25 +00:00
|
|
|
desc: transfer repo to remote server
|
2018-09-20 21:02:47 +00:00
|
|
|
upload:
|
|
|
|
- src: .
|
|
|
|
dst: $VDB_PATH
|
2018-09-17 03:44:58 +00:00
|
|
|
migrate:
|
|
|
|
desc: run migration
|
|
|
|
run: >
|
|
|
|
cd $VDB_PATH &&
|
2018-09-20 21:02:47 +00:00
|
|
|
make installtools &&
|
2019-01-24 11:03:44 +00:00
|
|
|
cd db/migrations &&
|
|
|
|
/root/go_projects/bin/goose postgres "postgresql://$(VDB_PG_USER):$(VDB_PG_PW)@127.0.0.1:5432/vulcanize_public?sslmode=disable" up
|
2018-09-17 03:44:58 +00:00
|
|
|
buildPostgraphile:
|
2018-09-19 17:45:57 +00:00
|
|
|
desc: build postgraphile app
|
2018-09-17 03:44:58 +00:00
|
|
|
run: >
|
2018-09-19 14:40:33 +00:00
|
|
|
cd $VDB_PATH/postgraphile &&
|
2018-09-20 21:02:47 +00:00
|
|
|
yarn && tsc
|
2018-09-17 03:44:58 +00:00
|
|
|
buildVDB:
|
|
|
|
desc: build vulcanizedb
|
|
|
|
run: >
|
|
|
|
cd $VDB_PATH &&
|
|
|
|
GOPATH=$HOME/go_projects go get &&
|
|
|
|
GOPATH=$HOME/go_projects go build &&
|
|
|
|
cp -r . /usr/local/vulcanizedb
|
|
|
|
lightSync:
|
|
|
|
desc: start vdb light sync
|
2018-09-20 21:02:47 +00:00
|
|
|
run: >
|
|
|
|
systemctl daemon-reload &&
|
|
|
|
sudo systemctl restart vulcanizedb_light_sync.service &&
|
2019-02-08 16:35:46 +00:00
|
|
|
sudo systemctl restart vulcanizedb_log_sync.service &&
|
|
|
|
sudo systemctl restart vulcanizedb_recheck_sync.service
|
2018-09-17 03:44:58 +00:00
|
|
|
postgraphile:
|
|
|
|
desc: start postgraphile
|
|
|
|
run: systemctl daemon-reload && sudo systemctl restart postgraphile.service
|