2023-01-26 21:06:58 +00:00
|
|
|
|
2023-01-26 21:36:50 +00:00
|
|
|
.docker-build: &docker_build
|
2023-01-26 21:06:58 +00:00
|
|
|
# Use the official docker image.
|
|
|
|
image: docker:latest
|
|
|
|
services:
|
|
|
|
- docker:dind
|
|
|
|
before_script:
|
|
|
|
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
|
|
|
|
# Default branch leaves tag empty (= latest tag)
|
|
|
|
# All other branches are tagged with the escaped branch name (commit ref slug)
|
|
|
|
script:
|
|
|
|
- |
|
|
|
|
if [[ "$CI_COMMIT_BRANCH" == "$CI_DEFAULT_BRANCH" ]]; then
|
|
|
|
tag=""
|
|
|
|
echo "Running on default branch '$CI_DEFAULT_BRANCH': tag = 'latest'"
|
|
|
|
else
|
|
|
|
tag=":$CI_COMMIT_REF_SLUG"
|
|
|
|
echo "Running on branch '$CI_COMMIT_BRANCH': tag = $tag"
|
|
|
|
fi
|
2023-01-26 21:38:24 +00:00
|
|
|
- docker build --pull --build-arg GO_CMD=${GO_CMD} -t "$CI_REGISTRY_IMAGE/${GO_CMD}${tag}" .
|
|
|
|
- docker push "$CI_REGISTRY_IMAGE/${GO_CMD}${tag}"
|
2023-01-26 21:06:58 +00:00
|
|
|
# Run this job in a branch where a Dockerfile exists
|
|
|
|
rules:
|
|
|
|
- if: $CI_COMMIT_BRANCH
|
2023-03-06 18:16:37 +00:00
|
|
|
changes:
|
|
|
|
- cmd/${GO_CMD}/*/**
|
2023-03-10 14:02:43 +00:00
|
|
|
- cmd/${GO_CMD}/*
|
2023-05-18 15:09:24 +00:00
|
|
|
- go.mod
|
2023-01-26 21:36:50 +00:00
|
|
|
|
|
|
|
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
|
2023-03-06 17:27:58 +00:00
|
|
|
<<: *docker_build
|
|
|
|
|
|
|
|
dealsbot:
|
|
|
|
stage: build
|
|
|
|
variables:
|
|
|
|
GO_CMD: dealsbot
|
2023-03-09 23:26:08 +00:00
|
|
|
<<: *docker_build
|
|
|
|
|
|
|
|
domaincheckbot:
|
|
|
|
stage: build
|
|
|
|
variables:
|
|
|
|
GO_CMD: domaincheckbot
|
|
|
|
<<: *docker_build
|
|
|
|
|
2023-10-13 18:25:03 +00:00
|
|
|
dcimgproxy:
|
|
|
|
stage: build
|
|
|
|
variables:
|
|
|
|
GO_CMD: dcimgproxy
|
|
|
|
<<: *docker_build
|
|
|
|
|
2023-03-09 23:26:08 +00:00
|
|
|
pages:
|
|
|
|
stage: build
|
|
|
|
script:
|
|
|
|
- mkdir public
|
2023-03-10 13:41:49 +00:00
|
|
|
- cp cmd/domaincheckbot/config/domain.json public/
|
2023-03-09 23:26:08 +00:00
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- public
|
|
|
|
rules:
|
|
|
|
- if: $CI_COMMIT_BRANCH
|
|
|
|
changes:
|
2023-03-10 13:39:34 +00:00
|
|
|
- cmd/domaincheckbot/config/domain.json
|