Add promote pipeline
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone Build is passing

This commit is contained in:
2022-02-03 11:28:17 +01:00
parent 925e9481d0
commit fc8c2b96cd

View File

@@ -23,7 +23,6 @@ steps:
echo "== Publishing $${RELEASE_IMAGE_NAME}:$${DRONE_COMMIT_SHA}"
podman push $${RELEASE_IMAGE_NAME}:$${DRONE_COMMIT_SHA} docker://$${RELEASE_IMAGE_NAME}:$${DRONE_COMMIT_SHA}
podman push $${RELEASE_IMAGE_NAME}:$${DRONE_COMMIT_SHA} docker://$${RELEASE_IMAGE_NAME}:$${HASS_VERSION}
podman push $${RELEASE_IMAGE_NAME}:$${DRONE_COMMIT_SHA} docker://$${RELEASE_IMAGE_NAME}:latest
podman logout "$${REGISTRY_SERVER}"
volumes:
- name: containers
@@ -55,3 +54,39 @@ volumes:
- name: containers
host:
path: /var/lib/containers
---
kind: pipeline
type: kubernetes
name: promote
steps:
- name: promote
image: tomkukral/buildah:0.27
privileged: true
environment:
REGISTRY_USERNAME:
from_secret: registry_username
REGISTRY_PASSWORD:
from_secret: registry_password
REGISTRY_SERVER: "docker.io"
RELEASE_IMAGE_NAME: "docker.io/genunix/homeassistant"
commands:
- podman login --username "$${REGISTRY_USERNAME}" --password "$${REGISTRY_PASSWORD}" "$${REGISTRY_SERVER}"
- echo "== Promoting $${RELEASE_IMAGE_NAME}:$${DRONE_COMMIT_SHA} into production"
- podman pull docker://$${RELEASE_IMAGE_NAME}:$${DRONE_COMMIT_SHA}
- podman push $${RELEASE_IMAGE_NAME}:$${DRONE_COMMIT_SHA} docker://$${RELEASE_IMAGE_NAME}:latest
- podman logout "$${REGISTRY_SERVER}"
volumes:
- name: containers
path: /var/lib/containers
trigger:
event:
- promote
target:
- production
volumes:
- name: containers
host:
path: /var/lib/containers