diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-13 15:07:18 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-13 15:07:18 +0300 |
commit | c3eeb6a8d6a4b11f0bc5e5eb1ed43b0726f1ea26 (patch) | |
tree | 7283014bb12ce53b57d2703b229095ad58e6d820 /scripts | |
parent | 10e15ac3c2798956ff6a43d7b36bdf86c68aa817 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/build_gdk_image | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/scripts/build_gdk_image b/scripts/build_gdk_image index 540c60a990e..292d315b5ec 100755 --- a/scripts/build_gdk_image +++ b/scripts/build_gdk_image @@ -9,10 +9,22 @@ SHA_TAG="${CI_COMMIT_SHA}" BRANCH_TAG="${CI_COMMIT_REF_SLUG}" BASE_TAG=$([ "${BUILD_GDK_BASE}" == "true" ] && echo "${SHA_TAG}" || echo "master") +if [[ -z "${GDK_SHA}" ]]; then + GDK_SHA=$(git ls-remote https://gitlab.com/gitlab-org/gitlab-development-kit.git main | cut -f 1) +fi + +if [[ -n "${CI}" ]]; then + OUTPUT_OPTION="--push" +else + OUTPUT_OPTION="--load" +fi + function build_image() { local image=$1 local target=$2 + echoinfo "Using GDK at SHA ${GDK_SHA}" + docker buildx build \ --cache-to="type=inline" \ --cache-from="${image}:${BRANCH_TAG}" \ @@ -23,7 +35,8 @@ function build_image() { --tag="${image}:${SHA_TAG}" \ --tag="${image}:${BRANCH_TAG}" \ --build-arg="BASE_TAG=${BASE_TAG}" \ - --push \ + --build-arg="GDK_SHA=${GDK_SHA:-main}" \ + ${OUTPUT_OPTION} \ . } |