Compare commits
11 Commits
9bd4abc641
...
renovate/g
| Author | SHA1 | Date | |
|---|---|---|---|
| c07e8209cc | |||
| 598fc6536f | |||
| b52029788f | |||
| 88a16d0209 | |||
| aa8faa8b5b | |||
| 2ffba27f1d | |||
| b62f5d0a03 | |||
| 878f2f142a | |||
| 6dbd7eab7e | |||
| 717f351413 | |||
| 801f4eb269 |
61
.drone.yml
61
.drone.yml
@@ -19,10 +19,12 @@ steps:
|
|||||||
RESTIC_VERSION=$$(grep RESTIC_VERSION= Dockerfile|cut -d = -f 2)
|
RESTIC_VERSION=$$(grep RESTIC_VERSION= Dockerfile|cut -d = -f 2)
|
||||||
podman login --username "$${REGISTRY_USERNAME}" --password "$${REGISTRY_PASSWORD}" "$${REGISTRY_SERVER}"
|
podman login --username "$${REGISTRY_USERNAME}" --password "$${REGISTRY_PASSWORD}" "$${REGISTRY_SERVER}"
|
||||||
echo "== Building $${RELEASE_IMAGE_NAME}:$${DRONE_COMMIT_SHA}"
|
echo "== Building $${RELEASE_IMAGE_NAME}:$${DRONE_COMMIT_SHA}"
|
||||||
podman build --platform linux/arm64 --platform linux/amd64 --pull-always --format docker -t $${RELEASE_IMAGE_NAME}:$${DRONE_COMMIT_SHA} .
|
podman manifest create $${RELEASE_IMAGE_NAME}:$${DRONE_COMMIT_SHA}
|
||||||
|
podman build --platform linux/arm64,linux/amd64 --pull-always --manifest $${RELEASE_IMAGE_NAME}:$${DRONE_COMMIT_SHA} .
|
||||||
|
podman manifest inspect $${RELEASE_IMAGE_NAME}:$${DRONE_COMMIT_SHA}
|
||||||
echo "== Publishing $${RELEASE_IMAGE_NAME}:$${DRONE_COMMIT_SHA}"
|
echo "== Publishing $${RELEASE_IMAGE_NAME}:$${DRONE_COMMIT_SHA}"
|
||||||
podman push $${RELEASE_IMAGE_NAME}:$${DRONE_COMMIT_SHA} docker://$${RELEASE_IMAGE_NAME}:$${DRONE_COMMIT_SHA}
|
podman manifest 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 manifest push $${RELEASE_IMAGE_NAME}:$${DRONE_COMMIT_SHA} docker://$${RELEASE_IMAGE_NAME}:$${RESTIC_VERSION}
|
||||||
podman logout "$${REGISTRY_SERVER}"
|
podman logout "$${REGISTRY_SERVER}"
|
||||||
volumes:
|
volumes:
|
||||||
- name: containers
|
- name: containers
|
||||||
@@ -37,7 +39,7 @@ steps:
|
|||||||
environment:
|
environment:
|
||||||
RELEASE_IMAGE_NAME: "docker.io/genunix/restic"
|
RELEASE_IMAGE_NAME: "docker.io/genunix/restic"
|
||||||
commands:
|
commands:
|
||||||
- podman rmi -f $${RELEASE_IMAGE_NAME}:$${DRONE_COMMIT_SHA}
|
- podman manifest rm $${RELEASE_IMAGE_NAME}:$${DRONE_COMMIT_SHA} || true
|
||||||
- podman image prune -f
|
- podman image prune -f
|
||||||
volumes:
|
volumes:
|
||||||
- name: containers
|
- name: containers
|
||||||
@@ -55,3 +57,54 @@ volumes:
|
|||||||
- name: containers
|
- name: containers
|
||||||
host:
|
host:
|
||||||
path: /var/lib/containers
|
path: /var/lib/containers
|
||||||
|
---
|
||||||
|
kind: pipeline
|
||||||
|
type: kubernetes
|
||||||
|
name: promote
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: promote
|
||||||
|
image: mgoltzsche/podman:5.3.1
|
||||||
|
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/restic"
|
||||||
|
commands:
|
||||||
|
- 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
|
||||||
|
|
||||||
|
trigger:
|
||||||
|
event:
|
||||||
|
- promote
|
||||||
|
target:
|
||||||
|
- production
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
- name: containers
|
||||||
|
host:
|
||||||
|
path: /var/lib/containers
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
FROM golang:1.22-alpine AS builder
|
FROM golang:1.25-alpine AS builder
|
||||||
|
|
||||||
ARG RESTIC_VERSION=0.16.4
|
ARG RESTIC_VERSION=0.17.3
|
||||||
RUN apk add --no-cache git
|
RUN apk add --no-cache git
|
||||||
RUN git clone --depth 1 --branch v${RESTIC_VERSION} https://github.com/restic/restic.git /go/src/github.com/restic/restic
|
RUN git clone --depth 1 --branch v${RESTIC_VERSION} https://github.com/restic/restic.git /go/src/github.com/restic/restic
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user