diff --git a/main.go b/main.go index 03f18bb..cd3cf95 100644 --- a/main.go +++ b/main.go @@ -35,16 +35,20 @@ func handler(data map[string]interface{}) { deploy_error.SendOverMatrix(); return } if exists { + sendMessage(MatrixMessage{text: "⚪️ Updating repository..."}) if deploy_error := site.Update(); deploy_error.code != 0 { deploy_error.SendOverMatrix(); return } + sendMessage(MatrixMessage{text: "⚪️ Restarting server..."}) if deploy_error := site.Restart(); deploy_error.code != 0 { 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 { deploy_error.SendOverMatrix(); return } + sendMessage(MatrixMessage{text: "⚪️ Starting server..."}) 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.SendOverMatrix() @@ -52,6 +56,7 @@ func handler(data map[string]interface{}) { if deploy_error := site.Start(); deploy_error.code != 0 { deploy_error.SendOverMatrix(); return } + defer sendMessage(MatrixMessage{text: "🚀 Launched for the first time!"}) } sendMessage(MatrixMessage{text: "🟢 Deployed successfully!"}) }