Skip to content

Commit

Permalink
Add start, restart, kill log markers
Browse files Browse the repository at this point in the history
  • Loading branch information
bom-d-van committed Apr 9, 2016
1 parent b9dd959 commit d17588b
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,8 @@ You can change how many releases you want to keep by `RollbackCount` or disable
}
```

Note: rollback depends on `harp.json`, if `Files` or other configs are changed, rollback might not work.

### Build Args Specification

Harp supports go build tool arguments specification.
Expand Down
3 changes: 1 addition & 2 deletions harp.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ import (
// Clean up: remove data from servers (harp/[app], $GOPATH/src/[import-path]; remove $GOPATH/ with --all)
// tmux support for long migrations

// TODO: Add start, restart, kill log markers!

// PRINCIPLES
// KISS
// BC (Being Convinent: all things in one place)
Expand Down Expand Up @@ -768,6 +766,7 @@ if [[ -f {{.Home}}/harp/{{.App.Name}}/app.pid ]]; then
if ps -p $target > /dev/null; then
kill -KILL $target; > /dev/null 2>&1;
fi
echo "[harp] $(date) server killed" >> {{.LogPath}}
fi`))

func initXC() {
Expand Down
1 change: 1 addition & 0 deletions server.go
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ func (s *Server) restartScript() (script string) {
args := strings.Join(app.Args, " ")
script += fmt.Sprintf("cd %s/src/%s\n", s.GoPath, app.ImportPath)
// env=val nohup $GOPATH/bin/$app arg1 >> $log 2&1 &
script += fmt.Sprintf(`echo "[harp] $(date) server deployed/restarted" >> %s`+"\n", log)
script += fmt.Sprintf("%s nohup %s/bin/%s %s >> %s 2>&1 &\n", envs, s.GoPath, app.Name, args, log)
script += fmt.Sprintf("echo $! > %s\n", pid)
script += "cd " + s.Home
Expand Down
2 changes: 1 addition & 1 deletion version.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package main

const version = 33
const version = 34

0 comments on commit d17588b

Please sign in to comment.