From 814e57608e188af4bdb3faba00398d47057bab29 Mon Sep 17 00:00:00 2001 From: Pirate Praveen Date: Mon, 21 Jun 2021 23:46:45 +0530 Subject: [PATCH] Install grpc and google-protobuf before GEM_HOME is set --- debian/gitlab.postinst | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/debian/gitlab.postinst b/debian/gitlab.postinst index 6badff21bb..4d7beb77a4 100755 --- a/debian/gitlab.postinst +++ b/debian/gitlab.postinst @@ -37,6 +37,13 @@ test -f ${gitlab_common_defaults} && . ${gitlab_common_defaults} # installation fails and the `postinst' is called with `abort-upgrade', # `abort-remove' or `abort-deconfigure'. +# These gems should be installed as root for gitlab to find it +# Setting GEM_HOME seems not working for all cases, help welcome to fix it +# Workaround for #966653 +/usr/bin/gem install -v 1.30.2 grpc +# Workaround for #989774 +/usr/bin/gem install -v 3.17.1 google-protobuf + ####################################################################### # Read debian specific configuration ####################################################################### @@ -50,9 +57,6 @@ cp ${gitlab_debian_conf_example} ${gitlab_debian_conf_private} test -f ${gitlab_debian_conf} && . ${gitlab_debian_conf} export DB RAILS_ENV -# Required for embedded gems -export GEM_HOME=/var/lib/gitlab/.gem - # Read default values (we cannot do this before gitlab-debian.conf is exported # as we want to override variables set by gitlab-debian.conf in earlier gitlab # versions with gitlab-debian.defaults) @@ -61,10 +65,8 @@ export GEM_HOME=/var/lib/gitlab/.gem # Read gitlab_user from gitlab-common.conf test -f ${gitlab_common_conf} && . ${gitlab_common_conf} -# Workaround for #966653 -/usr/bin/gem install -v 1.30.2 grpc -# Workaround for #989774 -/usr/bin/gem install -v 3.17.1 google-protobuf +# Required for embedded gems +export GEM_HOME=/var/lib/gitlab/.gem ####################################################################### # update Gemfile.lock and yarn.lock, always