Commit a854a61b authored by Carlo Landmeter's avatar Carlo Landmeter

Merge branch 'optional-arches' into 'master'

Allow disabling arches

Closes #1

See merge request !6
parents 7c17ba81 50fb34d0
Pipeline #4877 passed with stage
in 21 seconds
......@@ -13,4 +13,12 @@ include:
file: '/docker-image.yml'
```
If you want to exclude some architecture due to missing dependencies or other
reasons, you can do so by setting a variable like:
```yaml
variables:
DISABLE_S390X: "true"
```
Don't forget to enable runners for you project.
......@@ -17,7 +17,7 @@ stages:
- mkdir -p docker-images
- >
docker image save $CI_PROJECT_NAME:latest-$ARCH | pigz >
docker-images/${CI_PROJECT_NAME}_latest-${ARCH}.tar.gz
docker-images/${ARCH}.tar.gz
artifacts:
paths:
- docker-images/*.tar.gz
......@@ -36,6 +36,9 @@ build-s390x:
extends: .build
variables:
ARCH: s390x
except:
variables:
- $DISABLE_S390X
tags:
- docker-alpine
- ci-docker-image
......@@ -45,6 +48,9 @@ build-x86_64:
extends: .build
variables:
ARCH: x86_64
except:
variables:
- $DISABLE_X86_64
tags:
- docker-alpine
- ci-docker-image
......@@ -58,6 +64,9 @@ build-x86:
variables:
ARCH: x86
DOCKER_ARCH: i386
except:
variables:
- $DISABLE_X86
tags:
- docker-alpine
- ci-docker-image
......@@ -67,6 +76,9 @@ build-ppc64le:
extends: .build
variables:
ARCH: ppc64le
except:
variables:
- $DISABLE_PPC64LE
tags:
- docker-alpine
- ci-docker-image
......@@ -76,6 +88,9 @@ build-aarch64:
extends: .build
variables:
ARCH: aarch64
except:
variables:
- $DISABLE_AARCH64
tags:
- docker-alpine
- ci-docker-image
......@@ -89,6 +104,9 @@ build-armv7:
variables:
ARCH: armv7
DOCKER_ARCH: arm32v7
except:
variables:
- $DISABLE_ARMV7
tags:
- docker-alpine
- ci-docker-image
......@@ -101,7 +119,7 @@ build-armv7:
- tags
before_script:
- *docker-login
- unpigz -c docker-images/${CI_PROJECT_NAME}_latest-${ARCH}.tar.gz | docker image load
- unpigz -c docker-images/${ARCH}.tar.gz | docker image load
script:
- >
docker-push-image
......@@ -116,8 +134,13 @@ upload-s390x:
extends: .upload
variables:
ARCH: s390x
except:
variables:
- $DISABLE_S390X
dependencies:
- build-s390x
needs:
- build-s390x
tags:
- docker-alpine
- ci-docker-image
......@@ -127,8 +150,13 @@ upload-x86_64:
extends: .upload
variables:
ARCH: x86_64
except:
variables:
- $DISABLE_X86_64
dependencies:
- build-x86_64
needs:
- build-x86_64
tags:
- docker-alpine
- ci-docker-image
......@@ -140,8 +168,13 @@ upload-x86:
extends: .upload
variables:
ARCH: x86
except:
variables:
- $DISABLE_X86
dependencies:
- build-x86
needs:
- build-x86
tags:
- docker-alpine
- ci-docker-image
......@@ -151,8 +184,13 @@ upload-ppc64le:
extends: .upload
variables:
ARCH: ppc64le
except:
variables:
- $DISABLE_PPC64LE
dependencies:
- build-ppc64le
needs:
- build-ppc64le
tags:
- docker-alpine
- ci-docker-image
......@@ -162,8 +200,13 @@ upload-aarch64:
extends: .upload
variables:
ARCH: aarch64
except:
variables:
- $DISABLE_AARCH64
dependencies:
- build-aarch64
needs:
- build-aarch64
tags:
- docker-alpine
- ci-docker-image
......@@ -173,8 +216,13 @@ upload-armv7:
extends: .upload
variables:
ARCH: armv7
except:
variables:
- $DISABLE_ARMV7
dependencies:
- build-armv7
needs:
- build-armv7
tags:
- docker-alpine
- ci-docker-image
......@@ -194,24 +242,12 @@ create-manifest:
- *docker-login
- for image in docker-images/*.tar.gz; do unpigz -c "$image" | docker image load; done
script:
- >
docker-push-manifest $DOCKER_NAMESPACE/$CI_PROJECT_NAME:latest
$DOCKER_NAMESPACE/$CI_PROJECT_NAME:latest-
s390x
x86_64
x86
ppc64le
aarch64
armv7
- >
if [ -n "$CI_COMMIT_TAG" ]; then
docker-push-manifest $DOCKER_NAMESPACE/$CI_PROJECT_NAME:$CI_COMMIT_TAG
$DOCKER_NAMESPACE/$CI_PROJECT_NAME:$CI_COMMIT_TAG-
s390x
x86_64
x86
ppc64le
aarch64
armv7
;
fi
- arches=$(ls docker-images | xargs -I%% basename %% .tar.gz)
- images=$(printf -- "$DOCKER_NAMESPACE/$CI_PROJECT_NAME:latest-%s " $arches)
- docker manifest create --amend "$DOCKER_NAMESPACE/$CI_PROJECT_NAME:latest" $images
- docker manifest push --purge "$DOCKER_NAMESPACE/$CI_PROJECT_NAME:latest"
- if [ "$CI_COMMIT_TAG" ]; then
- docker manifest create --amend "$DOCKER_NAMESPACE/$CI_PROJECT_NAME:$CI_COMMIT_TAG" $images
- docker manifest push --purge "$DOCKER_NAMESPACE/$CI_PROJECT_NAME:$CI_COMMIT_TAG"
- fi
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment