From 377f5fb26e8795a23072e846846fa64fb0e50c42 Mon Sep 17 00:00:00 2001 From: Eric Van Hensbergen Date: Sun, 10 May 2020 00:02:40 +0000 Subject: [PATCH] Simplify CI Use the template instead of duplicating it. Signed-off-by: Eric Van Hensbergen --- .gitlab-ci.yml | 59 ++++---------------------------------------------- 1 file changed, 4 insertions(+), 55 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7f88c43..b39924a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,57 +1,6 @@ +include: + - project: 'ericvh/gitlab-ci-arm-template' + file: '/.gitlab-ci.yml' + variables: - CI_BUILD_IMAGE: "registry.gitlab.com/ericvh/docker-buildx-qemu" CI_BUILDX_ARCHS: "linux/amd64,linux/arm64,linux/arm" - -.build: - image: $CI_BUILD_IMAGE - stage: build - services: - - name: docker:dind - entrypoint: ["env", "-u", "DOCKER_HOST"] - command: ["dockerd-entrypoint.sh"] - variables: - DOCKER_HOST: tcp://docker:2375/ - DOCKER_DRIVER: overlay2 - # See https://github.com/docker-library/docker/pull/166 - DOCKER_TLS_CERTDIR: "" - retry: 2 - before_script: - - | - if [[ -z "$CI_COMMIT_TAG" ]]; then - export CI_APPLICATION_REPOSITORY=${CI_APPLICATION_REPOSITORY:-$CI_REGISTRY_IMAGE/$CI_COMMIT_REF_SLUG} - export CI_APPLICATION_TAG=${CI_APPLICATION_TAG:-$CI_COMMIT_SHA} - else - export CI_APPLICATION_REPOSITORY=${CI_APPLICATION_REPOSITORY:-$CI_REGISTRY_IMAGE} - export CI_APPLICATION_TAG=${CI_APPLICATION_TAG:-$CI_COMMIT_TAG} - fi - - echo "$CI_REGISTRY_PASSWORD" | docker login -u "$CI_REGISTRY_USER" --password-stdin $CI_REGISTRY - -build:buildx-master: - extends: .build - only: - refs: - - master - variables: - - $CI_BUILDX_ARCHS - script: - # Use docker-container driver to allow useful features (push/multi-platform) - - update-binfmts --enable # Important: Ensures execution of other binary formats is enabled in the kernel - - docker buildx create --driver docker-container --use - - docker buildx inspect --bootstrap - - docker buildx ls - - docker buildx build --platform $CI_BUILDX_ARCHS --progress plain --pull -t "$CI_REGISTRY_IMAGE" --push . - -build:buildx: - extends: .build - only: - variables: - - $CI_BUILDX_ARCHS - except: - refs: - - master - script: - - update-binfmts --enable # Important: Ensures execution of other binary formats is enabled in the kernel - - docker buildx create --driver docker-container --use - - docker buildx inspect --bootstrap - - docker buildx ls - - docker buildx build --platform $CI_BUILDX_ARCHS --progress plain --pull -t "$CI_APPLICATION_REPOSITORY:$CI_APPLICATION_TAG" --push . \ No newline at end of file