From adc5ad66b19794bcd2eceedb25339a25261c9ea5 Mon Sep 17 00:00:00 2001 From: Seraphim Strub Date: Thu, 26 Jan 2023 22:36:50 +0100 Subject: [PATCH] build by template --- .gitlab-ci.yml | 33 ++++++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index eac462c..73742fd 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,8 +1,7 @@ -docker-build: +.docker-build: &docker_build # Use the official docker image. image: docker:latest - stage: build services: - docker:dind before_script: @@ -18,10 +17,34 @@ docker-build: tag=":$CI_COMMIT_REF_SLUG" echo "Running on branch '$CI_COMMIT_BRANCH': tag = $tag" fi - - docker build --pull -t "$CI_REGISTRY_IMAGE${tag}" . - - docker push "$CI_REGISTRY_IMAGE${tag}" + - docker build --pull --build-arg GO_CMD=${GO_CMD} -t "$CI_REGISTRY_IMAGE/${GO_CMD}/${tag}" . + - docker push "$CI_REGISTRY_IMAGE/${GO_CMD}/${tag}" # Run this job in a branch where a Dockerfile exists rules: - if: $CI_COMMIT_BRANCH exists: - - Dockerfile \ No newline at end of file + - Dockerfile + +funbot: + stage: build + variables: + GO_CMD: funbot + <<: *docker_build + +tempbot: + stage: build + variables: + GO_CMD: tempbot + <<: *docker_build + +vcbot: + stage: build + variables: + GO_CMD: vcbot + <<: *docker_build + +welcomebot: + stage: build + variables: + GO_CMD: welcomebot + <<: *docker_build \ No newline at end of file