From 9e826a5039ddb3e94f741f5a90646bc7d2960a0f Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sun, 10 Oct 2021 17:08:50 +0200 Subject: [PATCH 1/5] Test docker buildx config --- .azure-pipelines/templates/integration-jobs.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.azure-pipelines/templates/integration-jobs.yml b/.azure-pipelines/templates/integration-jobs.yml index c7decd4..afdf528 100644 --- a/.azure-pipelines/templates/integration-jobs.yml +++ b/.azure-pipelines/templates/integration-jobs.yml @@ -1,12 +1,15 @@ jobs: - job: build pool: - vmImage: ubuntu-18.04 + vmImage: ubuntu-20.04 steps: - script: | - docker pull adferrand/backuppc || true - docker build --pull --cache-from adferrand/backuppc -t adferrand/backuppc . - docker save adferrand/backuppc | gzip -c -1 > $(Build.ArtifactStagingDirectory)/docker-backuppc.tar.gz + set -e + docker run --rm --privileged multiarch/qemu-user-static --reset -p yes + docker buildx create --use + VERSION=`cat VERSION` + echo "Docker tag is: ${VERSION}" + docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 --tag adferrand/backuppc --output type=local,dest=test . displayName: Build container - task: PublishPipelineArtifact@1 inputs: From 7ef4eb00c903c77552649c43ee975a03c36b5d98 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sun, 10 Oct 2021 17:14:37 +0200 Subject: [PATCH 2/5] Align config --- .azure-pipelines/templates/integration-jobs.yml | 6 ++++-- .azure-pipelines/templates/release-jobs.yml | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.azure-pipelines/templates/integration-jobs.yml b/.azure-pipelines/templates/integration-jobs.yml index afdf528..368d43a 100644 --- a/.azure-pipelines/templates/integration-jobs.yml +++ b/.azure-pipelines/templates/integration-jobs.yml @@ -5,11 +5,11 @@ jobs: steps: - script: | set -e - docker run --rm --privileged multiarch/qemu-user-static --reset -p yes docker buildx create --use VERSION=`cat VERSION` echo "Docker tag is: ${VERSION}" - docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 --tag adferrand/backuppc --output type=local,dest=test . + docker buildx build --platform linux/amd64 --tag adferrand/backuppc --load . + docker save adferrand/backuppc | gzip -c -1 > $(Build.ArtifactStagingDirectory)/docker-backuppc.tar.gz displayName: Build container - task: PublishPipelineArtifact@1 inputs: @@ -27,6 +27,7 @@ jobs: path: $(Build.SourcesDirectory) displayName: Retrieve Docker artifact - script: | + set -e docker load < docker-backuppc.tar.gz mkdir -p ./bin curl -fsSL https://goss.rocks/install | GOSS_DST=./bin sh @@ -43,6 +44,7 @@ jobs: path: $(Build.SourcesDirectory) displayName: Retrieve Docker artifact - script: | + set -e docker load < docker-backuppc.tar.gz docker run --name backuppc-integration --detach -p 8080:8080 adferrand/backuppc sleep 5 diff --git a/.azure-pipelines/templates/release-jobs.yml b/.azure-pipelines/templates/release-jobs.yml index db566c5..431d3fc 100644 --- a/.azure-pipelines/templates/release-jobs.yml +++ b/.azure-pipelines/templates/release-jobs.yml @@ -10,8 +10,6 @@ jobs: displayName: Login to DockerHub - script: | set -e - curl -fsSL get.docker.com -o get-docker.sh && sh get-docker.sh - export DOCKER_CLI_EXPERIMENTAL=enabled docker run --rm --privileged multiarch/qemu-user-static --reset -p yes docker buildx create --use VERSION=`cat VERSION` @@ -29,11 +27,13 @@ jobs: addToPath: true displayName: Install Python - script: | + set -e VERSION=`cat VERSION` echo "Version is: $version" echo "##vso[task.setvariable variable=ReleaseVersion;]${VERSION}" displayName: Get version - script: | + set -e python utils/extract_changelog.py $(ReleaseVersion) > release_$(ReleaseVersion).md - task: GithubRelease@0 inputs: From 5b53d1b20ce1a3ea1631c6aa08c6eb7ac8cafd08 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sun, 10 Oct 2021 17:33:27 +0200 Subject: [PATCH 3/5] Use ubuntu 20.04 to build --- .azure-pipelines/templates/integration-jobs.yml | 4 ++-- .azure-pipelines/templates/release-jobs.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.azure-pipelines/templates/integration-jobs.yml b/.azure-pipelines/templates/integration-jobs.yml index 368d43a..ffe630d 100644 --- a/.azure-pipelines/templates/integration-jobs.yml +++ b/.azure-pipelines/templates/integration-jobs.yml @@ -19,7 +19,7 @@ jobs: - job: unit_tests dependsOn: build pool: - vmImage: ubuntu-18.04 + vmImage: ubuntu-20.04 steps: - task: DownloadPipelineArtifact@2 inputs: @@ -36,7 +36,7 @@ jobs: - job: integration_tests dependsOn: build pool: - vmImage: ubuntu-18.04 + vmImage: ubuntu-20.04 steps: - task: DownloadPipelineArtifact@2 inputs: diff --git a/.azure-pipelines/templates/release-jobs.yml b/.azure-pipelines/templates/release-jobs.yml index 431d3fc..77c9341 100644 --- a/.azure-pipelines/templates/release-jobs.yml +++ b/.azure-pipelines/templates/release-jobs.yml @@ -1,7 +1,7 @@ jobs: - job: docker pool: - vmImage: ubuntu-18.04 + vmImage: ubuntu-20.04 steps: - task: Docker@2 inputs: @@ -18,7 +18,7 @@ jobs: displayName: Tag and push Docker images to DockerHub - job: github pool: - vmImage: ubuntu-18.04 + vmImage: ubuntu-20.04 dependsOn: docker steps: - task: UsePythonVersion@0 From e6d8990e64f13a65e3d4355cabf802e4ec43e7e5 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sun, 10 Oct 2021 17:39:05 +0200 Subject: [PATCH 4/5] Wait more --- .azure-pipelines/templates/integration-jobs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azure-pipelines/templates/integration-jobs.yml b/.azure-pipelines/templates/integration-jobs.yml index ffe630d..19bf061 100644 --- a/.azure-pipelines/templates/integration-jobs.yml +++ b/.azure-pipelines/templates/integration-jobs.yml @@ -31,7 +31,7 @@ jobs: docker load < docker-backuppc.tar.gz mkdir -p ./bin curl -fsSL https://goss.rocks/install | GOSS_DST=./bin sh - GOSS_PATH=./bin/goss GOSS_SLEEP=2 GOSS_FILES_PATH=./tests ./bin/dgoss run adferrand/backuppc + GOSS_PATH=./bin/goss GOSS_SLEEP=5 GOSS_FILES_PATH=./tests ./bin/dgoss run adferrand/backuppc displayName: Run unit tests - job: integration_tests dependsOn: build From 06fb7db7e39d23348d99c986526b707f9cd12158 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Thu, 23 Dec 2021 10:41:21 +0100 Subject: [PATCH 5/5] Add pigz utility --- Dockerfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6f16334..b8d32ed 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM alpine:3.14.2 +FROM alpine:3.15.0 LABEL maintainer="Adrien Ferrand " @@ -13,7 +13,8 @@ RUN apk --no-cache --update add \ supervisor \ perl perl-archive-zip perl-xml-rss perl-cgi perl-file-listing perl-json-xs \ expat samba-client iputils openssh openssl rrdtool ttf-dejavu \ - msmtp lighttpd lighttpd-mod_auth gzip apache2-utils tzdata libstdc++ libgomp \ + msmtp lighttpd lighttpd-mod_auth apache2-utils tzdata libstdc++ libgomp \ + gzip pigz \ && apk --no-cache --update -X http://dl-cdn.alpinelinux.org/alpine/edge/community add par2cmdline \ # Install backuppc build dependencies && apk --no-cache --update --virtual build-dependencies add \