2022-06-26 14:03:22 +02:00
|
|
|
stages:
|
|
|
|
- build
|
|
|
|
|
|
|
|
docker-build-rolling:
|
|
|
|
stage: build
|
|
|
|
image:
|
2023-04-26 15:00:42 +02:00
|
|
|
name: docker.io/docker:23.0.3-dind
|
|
|
|
services:
|
|
|
|
- docker:23.0.3-dind
|
2022-06-26 14:03:22 +02:00
|
|
|
variables:
|
|
|
|
TAG: $CI_COMMIT_BRANCH
|
2023-04-27 14:45:48 +02:00
|
|
|
DOCKER_BUILDKIT: 1
|
|
|
|
DOCKER_HOST: tcp://docker:2376
|
2023-04-28 13:42:02 +02:00
|
|
|
DOCKER_TLS_CERTDIR: "/certs"
|
2022-06-26 14:03:22 +02:00
|
|
|
script:
|
2023-04-26 15:00:42 +02:00
|
|
|
- mkdir -p /root/.docker
|
|
|
|
- cp ${DOCKER_HUB_CONFIG} /root/.docker/config.json
|
2023-04-28 17:57:28 +02:00
|
|
|
- docker context create tls-environment
|
|
|
|
- docker buildx create --use tls-environment
|
2023-07-04 13:39:56 +02:00
|
|
|
- docker buildx build --push --platform=linux/amd64 --file=docker/production/castopod/Dockerfile --tag=${DOCKER_IMAGE_CASTOPOD}:${TAG} .
|
2023-05-04 14:41:01 +02:00
|
|
|
- docker buildx build --push --platform=linux/amd64 --file=docker/production/web-server/Dockerfile --tag=${DOCKER_IMAGE_WEB_SERVER}:${TAG} .
|
|
|
|
- docker buildx build --push --platform=linux/amd64 --file=docker/production/app/Dockerfile --tag=${DOCKER_IMAGE_APP}:${TAG} .
|
2022-06-26 14:03:22 +02:00
|
|
|
needs:
|
|
|
|
- pipeline: $PARENT_PIPELINE_ID
|
|
|
|
job: bundle
|
|
|
|
only:
|
|
|
|
refs:
|
|
|
|
- develop
|
2022-08-23 11:50:00 +02:00
|
|
|
|
|
|
|
docker-build-main-release:
|
|
|
|
stage: build
|
|
|
|
image:
|
2023-04-26 15:00:42 +02:00
|
|
|
name: docker.io/docker:23.0.3-dind
|
|
|
|
services:
|
|
|
|
- docker:23.0.3-dind
|
2023-04-27 14:45:48 +02:00
|
|
|
variables:
|
|
|
|
DOCKER_BUILDKIT: 1
|
|
|
|
DOCKER_HOST: tcp://docker:2376
|
2023-04-28 13:42:02 +02:00
|
|
|
DOCKER_TLS_CERTDIR: "/certs"
|
2022-08-23 11:50:00 +02:00
|
|
|
script:
|
2023-04-26 15:00:42 +02:00
|
|
|
- mkdir -p /root/.docker
|
|
|
|
- cp ${DOCKER_HUB_CONFIG} /root/.docker/config.json
|
2022-09-06 18:19:06 +02:00
|
|
|
- export CP_VERSION=$(cat CP_VERSION.env)
|
2023-04-28 17:57:28 +02:00
|
|
|
- docker context create tls-environment
|
|
|
|
- docker buildx create --use tls-environment
|
2023-07-04 13:39:56 +02:00
|
|
|
- docker buildx build --push --platform=linux/amd64 --file=docker/production/castopod/Dockerfile --tag=${DOCKER_IMAGE_CASTOPOD}:${CP_VERSION} --tag=${DOCKER_IMAGE_CASTOPOD}:latest .
|
2023-05-05 16:35:23 +02:00
|
|
|
- docker buildx build --push --platform=linux/amd64 --file=docker/production/web-server/Dockerfile --tag=${DOCKER_IMAGE_WEB_SERVER}:${CP_VERSION} --tag=${DOCKER_IMAGE_WEB_SERVER}:latest .
|
2023-05-04 14:41:01 +02:00
|
|
|
- docker buildx build --push --platform=linux/amd64 --file=docker/production/app/Dockerfile --tag=${DOCKER_IMAGE_APP}:${CP_VERSION} --tag=${DOCKER_IMAGE_APP}:latest .
|
2023-05-09 14:24:32 +02:00
|
|
|
# when --platform=linux/amd64,linux/arm64: amd64 image takes too long to be pushed as it needs to wait for arm64 to be built
|
|
|
|
# --> build and push amd64 image to be pushed first, then overwrite manifest after building arm64
|
2023-05-05 16:35:23 +02:00
|
|
|
- docker buildx build --push --platform=linux/amd64,linux/arm64 --file=docker/production/castopod/Dockerfile --tag=${DOCKER_IMAGE_CASTOPOD}:${CP_VERSION} --tag=${DOCKER_IMAGE_CASTOPOD}:latest .
|
2022-08-23 11:50:00 +02:00
|
|
|
needs:
|
|
|
|
- pipeline: $PARENT_PIPELINE_ID
|
|
|
|
job: release
|
|
|
|
only:
|
|
|
|
refs:
|
|
|
|
- main
|
|
|
|
|
|
|
|
docker-build-alpha-beta-release:
|
|
|
|
stage: build
|
|
|
|
image:
|
2023-04-26 15:00:42 +02:00
|
|
|
name: docker.io/docker:23.0.3-dind
|
|
|
|
services:
|
|
|
|
- docker:23.0.3-dind
|
2022-09-28 17:18:05 +02:00
|
|
|
variables:
|
|
|
|
TAG: $CI_COMMIT_BRANCH
|
2023-04-27 14:45:48 +02:00
|
|
|
DOCKER_BUILDKIT: 1
|
|
|
|
DOCKER_HOST: tcp://docker:2376
|
2023-04-28 13:42:02 +02:00
|
|
|
DOCKER_TLS_CERTDIR: "/certs"
|
2022-08-23 11:50:00 +02:00
|
|
|
script:
|
2023-04-26 15:00:42 +02:00
|
|
|
- mkdir -p /root/.docker
|
|
|
|
- cp ${DOCKER_HUB_CONFIG} /root/.docker/config.json
|
2022-09-06 18:19:06 +02:00
|
|
|
- export CP_VERSION=$(cat CP_VERSION.env)
|
2023-04-28 17:57:28 +02:00
|
|
|
- docker context create tls-environment
|
|
|
|
- docker buildx create --use tls-environment
|
2023-07-04 13:39:56 +02:00
|
|
|
- docker buildx build --push --platform=linux/amd64 --file=docker/production/castopod/Dockerfile --tag=${DOCKER_IMAGE_CASTOPOD}:${CP_VERSION} --tag=${DOCKER_IMAGE_CASTOPOD}:${TAG} .
|
2023-05-05 16:35:23 +02:00
|
|
|
- docker buildx build --push --platform=linux/amd64 --file=docker/production/web-server/Dockerfile --tag=${DOCKER_IMAGE_WEB_SERVER}:${CP_VERSION} --tag=${DOCKER_IMAGE_WEB_SERVER}:${TAG} .
|
2023-05-04 14:41:01 +02:00
|
|
|
- docker buildx build --push --platform=linux/amd64 --file=docker/production/app/Dockerfile --tag=${DOCKER_IMAGE_APP}:${CP_VERSION} --tag=${DOCKER_IMAGE_APP}:${TAG} .
|
2023-05-09 14:24:32 +02:00
|
|
|
# when --platform=linux/amd64,linux/arm64: amd64 image takes too long to be pushed as it needs to wait for arm64 to be built
|
|
|
|
# --> build and push amd64 image to be pushed first, then overwrite manifest after building arm64
|
2023-05-05 16:35:23 +02:00
|
|
|
- docker buildx build --push --platform=linux/amd64,linux/arm64 --file=docker/production/castopod/Dockerfile --tag=${DOCKER_IMAGE_CASTOPOD}:${CP_VERSION} --tag=${DOCKER_IMAGE_CASTOPOD}:${TAG} .
|
2022-08-23 11:50:00 +02:00
|
|
|
needs:
|
|
|
|
- pipeline: $PARENT_PIPELINE_ID
|
|
|
|
job: release
|
|
|
|
only:
|
|
|
|
refs:
|
|
|
|
- alpha
|
|
|
|
- beta
|