From 1f8ec3aaae98ecc96a2237c48ab50eb399027175 Mon Sep 17 00:00:00 2001 From: Mirek Kratochvil Date: Thu, 15 Jun 2023 11:02:16 +0200 Subject: [PATCH] fixup the CI registry (thanks @sascha.herzinger) --- .gitlab-ci.yml | 46 ++++++++++++++-------------------------------- 1 file changed, 14 insertions(+), 32 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1097787..56fe225 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,42 +1,24 @@ - -image: docker:19.03.0 +image: docker:20.10.16 variables: - # When using dind service, we need to instruct docker, to talk with - # the daemon started inside of the service. The daemon is available - # with a network connection instead of the default - # /var/run/docker.sock socket. docker:19.03.1 does this automatically - # by setting the DOCKER_HOST in - # https://github.com/docker-library/docker/blob/d45051476babc297257df490d22cbd806f1b11e4/19.03.1/docker-entrypoint.sh#L23-L29 - # - # The 'docker' hostname is the alias of the service container as described at - # https://docs.gitlab.com/ee/ci/docker/using_docker_images.html#accessing-the-services. - # - # Note that if you're using the Kubernetes executor, the variable - # should be set to tcp://localhost:2376/ because of how the - # Kubernetes executor connects services to the job container - #DOCKER_HOST: tcp://localhost:2376/ - # - # When using dind, it's wise to use the overlayfs driver for - # improved performance. DOCKER_DRIVER: overlay2 - # Specify to Docker where to create the certificates, Docker will - # create them automatically on boot, and will create - # `/certs/client` that will be shared between the service and job - # container, thanks to volume mount from config.toml DOCKER_TLS_CERTDIR: "" services: - - name: docker:19.03.0-dind - command: ["--mtu=1458"] + - name: repomanager.lcsb.uni.lu:9999/library/docker:20.10.16-dind + command: ["--mtu=1458", "--registry-mirror", "https://repomanager.lcsb.uni.lu:9999"] + alias: docker -build_image: - before_script: - - echo -n $DOCKER_AUTH_TOKEN | docker login -u exaexa --password-stdin $CI_REGISTRY +stages: + - build + +build: + stage: build script: - - docker build -t $CI_REGISTRY_IMAGE . - - docker push $CI_REGISTRY_IMAGE + - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY + - docker build -t $CI_REGISTRY_IMAGE:latest . + - docker push $CI_REGISTRY_IMAGE:latest + rules: + - if: '$CI_COMMIT_REF_NAME == "master"' tags: - privileged - artifacts: - expire_in: 1 week