-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from infosiftr/deploy-retries
Retry each crane command on 429 after a sleep
- Loading branch information
Showing
2 changed files
with
38 additions
and
16 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# input: list of build objects i.e., builds.json | ||
# output: stream of crane copy command strings | ||
def crane_deploy_commands: | ||
reduce (.[] | select(.build.resolved and .build.arch == env.BASHBREW_ARCH)) as $i ({}; | ||
.[ $i.source.arches[].archTags[] ] += [ | ||
$i.build.resolved | ||
| .index.ref // .manifest.ref | ||
] | ||
) | ||
| to_entries[] | ||
| .key as $target | ||
| .value | ||
| if length == 1 then | ||
@sh "crane copy \(.) \($target)" | ||
else | ||
@sh "crane index append --tag \($target) " + (map("--manifest " + @sh) | join(" ")) + " --flatten" | ||
end | ||
; |