Fix promotion job
Some checks failed
continuous-integration/drone/push Build is passing
continuous-integration/drone/promote/production Build is failing

This commit is contained in:
2024-11-23 13:11:20 +01:00
parent 88a16d0209
commit b52029788f

View File

@@ -74,9 +74,26 @@ steps:
REGISTRY_SERVER: "docker.io"
RELEASE_IMAGE_NAME: "docker.io/genunix/restic"
commands:
- skopeo login --username "$${REGISTRY_USERNAME}" --password "$${REGISTRY_PASSWORD}" "$${REGISTRY_SERVER}"
- echo "== Promoting $${RELEASE_IMAGE_NAME}:$${DRONE_COMMIT_SHA} into production"
- skopeo copy --preserve-digests --multi-arch all docker://$${RELEASE_IMAGE_NAME}:$${DRONE_COMMIT_SHA} docker://$${RELEASE_IMAGE_NAME}:latest
- podman login --username "$${REGISTRY_USERNAME}" --password "$${REGISTRY_PASSWORD}" "$${REGISTRY_SERVER}"
- echo "== Pulling $${RELEASE_IMAGE_NAME}:$${DRONE_COMMIT_SHA}"
- podman pull --arch amd64 docker://$${RELEASE_IMAGE_NAME}:$${DRONE_COMMIT_SHA}
- podman pull --arch arm64 docker://$${RELEASE_IMAGE_NAME}:$${DRONE_COMMIT_SHA}
- podman manifest inspect $${RELEASE_IMAGE_NAME}:$${DRONE_COMMIT_SHA}
- echo "== Promoting $${RELEASE_IMAGE_NAME}:$${DRONE_COMMIT_SHA} into production as latest tag"
- podman manifest push $${RELEASE_IMAGE_NAME}:$${DRONE_COMMIT_SHA} docker://$${RELEASE_IMAGE_NAME}:latest
- podman logout "$${REGISTRY_SERVER}"
volumes:
- name: containers
path: /var/lib/containers
- name: cleanup
image: mgoltzsche/podman:5.3.1
privileged: true
environment:
RELEASE_IMAGE_NAME: "docker.io/genunix/restic"
commands:
- podman manifest rm $${RELEASE_IMAGE_NAME}:$${DRONE_COMMIT_SHA} || true
- podman image prune -f
volumes:
- name: containers
path: /var/lib/containers