Skip to content

Commit 3183c70

Browse files
author
vincent.mathon
committed
Add cube with Airflow flight SQL connector docker image to our registry
1 parent 2db653b commit 3183c70

File tree

2 files changed

+51
-0
lines changed

2 files changed

+51
-0
lines changed

.gitlab-ci.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
stages:
2+
- publish
3+
4+
publish:
5+
stage: publish
6+
image: docker:28.0.1
7+
services:
8+
- name: docker:28.0.1-dind
9+
alias: docker
10+
# explicitly disable tls to avoid docker startup interruption
11+
command: [ "--tls=false" ]
12+
entrypoint: [ "sh", "-c", "dockerd-entrypoint.sh --insecure-registry=${CI_REGISTRY}" ]
13+
variables:
14+
DOCKER_HOST: tcp://docker:2375/
15+
DOCKER_TLS_CERTDIR: ""
16+
script:
17+
- ./publish.sh $CI_COMMIT_REF_NAME

publish.sh

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/bin/sh
2+
3+
set -euxo
4+
5+
branchName="${1}";
6+
7+
buildTagAndPush() {
8+
image="${1}"; shift;
9+
branch="${1}";
10+
repository="${CI_REGISTRY}"/"${CI_PROJECT_PATH}"
11+
12+
if [ "$branch" = "main" ]
13+
then
14+
# For master we also Tag one image with the date just to track each master merge
15+
date=$(date '+%Y%m%d-%H%M%S')
16+
target_img="${image}:${branch}_${date}";
17+
target_img_latest="${image}:latest";
18+
docker build -t "${target_img}" -t "${target_img_latest}" -f ./packages/cubejs-docker/dev.Dockerfile --no-cache .
19+
docker tag "${target_img}" "${repository}"/"${target_img}"
20+
docker tag "${target_img_latest}" "${repository}"/"${target_img_latest}"
21+
docker push "${repository}"/"${target_img}"
22+
docker push "${repository}"/"${target_img_latest}"
23+
else
24+
# We use only the
25+
target_img=${image}:$(echo "${branch}" | sed -r 's/[\/]+/_/g');
26+
docker build -t "${target_img}" -f ./packages/cubejs-docker/dev.Dockerfile --no-cache .
27+
docker tag "${target_img}" "${repository}"/"${target_img}"
28+
docker push "${repository}"/"${target_img}"
29+
fi
30+
}
31+
32+
echo "${CI_REGISTRY_PASSWORD}" | docker login -u "${CI_REGISTRY_USER}" --password-stdin "${CI_REGISTRY}"
33+
buildTagAndPush "cube" "${branchName}"
34+

0 commit comments

Comments
 (0)