fix cleanup
This commit is contained in:
parent
d25e59f713
commit
83de939022
10
.drone.yml
10
.drone.yml
|
@ -40,7 +40,7 @@ steps:
|
|||
---
|
||||
kind: pipeline
|
||||
type: kubernetes
|
||||
name: build-multiarch-manifest
|
||||
name: create-multiarch-manifest
|
||||
|
||||
steps:
|
||||
- name: docker manifest
|
||||
|
@ -55,10 +55,12 @@ steps:
|
|||
DOCKER_PASSWORD:
|
||||
from_secret: docker_password
|
||||
- name: cleanup
|
||||
image: curlimages/curl
|
||||
image: alpine
|
||||
commands:
|
||||
- curl -u "$DOCKER_USERNAME:$DOCKER_PASSWORD" -X "DELETE" https://cloud.docker.com/v2/repositories/${DRONE_REPO}/tags/${DRONE_COMMIT_SHA:0:8}-arm64
|
||||
- curl -u "$DOCKER_USERNAME:$DOCKER_PASSWORD" -X "DELETE" https://cloud.docker.com/v2/repositories/${DRONE_REPO}/tags/${DRONE_COMMIT_SHA:0:8}-amd64
|
||||
- apk add curl jq
|
||||
- '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:
|
||||
DOCKER_USERNAME:
|
||||
from_secret: docker_username
|
||||
|
|
Reference in New Issue