Skip to content

Commit

Permalink
Merge pull request #163 from eschizoid/bugfix/initiate-hook-valitdation
Browse files Browse the repository at this point in the history
Fixed url hook validation
  • Loading branch information
eschizoid authored Jan 19, 2019
2 parents 9a6c69a + 6c90fb2 commit b4c0021
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 14 deletions.
1 change: 0 additions & 1 deletion README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,6 @@ $ flixctl library initiate
$ flixctl library initiate \
--archive-id U1IDD8GVNYGhtnbtjfr7_oV-h9hNqcjAkR1RfCdBrL8uoQdlViB0TtGUvnWrKkLM8nlf7LEZTV_X8CuXVoMKtnEBOBELgmmuQDIZkSA9xU-mlWJMSxf_132VcP4RTXNxZ7MdmTdNGA \
--job-id RP5RUuUyX0PxGlbipyeUr-pjPB74lYqOqXT6mA6sjrDU3y2Y7-ggAgQepNKeuULMpw8RIhNo6U60bTIONhxVI9dg61az \
--slack-notification "true" \
--slack-notification-channel "monitoring"
Expand Down
28 changes: 16 additions & 12 deletions cmd/library/inventory.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,23 @@ var InventoryLibraryCmd = &cobra.Command{
SharedConfigState: sess.SharedConfigEnable,
}))
if sync, _ := strconv.ParseBool(enableLibrarySync); sync {
err := libraryService.DeleteteGlacierInventoryArchives()
ShowError(err)
svc := glacier.New(awsSession)
jobOutputOutput := glacierService.GetJobOutput(svc, jobID)
defer jobOutputOutput.Body.Close()
response, err := ioutil.ReadAll(jobOutputOutput.Body)
ShowError(err)
var inventoryRetrieve = new(InventoryRetrieve)
err = json.Unmarshal(response, &inventoryRetrieve)
ShowError(err)
for _, archive := range inventoryRetrieve.ArchiveList {
err = libraryService.SaveGlacierInventoryArchive(archive)
if jobID != "" {
err := libraryService.DeleteteGlacierInventoryArchives()
ShowError(err)
svc := glacier.New(awsSession)
jobOutputOutput := glacierService.GetJobOutput(svc, jobID)
defer jobOutputOutput.Body.Close()
response, err := ioutil.ReadAll(jobOutputOutput.Body)
ShowError(err)
var inventoryRetrieve = new(InventoryRetrieve)
err = json.Unmarshal(response, &inventoryRetrieve)
ShowError(err)
for _, archive := range inventoryRetrieve.ArchiveList {
err = libraryService.SaveGlacierInventoryArchive(archive)
ShowError(err)
}
} else {
panic("job-id parameter should be provided")
}
}
glacierArchives, err := libraryService.GetGlacierInventoryArchives()
Expand Down
Binary file modified infrastructure/database/storm/library.db
Binary file not shown.
2 changes: 1 addition & 1 deletion infrastructure/hooks/hooks.json
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@
"value": "{{getenv "SLACK_STATUS_TOKEN"}}",
"parameter": {
"source": "payload",
"name": "token"
"name": "url"
}
}
}
Expand Down

0 comments on commit b4c0021

Please sign in to comment.