1
0
Fork 0

fix cleanup
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/tag Build is passing Details

This commit is contained in:
Massaki Archambault 2021-12-26 00:13:33 -05:00
parent d25e59f713
commit 83de939022
1 changed files with 6 additions and 4 deletions

View File

@ -40,7 +40,7 @@ steps:
--- ---
kind: pipeline kind: pipeline
type: kubernetes type: kubernetes
name: build-multiarch-manifest name: create-multiarch-manifest
steps: steps:
- name: docker manifest - name: docker manifest
@ -55,10 +55,12 @@ steps:
DOCKER_PASSWORD: DOCKER_PASSWORD:
from_secret: docker_password from_secret: docker_password
- name: cleanup - name: cleanup
image: curlimages/curl image: alpine
commands: commands:
- curl -u "$DOCKER_USERNAME:$DOCKER_PASSWORD" -X "DELETE" https://cloud.docker.com/v2/repositories/${DRONE_REPO}/tags/${DRONE_COMMIT_SHA:0:8}-arm64 - apk add curl jq
- curl -u "$DOCKER_USERNAME:$DOCKER_PASSWORD" -X "DELETE" https://cloud.docker.com/v2/repositories/${DRONE_REPO}/tags/${DRONE_COMMIT_SHA:0:8}-amd64 - 'DOCKER_TOKEN="$(curl -sf -XPOST -H "Content-Type: application/json" -d "{\"username\":\"$DOCKER_USERNAME\",\"password\":\"$DOCKER_PASSWORD\"}" https://hub.docker.com/v2/users/login | jq --raw-output .token)"'
- 'curl -sf -XDELETE -H "Accept: application/json" -H "Authorization: Bearer $DOCKER_TOKEN" https://hub.docker.com/v2/repositories/${DRONE_REPO}/tags/${DRONE_COMMIT_SHA:0:8}-arm64/'
- 'curl -sf -XDELETE -H "Accept: application/json" -H "Authorization: Bearer $DOCKER_TOKEN" https://hub.docker.com/v2/repositories/${DRONE_REPO}/tags/${DRONE_COMMIT_SHA:0:8}-amd64/'
environment: environment:
DOCKER_USERNAME: DOCKER_USERNAME:
from_secret: docker_username from_secret: docker_username