Add cleanup into promote
Some checks reported errors
continuous-integration/drone/push Build encountered an error
Some checks reported errors
continuous-integration/drone/push Build encountered an error
This commit is contained in:
30
.drone.yml
30
.drone.yml
@@ -81,6 +81,22 @@ steps:
|
|||||||
- name: containers
|
- name: containers
|
||||||
path: /var/lib/containers
|
path: /var/lib/containers
|
||||||
|
|
||||||
|
- name: cleanup
|
||||||
|
image: mgoltzsche/podman:5.1.1
|
||||||
|
privileged: true
|
||||||
|
environment:
|
||||||
|
RELEASE_IMAGE_NAME: "docker.io/genunix/homeassistant"
|
||||||
|
commands:
|
||||||
|
- podman rmi -f $${RELEASE_IMAGE_NAME}:$${DRONE_COMMIT_SHA}
|
||||||
|
- podman rmi -f $${RELEASE_IMAGE_NAME}:latest
|
||||||
|
- podman image prune -f
|
||||||
|
volumes:
|
||||||
|
- name: containers
|
||||||
|
path: /var/lib/containers
|
||||||
|
when:
|
||||||
|
branch:
|
||||||
|
- master
|
||||||
|
|
||||||
- name: deploy
|
- name: deploy
|
||||||
image: bitnami/kubectl:1.30
|
image: bitnami/kubectl:1.30
|
||||||
environment:
|
environment:
|
||||||
@@ -90,6 +106,20 @@ steps:
|
|||||||
- echo "$${KUBECONFIG}" > kubeconfig
|
- echo "$${KUBECONFIG}" > kubeconfig
|
||||||
- kubectl --kubeconfig=kubeconfig -n hass rollout restart deployment/hass
|
- kubectl --kubeconfig=kubeconfig -n hass rollout restart deployment/hass
|
||||||
- kubectl --kubeconfig=kubeconfig -n hass rollout status deployment/hass
|
- kubectl --kubeconfig=kubeconfig -n hass rollout status deployment/hass
|
||||||
|
- name: cleanup
|
||||||
|
image: mgoltzsche/podman:5.1.1
|
||||||
|
privileged: true
|
||||||
|
environment:
|
||||||
|
RELEASE_IMAGE_NAME: "docker.io/genunix/homeassistant"
|
||||||
|
commands:
|
||||||
|
- podman rmi -f $${RELEASE_IMAGE_NAME}:$${DRONE_COMMIT_SHA}
|
||||||
|
- podman image prune -f
|
||||||
|
volumes:
|
||||||
|
- name: containers
|
||||||
|
path: /var/lib/containers
|
||||||
|
when:
|
||||||
|
branch:
|
||||||
|
- master
|
||||||
|
|
||||||
trigger:
|
trigger:
|
||||||
event:
|
event:
|
||||||
|
|||||||
Reference in New Issue
Block a user