diff --git a/controller/copy_build.go b/controller/copy_build.go index 4a28064..155f1cc 100644 --- a/controller/copy_build.go +++ b/controller/copy_build.go @@ -84,7 +84,7 @@ finally { return } - server.BroadcastToRoom("/", "update", "updateLogs", fmt.Sprintf("✅ Copy to %s successful", plant)) + server.BroadcastToRoom("/", "update", "updateLogs", "done") } func lastestBuild() string { diff --git a/controller/pkg/update_server_stats.go b/controller/pkg/update_server_stats.go index 6815be1..9c95b6b 100644 --- a/controller/pkg/update_server_stats.go +++ b/controller/pkg/update_server_stats.go @@ -21,6 +21,8 @@ func UpdateServerStats(buildNumber int64) { os.Getenv("DATABASE_DB"), ) + fmt.Println(url) + ctx := context.Background() conn, err := pgx.Connect(ctx, url) diff --git a/controller/update_channel.go b/controller/update_channel.go index 9968f7b..1277532 100644 --- a/controller/update_channel.go +++ b/controller/update_channel.go @@ -99,6 +99,11 @@ func triggerRemoteUpdate(server *socketio.Server, token string, payload UpdatePa body, _ := json.Marshal(payload) url := fmt.Sprintf("https://%vprod.alpla.net%v/update", token, basePath) + + if token == "test1" || token == "test2" || token == "test3" { + url = fmt.Sprintf("https://USMCD1vms036.alpla.net/%v/update", basePath) + } + fmt.Println(url) //url := fmt.Sprintf("http://%v:8080/api/controller/update", remoteURL) fmt.Println(url)