Test docker buildx config (#63)

* Test docker buildx config

* Align config

* Use ubuntu 20.04 to build

* Wait more
This commit is contained in:
Adrien Ferrand 2021-10-11 07:53:45 +02:00 committed by GitHub
parent a452e98098
commit 446e39401f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 10 deletions

View File

@ -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

View File

@ -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: