fix cleanup
This commit is contained in:
parent
d25e59f713
commit
83de939022
10
.drone.yml
10
.drone.yml
|
@ -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
|
||||||
|
|
Reference in New Issue