-
Notifications
You must be signed in to change notification settings - Fork 3
/
.gitlab-ci.yml
21 lines (19 loc) · 1.07 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# docker-in-docker and buildah/kaniko: https://docs.gitlab.com/ee/ci/docker/using_docker_build.html
#
# podman is based on buildah. Both need unshare permission, see: https://github.com/containers/buildah/issues/1901
# kaniko is the actual rootless builder, but does not support compose spec.
# In the end use docker with socket binding: https://docs.gitlab.com/ee/ci/docker/using_docker_build.html#use-the-docker-executor-with-docker-socket-binding
build-docker-images:
image: docker:latest
stage: build
variables:
# the docker:latest image sets this by default to DOCKER_HOST=tcp://docker:2375
DOCKER_HOST: "unix:///var/run/docker.sock"
rules:
- if: $CI_COMMIT_BRANCH == "latest" || $CI_COMMIT_BRANCH =~ /^2023/
script:
# remember that password with special characters may need to be escaped, i.e. '&pass!word' -> '\&pass\!word'
- docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD" docker.io
- ( cd moonspeak && TAG="$CI_COMMIT_BRANCH" docker compose build )
- ( cd moonspeak && TAG="$CI_COMMIT_BRANCH" docker compose push )
- docker logout