refactor(controller): changed to use plant token to update, and hardcoded if we use a test server
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -21,6 +21,8 @@ func UpdateServerStats(buildNumber int64) {
|
||||
os.Getenv("DATABASE_DB"),
|
||||
)
|
||||
|
||||
fmt.Println(url)
|
||||
|
||||
ctx := context.Background()
|
||||
conn, err := pgx.Connect(ctx, url)
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user