forked from conda-forge/miniforge-images
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
65 lines (65 loc) · 3.33 KB
/
azure-pipelines.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
jobs:
- job: docker_build
pool:
vmImage: ubuntu-20.04
strategy:
matrix:
mambaforge:
MINIFORGE_NAME: "Mambaforge"
MINIFORGE_VERSION: "22.11.1-4"
DOCKERFILE: "ubuntu"
mambaforge-pypy3:
MINIFORGE_NAME: "Mambaforge-pypy3"
MINIFORGE_VERSION: "22.11.1-4"
DOCKERFILE: "ubuntu"
miniforge3:
MINIFORGE_NAME: "Miniforge3"
MINIFORGE_VERSION: "22.11.1-4"
DOCKERFILE: "ubuntu"
miniforge-pypy3:
MINIFORGE_NAME: "Miniforge-pypy3"
MINIFORGE_VERSION: "22.11.1-4"
DOCKERFILE: "ubuntu"
timeoutInMinutes: 360
steps:
- script: |
echo '{"experimental": true, "cgroup-parent": "/actions_job"}' | sudo tee /etc/docker/daemon.json
cat /etc/docker/daemon.json
sudo service docker restart
displayName: Activate experimental Docker features
- script: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
displayName: Install qemu static
- script: |
set -euxo pipefail
docker buildx ls
docker buildx create --use --platform linux/arm64/v8,linux/amd64,linux/ppc64le
# Build the image for all platforms and store the final result in the build cache.
# All the later steps will pick this up from the cache.
docker buildx build --platform linux/arm64/v8,linux/amd64,linux/ppc64le -f ubuntu/Dockerfile --build-arg MINIFORGE_NAME --build-arg MINIFORGE_VERSION .
# As we need to fallback to the docker builder to run the tests, we cannot run all tests at once.
for platform in "linux/arm64/v8" "linux/amd64" "linux/ppc64le"; do
docker buildx build --platform ${platform} -f ubuntu/Dockerfile --build-arg MINIFORGE_NAME --build-arg MINIFORGE_VERSION -t localforge --load .
# We need to use the docker builder instead of the docker-container builder to fetch from local registry.
docker buildx build --platform ${platform} -f tests/Dockerfile.root tests/ --build-arg IMAGE_TO_TEST=localforge --builder default
done
displayName: Build and test image
env:
MINIFORGE_NAME: $(MINIFORGE_NAME)
MINIFORGE_VERSION: $(MINIFORGE_VERSION)
DOCKERFILE: $(DOCKERFILE)
- script: |
set -euxo pipefail
docker login -u condaforgebot -p ${DH_PASSWORD}
docker login -u conda_forge_daemon -p ${CFD_QUAY_PASSWORD} quay.io
for registry in "" "quay.io/"; do
docker buildx build --platform linux/arm64/v8,linux/amd64,linux/ppc64le -f ubuntu/Dockerfile --build-arg MINIFORGE_NAME --build-arg MINIFORGE_VERSION -t ${registry}condaforge/${MINIFORGE_NAME/M/m}:latest --push .
docker buildx build --platform linux/arm64/v8,linux/amd64,linux/ppc64le -f ubuntu/Dockerfile --build-arg MINIFORGE_NAME --build-arg MINIFORGE_VERSION -t ${registry}condaforge/${MINIFORGE_NAME/M/m}:${MINIFORGE_VERSION} --push .
done
displayName: Push image
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
env:
MINIFORGE_NAME: $(MINIFORGE_NAME)
MINIFORGE_VERSION: $(MINIFORGE_VERSION)
DOCKERFILE: $(DOCKERFILE)
CFD_QUAY_PASSWORD: $(CFD_QUAY_PASSWORD)
DH_PASSWORD: $(DH_PASSWORD)