Created
December 14, 2017 13:47
-
-
Save radu-matei/17ab85c46b8e2ca4eac1b86ce4e31af5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func handleWebhook(w http.ResponseWriter, r *http.Request) { | |
decoder := json.NewDecoder(r.Body) | |
var webhookData WebhookData | |
err := decoder.Decode(&webhookData) | |
if err != nil { | |
log.Printf("cannot decode request body: %v", err) | |
} | |
defer r.Body.Close() | |
fmt.Println("Received webhook, attempting to update Azure Container Instance...") | |
err = updateAzureContainer(resourceGroupName, containerGroupName, webhookData) | |
if err != nil { | |
log.Fatalf("cannot update container instance: %v", err) | |
} | |
fmt.Println("Finished, waiting for new version...") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment