Skip to content

Instantly share code, notes, and snippets.

@radu-matei
Created December 14, 2017 13:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save radu-matei/17ab85c46b8e2ca4eac1b86ce4e31af5 to your computer and use it in GitHub Desktop.
Save radu-matei/17ab85c46b8e2ca4eac1b86ce4e31af5 to your computer and use it in GitHub Desktop.
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