Last active
March 16, 2023 13:23
-
-
Save osmanmakal/5c6961619d519a179aebbdc1ea04571b to your computer and use it in GitHub Desktop.
bee go supervisor script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| ################## Supervisor ################## | |
| # [program:repo] | |
| # command=bash -c /go/src/repo/start.sh | |
| # directory=/root | |
| # autostart=true | |
| # autorestart=true | |
| # stderr_logfile=/var/log/repo-err.log | |
| # stdout_logfile=/var/log/repo-out.log | |
| # environment=GOPATH="/go" | |
| ################## Supervisor ################## | |
| repo="repo" | |
| unbuffer killall -9 bee > /dev/null | |
| unbuffer killall -9 $repo > /dev/null | |
| GOPATH="/go" | |
| if [ -z $GOPATH ];then | |
| echo "GOPATH not set!" | |
| exit 1 | |
| fi | |
| if [ -f $GOPATH/bin/bee ];then | |
| go get -u github.com/astaxie/beego | |
| go get -u github.com/beego/bee | |
| go get -u github.com/tools/godep | |
| fi | |
| source /root/.profile | |
| cd $GOPATH/src/$repo | |
| $GOPATH/bin/godep get | |
| $GOPATH/bin/bee run |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment