Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-06-13 15:07:18 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-06-13 15:07:18 +0300
commitc3eeb6a8d6a4b11f0bc5e5eb1ed43b0726f1ea26 (patch)
tree7283014bb12ce53b57d2703b229095ad58e6d820 /scripts
parent10e15ac3c2798956ff6a43d7b36bdf86c68aa817 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/build_gdk_image15
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} \
.
}