Make handler() send more status messages over Matrix (fix #14)
This commit is contained in:
parent
841dda8f8f
commit
72c5467ae2
5
main.go
5
main.go
@ -35,16 +35,20 @@ func handler(data map[string]interface{}) {
|
|||||||
deploy_error.SendOverMatrix(); return
|
deploy_error.SendOverMatrix(); return
|
||||||
}
|
}
|
||||||
if exists {
|
if exists {
|
||||||
|
sendMessage(MatrixMessage{text: "⚪️ Updating repository..."})
|
||||||
if deploy_error := site.Update(); deploy_error.code != 0 {
|
if deploy_error := site.Update(); deploy_error.code != 0 {
|
||||||
deploy_error.SendOverMatrix(); return
|
deploy_error.SendOverMatrix(); return
|
||||||
}
|
}
|
||||||
|
sendMessage(MatrixMessage{text: "⚪️ Restarting server..."})
|
||||||
if deploy_error := site.Restart(); deploy_error.code != 0 {
|
if deploy_error := site.Restart(); deploy_error.code != 0 {
|
||||||
deploy_error.SendOverMatrix(); return
|
deploy_error.SendOverMatrix(); return
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
sendMessage(MatrixMessage{text: "⚪️ Cloning repository..."})
|
||||||
if deploy_error := CloneSite(repository["ssh_url"].(string), repo_name); deploy_error.code != 0 {
|
if deploy_error := CloneSite(repository["ssh_url"].(string), repo_name); deploy_error.code != 0 {
|
||||||
deploy_error.SendOverMatrix(); return
|
deploy_error.SendOverMatrix(); return
|
||||||
}
|
}
|
||||||
|
sendMessage(MatrixMessage{text: "⚪️ Starting server..."})
|
||||||
if site, exists, err = getSite(repo_name); err != nil {
|
if site, exists, err = getSite(repo_name); err != nil {
|
||||||
deploy_error := newDeployError(1, "handler", "Failed to get site '%s' after creation!", fmt.Sprint(err))
|
deploy_error := newDeployError(1, "handler", "Failed to get site '%s' after creation!", fmt.Sprint(err))
|
||||||
deploy_error.SendOverMatrix()
|
deploy_error.SendOverMatrix()
|
||||||
@ -52,6 +56,7 @@ func handler(data map[string]interface{}) {
|
|||||||
if deploy_error := site.Start(); deploy_error.code != 0 {
|
if deploy_error := site.Start(); deploy_error.code != 0 {
|
||||||
deploy_error.SendOverMatrix(); return
|
deploy_error.SendOverMatrix(); return
|
||||||
}
|
}
|
||||||
|
defer sendMessage(MatrixMessage{text: "🚀 Launched for the first time!"})
|
||||||
}
|
}
|
||||||
sendMessage(MatrixMessage{text: "🟢 Deployed successfully!"})
|
sendMessage(MatrixMessage{text: "🟢 Deployed successfully!"})
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user