diff --git a/.tool-versions b/.tool-versions index b7e6a9df318745195a986e8cb4b4bc02662ed73c..c2cbdcf32b3b44f11c6f098d6b2cc39344a4d166 100644 --- a/.tool-versions +++ b/.tool-versions @@ -36,7 +36,7 @@ postgres 14.9 13.12 redis 7.0.14 # ruby: -# 3.2.2: +# 3.2.3: # - .tool-versions-gdk # ruby 3.2.3 diff --git a/Makefile b/Makefile index fd35e253bd35e08ed44806cb6d5c3e7046fceb2e..fe7b52b8f8b96c69dcd6fe42de8026ed92fabf2d 100644 --- a/Makefile +++ b/Makefile @@ -126,15 +126,15 @@ install: start-task all post-install-task start # Pull `gitlab` directory first, since its dependencies are linked from there. .PHONY: update update: start-task \ +gitlab/.git/pull \ +gitlab-update \ platform-update \ preflight-checks \ preflight-update-checks \ gitaly-update \ ensure-databases-setup \ -gitlab/.git/pull \ gitlab-shell-update \ unlock-dependency-installers \ -gitlab-update \ gitlab-docs-update \ gitlab-elasticsearch-indexer-update \ gitlab-k8s-agent-update \ diff --git a/support/bootstrap-common.sh b/support/bootstrap-common.sh index e8fc2676d587cd301c0249c9f23d95d40aea9b38..4d992b90fb3f3f23a28910385d01c436ddf1fcdd 100644 --- a/support/bootstrap-common.sh +++ b/support/bootstrap-common.sh @@ -240,6 +240,8 @@ configure_ruby_bundler_for_gitlab() { ( cd "${ROOT_PATH}/gitlab" || return 0 + bundle config --local set without 'production' + if asdf_command_enabled "pg_config"; then current_pg_config_location=$(asdf which pg_config) else diff --git a/support/bundle-install b/support/bundle-install index 442b44c5fcd33c258e107f2ad5fd0f40ef9e155b..eaf582963882cc5e88bfd217e09a08122f260001 100755 --- a/support/bundle-install +++ b/support/bundle-install @@ -8,7 +8,7 @@ ROOT_PATH="$(cd "$(dirname "${BASH_SOURCE[${#BASH_SOURCE[@]} - 1]}")/.." || exit GDK_QUIET="${GDK_QUIET:-false}" DIR_TO_PROCESS="${1:-.}" ASDF_AVAILABLE="$("${ROOT_PATH}"/bin/gdk config get asdf.__available\?)" -ASDF_RUBY_VERSION="$(grep -E '^ruby ' "${ROOT_PATH}/.tool-versions" | awk '{ print $2 }')" +ASDF_RUBY_VERSION="$(grep -E '^ruby ' "${DIR_TO_PROCESS}/.tool-versions" | awk '{ print $2 }')" ensure_bundler_version_installed() { local gem_install_args= diff --git a/support/makefiles/Makefile.gitlab.mk b/support/makefiles/Makefile.gitlab.mk index d422b7636cda6e675ee8c0428f324478f84f3ed8..710e4f6e211927d33ae692a980a9ec0b19268364 100644 --- a/support/makefiles/Makefile.gitlab.mk +++ b/support/makefiles/Makefile.gitlab.mk @@ -2,9 +2,17 @@ gitlab_dir = ${gitlab_development_root}/gitlab gitlab_rake_cmd = $(in_gitlab) ${support_bundle_exec} rake gitlab_git_cmd = git -C $(gitlab_dir) in_gitlab = cd $(gitlab_dir) && -bundle_without_production_cmd = ${BUNDLE} config --local set without 'production' default_branch ?= $(if $(gitlab_default_branch),$(gitlab_default_branch),master) +ASDF_RUBY_VERSION := $(shell grep -E '^ruby ' "${gitlab_dir}/.tool-versions" | awk '{ print $$2 }') +RUBY_BIN_PATH := ${HOME}/.asdf/installs/ruby/${ASDF_RUBY_VERSION}/bin + +ifeq ($(asdf_opt_out),false) + ifeq (,$(findstring ${RUBY_BIN_PATH},${PATH})) + export PATH := ${RUBY_BIN_PATH}:${PATH} + endif +endif + gitlab-setup: gitlab/.git gitlab-config gitlab-asdf-install .gitlab-bundle .gitlab-gdk-gem .gitlab-lefthook .gitlab-yarn .gitlab-translations .PHONY: gitlab-update @@ -87,7 +95,6 @@ gitlab-bundle-prepare: @echo "${DIVIDER}" @echo "Setting up Ruby bundler" @echo "${DIVIDER}" - $(Q)$(in_gitlab) $(bundle_without_production_cmd) ${QQ} ${Q}. ./support/bootstrap-common.sh ; configure_ruby_bundler_for_gitlab .gitlab-bundle: gitlab-bundle-prepare