mirror of
https://github.com/adferrand/docker-backuppc.git
synced 2023-11-05 04:40:26 +01:00
Test docker buildx config (#63)
* Test docker buildx config * Align config * Use ubuntu 20.04 to build * Wait more
This commit is contained in:
parent
a452e98098
commit
446e39401f
@ -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
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user