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:
|
jobs:
|
||||||
- job: build
|
- job: build
|
||||||
pool:
|
pool:
|
||||||
vmImage: ubuntu-18.04
|
vmImage: ubuntu-20.04
|
||||||
steps:
|
steps:
|
||||||
- script: |
|
- script: |
|
||||||
docker pull adferrand/backuppc || true
|
set -e
|
||||||
docker build --pull --cache-from adferrand/backuppc -t adferrand/backuppc .
|
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
|
docker save adferrand/backuppc | gzip -c -1 > $(Build.ArtifactStagingDirectory)/docker-backuppc.tar.gz
|
||||||
displayName: Build container
|
displayName: Build container
|
||||||
- task: PublishPipelineArtifact@1
|
- task: PublishPipelineArtifact@1
|
||||||
@ -16,7 +19,7 @@ jobs:
|
|||||||
- job: unit_tests
|
- job: unit_tests
|
||||||
dependsOn: build
|
dependsOn: build
|
||||||
pool:
|
pool:
|
||||||
vmImage: ubuntu-18.04
|
vmImage: ubuntu-20.04
|
||||||
steps:
|
steps:
|
||||||
- task: DownloadPipelineArtifact@2
|
- task: DownloadPipelineArtifact@2
|
||||||
inputs:
|
inputs:
|
||||||
@ -24,15 +27,16 @@ jobs:
|
|||||||
path: $(Build.SourcesDirectory)
|
path: $(Build.SourcesDirectory)
|
||||||
displayName: Retrieve Docker artifact
|
displayName: Retrieve Docker artifact
|
||||||
- script: |
|
- script: |
|
||||||
|
set -e
|
||||||
docker load < docker-backuppc.tar.gz
|
docker load < docker-backuppc.tar.gz
|
||||||
mkdir -p ./bin
|
mkdir -p ./bin
|
||||||
curl -fsSL https://goss.rocks/install | GOSS_DST=./bin sh
|
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
|
displayName: Run unit tests
|
||||||
- job: integration_tests
|
- job: integration_tests
|
||||||
dependsOn: build
|
dependsOn: build
|
||||||
pool:
|
pool:
|
||||||
vmImage: ubuntu-18.04
|
vmImage: ubuntu-20.04
|
||||||
steps:
|
steps:
|
||||||
- task: DownloadPipelineArtifact@2
|
- task: DownloadPipelineArtifact@2
|
||||||
inputs:
|
inputs:
|
||||||
@ -40,6 +44,7 @@ jobs:
|
|||||||
path: $(Build.SourcesDirectory)
|
path: $(Build.SourcesDirectory)
|
||||||
displayName: Retrieve Docker artifact
|
displayName: Retrieve Docker artifact
|
||||||
- script: |
|
- script: |
|
||||||
|
set -e
|
||||||
docker load < docker-backuppc.tar.gz
|
docker load < docker-backuppc.tar.gz
|
||||||
docker run --name backuppc-integration --detach -p 8080:8080 adferrand/backuppc
|
docker run --name backuppc-integration --detach -p 8080:8080 adferrand/backuppc
|
||||||
sleep 5
|
sleep 5
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
jobs:
|
jobs:
|
||||||
- job: docker
|
- job: docker
|
||||||
pool:
|
pool:
|
||||||
vmImage: ubuntu-18.04
|
vmImage: ubuntu-20.04
|
||||||
steps:
|
steps:
|
||||||
- task: Docker@2
|
- task: Docker@2
|
||||||
inputs:
|
inputs:
|
||||||
@ -10,8 +10,6 @@ jobs:
|
|||||||
displayName: Login to DockerHub
|
displayName: Login to DockerHub
|
||||||
- script: |
|
- script: |
|
||||||
set -e
|
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 run --rm --privileged multiarch/qemu-user-static --reset -p yes
|
||||||
docker buildx create --use
|
docker buildx create --use
|
||||||
VERSION=`cat VERSION`
|
VERSION=`cat VERSION`
|
||||||
@ -20,7 +18,7 @@ jobs:
|
|||||||
displayName: Tag and push Docker images to DockerHub
|
displayName: Tag and push Docker images to DockerHub
|
||||||
- job: github
|
- job: github
|
||||||
pool:
|
pool:
|
||||||
vmImage: ubuntu-18.04
|
vmImage: ubuntu-20.04
|
||||||
dependsOn: docker
|
dependsOn: docker
|
||||||
steps:
|
steps:
|
||||||
- task: UsePythonVersion@0
|
- task: UsePythonVersion@0
|
||||||
@ -29,11 +27,13 @@ jobs:
|
|||||||
addToPath: true
|
addToPath: true
|
||||||
displayName: Install Python
|
displayName: Install Python
|
||||||
- script: |
|
- script: |
|
||||||
|
set -e
|
||||||
VERSION=`cat VERSION`
|
VERSION=`cat VERSION`
|
||||||
echo "Version is: $version"
|
echo "Version is: $version"
|
||||||
echo "##vso[task.setvariable variable=ReleaseVersion;]${VERSION}"
|
echo "##vso[task.setvariable variable=ReleaseVersion;]${VERSION}"
|
||||||
displayName: Get version
|
displayName: Get version
|
||||||
- script: |
|
- script: |
|
||||||
|
set -e
|
||||||
python utils/extract_changelog.py $(ReleaseVersion) > release_$(ReleaseVersion).md
|
python utils/extract_changelog.py $(ReleaseVersion) > release_$(ReleaseVersion).md
|
||||||
- task: GithubRelease@0
|
- task: GithubRelease@0
|
||||||
inputs:
|
inputs:
|
||||||
|
Loading…
Reference in New Issue
Block a user