fix log + fix nginx undeployment command
This commit is contained in:
parent
a8b404cdce
commit
0581515de0
@ -202,7 +202,7 @@ func (nd *NginxDeployer) Destroy() (err error) {
|
|||||||
|
|
||||||
_, err = nd.conn.Execute(
|
_, err = nd.conn.Execute(
|
||||||
fmt.Sprintf(
|
fmt.Sprintf(
|
||||||
"unlink /etc/nginx/sites-enabled/%s",
|
"rm -f /etc/nginx/sites-enabled/%s",
|
||||||
nginxConf,
|
nginxConf,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|||||||
10
main.go
10
main.go
@ -210,10 +210,12 @@ func WithDestroy() InitOption {
|
|||||||
func initLogger(debug bool) {
|
func initLogger(debug bool) {
|
||||||
zerolog.TimeFieldFormat = zerolog.TimeFormatUnix
|
zerolog.TimeFieldFormat = zerolog.TimeFormatUnix
|
||||||
zerolog.SetGlobalLevel(zerolog.InfoLevel)
|
zerolog.SetGlobalLevel(zerolog.InfoLevel)
|
||||||
|
ctx := log.With()
|
||||||
if debug {
|
if debug {
|
||||||
zerolog.SetGlobalLevel(zerolog.DebugLevel)
|
zerolog.SetGlobalLevel(zerolog.DebugLevel)
|
||||||
|
ctx = ctx.Caller()
|
||||||
}
|
}
|
||||||
log.Logger = log.With().Caller().Logger().Output(zerolog.ConsoleWriter{Out: os.Stderr})
|
log.Logger = ctx.Logger().Output(zerolog.ConsoleWriter{Out: os.Stderr})
|
||||||
}
|
}
|
||||||
|
|
||||||
// loadHMMap loads your instance configuration map from `$HOME/.homeserver` dir.
|
// loadHMMap loads your instance configuration map from `$HOME/.homeserver` dir.
|
||||||
@ -510,5 +512,9 @@ func main() { //nolint: funlen // TODO: to reduce
|
|||||||
Msg("unable to deploy project, see logs for details")
|
Msg("unable to deploy project, see logs for details")
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Info().Str("name", project.Name).Msg("project deployed successfully")
|
msg := "project deployed successfully"
|
||||||
|
if *destroy {
|
||||||
|
msg = "project undeployed successfully"
|
||||||
|
}
|
||||||
|
log.Info().Str("name", project.Name).Msg(msg)
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user