diff options
| author | Carlos Konstanski <ckonstanski@pippiandcarlos.com> | 2017-11-09 15:33:44 -0700 |
|---|---|---|
| committer | Carlos Konstanski <ckonstanski@pippiandcarlos.com> | 2017-11-09 15:33:44 -0700 |
| commit | 055a42d6e4abaf04955b44e74e480d7fbe82ab88 (patch) | |
| tree | 940775a10e6713afb5ba7210ae813225fb56672f /salt/openbook/ci | |
| parent | 6b447c420fd866a2951cab734269aebffc4138f1 (diff) | |
Openbook CI: autoclean docker registry
Closes-Bug: OB-1089
Diffstat (limited to 'salt/openbook/ci')
| -rw-r--r-- | salt/openbook/ci/files/build.sh | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/salt/openbook/ci/files/build.sh b/salt/openbook/ci/files/build.sh index 4ee778b..ca304f6 100644 --- a/salt/openbook/ci/files/build.sh +++ b/salt/openbook/ci/files/build.sh @@ -4,9 +4,8 @@ artifact="${1}" delete_old_image() { local image_name="${1}" - curl_cmd="curl -u '{{ pillar["registry"]["username"] }}:{{ pillar["registry"]["password"] }}' -H 'Accept: application/vnd.docker.distribution.manifest.v2+json'" - digest=$(${curl_cmd} https://{{ pillar["registry"]["url"] }}/v2/${image_name}/manifests/latest | jq '.config.digest' | awk -F\" '{print $2}') - ${curl_cmd} -X DELETE https://{{ pillar["registry"]["url"] }}/v2/${image_name}/manifests/${digest} + digest=$(curl -u '{{ pillar["registry"]["username"] }}:{{ pillar["registry"]["password"] }}' -H 'Accept: application/vnd.docker.distribution.manifest.v2+json' https://{{ pillar["registry"]["url"] }}/v2/${image_name}/manifests/latest | jq '.config.digest' | awk -F\" '{print $2}') + curl -u '{{ pillar["registry"]["username"] }}:{{ pillar["registry"]["password"] }}' -H 'Accept: application/vnd.docker.distribution.manifest.v2+json' -X DELETE https://{{ pillar["registry"]["url"] }}/v2/${image_name}/manifests/${digest} } for i in $(docker images | grep -v CREATED | awk '{print $3}'); do |
