mirror of
https://github.com/0rangebananaspy/authelia.git
synced 2024-09-14 22:47:21 +07:00
During cleanup, treat non-200 responses as an error and retry up to 3 times
This commit is contained in:
parent
51465f8b77
commit
08b519293a
|
@ -48,10 +48,10 @@ func (d *Docker) Manifest(tag, amd64tag, arm32v7tag, arm64v8tag string) error {
|
|||
|
||||
// CleanTag remove a tag from dockerhub.
|
||||
func (d *Docker) CleanTag(tag string) error {
|
||||
return CommandWithStdout("curl", "-s", "-o", "/dev/null", "-u", "$DOCKER_USERNAME:$DOCKER_PASSWORD", "-X", "DELETE", "https://cloud.docker.com/v2/repositories/"+DockerImageName+"/tags/"+tag+"/").Run()
|
||||
return CommandWithStdout("curl", "-fs", "--retry 3", "-o", "/dev/null", "-u", "$DOCKER_USERNAME:$DOCKER_PASSWORD", "-X", "DELETE", "https://cloud.docker.com/v2/repositories/"+DockerImageName+"/tags/"+tag+"/").Run()
|
||||
}
|
||||
|
||||
// PublishReadme push README.md to dockerhub.
|
||||
func (d *Docker) PublishReadme() error {
|
||||
return CommandWithStdout("bash", "-c", `jq -n --arg msg "$(<README.md)" '{"registry":"registry-1.docker.io","full_description": $msg }' | curl -s -o /dev/null -u $DOCKER_USERNAME:$DOCKER_PASSWORD -X "PATCH" -H "Content-Type: application/json" -d @- https://cloud.docker.com/v2/repositories/clems4ever/authelia/`).Run()
|
||||
return CommandWithStdout("bash", "-c", `jq -n --arg msg "$(<README.md)" '{"registry":"registry-1.docker.io","full_description": $msg }' | curl -fs --retry 3 -o /dev/null -u $DOCKER_USERNAME:$DOCKER_PASSWORD -X "PATCH" -H "Content-Type: application/json" -d @- https://cloud.docker.com/v2/repositories/clems4ever/authelia/`).Run()
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user