From b19d80e94a1b2d8d8a7df3b831b26d175500b3dc Mon Sep 17 00:00:00 2001 From: Adrien le Maire Date: Sun, 20 Dec 2020 17:32:44 +0000 Subject: [PATCH] Update .gitlab-ci.yml, restic/Dockerfile, minio/Dockerfile, restic/version, restic/Makefile files --- .gitlab-ci.yml | 21 +++++++++++++++++++++ minio/Dockerfile | 2 +- restic/Dockerfile | 7 +++++++ restic/Makefile | 18 ++++++++++++++++++ restic/version | 1 + 5 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 restic/Dockerfile create mode 100644 restic/Makefile create mode 100644 restic/version diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5ee1651..dd97aea 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -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 diff --git a/minio/Dockerfile b/minio/Dockerfile index 63abbc5..ed5a20e 100644 --- a/minio/Dockerfile +++ b/minio/Dockerfile @@ -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 \ diff --git a/restic/Dockerfile b/restic/Dockerfile new file mode 100644 index 0000000..0929433 --- /dev/null +++ b/restic/Dockerfile @@ -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"] diff --git a/restic/Makefile b/restic/Makefile new file mode 100644 index 0000000..09ae2b4 --- /dev/null +++ b/restic/Makefile @@ -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) . diff --git a/restic/version b/restic/version new file mode 100644 index 0000000..df70d37 --- /dev/null +++ b/restic/version @@ -0,0 +1 @@ +VERSION=0.11.0