diff --git a/.azure-pipelines/templates/integration-jobs.yml b/.azure-pipelines/templates/integration-jobs.yml index c7decd4..19bf061 100644 --- a/.azure-pipelines/templates/integration-jobs.yml +++ b/.azure-pipelines/templates/integration-jobs.yml @@ -1,11 +1,14 @@ 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 . + set -e + docker buildx create --use + VERSION=`cat VERSION` + echo "Docker tag is: ${VERSION}" + 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 @@ -16,7 +19,7 @@ jobs: - job: unit_tests dependsOn: build pool: - vmImage: ubuntu-18.04 + vmImage: ubuntu-20.04 steps: - task: DownloadPipelineArtifact@2 inputs: @@ -24,15 +27,16 @@ 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 - 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 pool: - vmImage: ubuntu-18.04 + vmImage: ubuntu-20.04 steps: - task: DownloadPipelineArtifact@2 inputs: @@ -40,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..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: @@ -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` @@ -20,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 @@ -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: