multi-user/.gitlab-ci.yml
2021-12-02 16:33:02 +01:00

43 lines
1.7 KiB
YAML

stages:
# - test
# - build-addon-zip
# - build-amd64
- build-arm64
# - doc
# include:
# # - local: .gitlab/ci/test.gitlab-ci.yml
# # - local: .gitlab/ci/build-addon.gitlab-ci.yml
# - local: .gitlab/ci/build-image.gitlab-ci.yml
# # - local: .gitlab/ci/doc.gitlab-ci.yml
build-arm64:
stage: build-arm64
# needs: ["build-addon-zip"]
image: slumber/docker-python
variables:
DOCKER_DRIVER: overlay2
DOCKER_TLS_CERTDIR: "/certs"
GIT_SUBMODULE_STRATEGY: recursive
services:
- docker:19.03.12-dind
before_script:
- apk add curl
- mkdir -p ~/.docker/cli-plugins
- curl -sSLo ~/.docker/cli-plugins/docker-buildx https://github.com/docker/buildx/releases/download/$BUILDX_VERSION/buildx-$BUILDX_VERSION.linux-amd64
- chmod +x ~/.docker/cli-plugins/docker-buildx
- docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
- docker info
script:
- RP_VERSION="$(python scripts/get_replication_version.py)"
- VERSION="$(python scripts/get_addon_version.py)"
- echo "Building docker image with replication ${RP_VERSION}"
- docker buildx create arm64 --use
- docker buildx build --platform linux/arm64 --build-arg version={VERSION} --tag registry.gitlab.com/slumber/multi-user/multi-user-server:${VERSION}-arm64 ./scripts/docker_server
- echo "Pushing to gitlab registry ${VERSION}-arm64"
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker tag registry.gitlab.com/slumber/multi-user/multi-user-server:${VERSION}-arm64 registry.gitlab.com/slumber/multi-user/multi-user-server:${CI_COMMIT_REF_NAME}-arm64
- docker push registry.gitlab.com/slumber/multi-user/multi-user-server:${VERSION}-arm64