Update .gitlab-ci.yml, restic/Dockerfile, minio/Dockerfile, restic/version, restic/Makefile files

This commit is contained in:
Adrien le Maire 2020-12-20 17:32:44 +00:00
parent c79810b5e0
commit b19d80e94a
5 changed files with 48 additions and 1 deletions

View File

@ -95,6 +95,27 @@ keycloak:
variables:
- $CI_COMMIT_REF_PROTECTED == "true"
dev-restic:
stage: build
tags:
- docker
script:
- cd restic
- make nopush
only:
variables:
- $CI_COMMIT_REF_PROTECTED == "false"
restic:
stage: build
tags:
- docker
script:
- cd restic
- make push
only:
variables:
- $CI_COMMIT_REF_PROTECTED == "true"
.docker_init: &docker_init |
if ! docker info &>/dev/null; then

View File

@ -1,4 +1,4 @@
FROM alpine:3.12.2
FROM alpine:3.12.3
ENV MINIO_ACCESS_KEY_FILE=access_key \
MINIO_SECRET_KEY_FILE=secret_key \

7
restic/Dockerfile Normal file
View File

@ -0,0 +1,7 @@
FROM alpine:3.12.3
ARG VERSION
ARG TARGETARCH
ENV VERSION $VERSION
ADD https://github.com/restic/restic/releases/download/v${VERSION}/restic_${VERSION}_linux_${TARGETARCH}.bz2 /root/restic.bz2
RUN bunzip2 /root/restic.bz2 && chmod +x /root/restic && mv /root/restic /usr/bin/restic
ENTRYPOINT ["/usr/bin/restic"]

18
restic/Makefile Normal file
View File

@ -0,0 +1,18 @@
NAMESPACE=alemairebe
include version
IMAGE=restic
nopush:
docker buildx build --platform linux/amd64 --load \
--build-arg VERSION=$(VERSION) \
--tag ${NAMESPACE}/${IMAGE}:$(VERSION) \
--tag ${CI_REGISTRY_IMAGE}/${IMAGE}:$(VERSION) .
push:
docker buildx build --platform linux/amd64,linux/arm64,linux/arm,linux/ppc64le --push \
--build-arg VERSION=$(VERSION) \
--cache-from=type=registry,ref=${NAMESPACE}/buildx:${IMAGE} \
--cache-to=type=registry,ref=${NAMESPACE}/buildx:${IMAGE} \
--tag ${NAMESPACE}/${IMAGE}:$(VERSION) \
--tag ${CI_REGISTRY_IMAGE}/${IMAGE}:$(VERSION) .

1
restic/version Normal file
View File

@ -0,0 +1 @@
VERSION=0.11.0