summaryrefslogtreecommitdiff
path: root/scripts/utils.sh
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-05-14 18:10:34 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2021-05-14 18:10:34 +0000
commit7d4b2ed7bf75d316577b718c71a9fdef19184539 (patch)
treed709e00c4f2ab60901749883f324f9069343037c /scripts/utils.sh
parent7172fb10313a9a7790f8e033b347e77df4987154 (diff)
downloadgitlab-ce-7d4b2ed7bf75d316577b718c71a9fdef19184539.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'scripts/utils.sh')
-rw-r--r--scripts/utils.sh26
1 files changed, 26 insertions, 0 deletions
diff --git a/scripts/utils.sh b/scripts/utils.sh
index 2e9839e4df8..d4436e1171d 100644
--- a/scripts/utils.sh
+++ b/scripts/utils.sh
@@ -13,6 +13,32 @@ function retry() {
return 1
}
+function bundle_install_script() {
+ local extra_install_args="${1}"
+
+ if [[ "${extra_install_args}" =~ "--without" ]]; then
+ echoerr "The '--without' flag shouldn't be passed as it would replace the default \${BUNDLE_WITHOUT} (currently set to '${BUNDLE_WITHOUT}')."
+ echoerr "Set the 'BUNDLE_WITHOUT' variable instead, e.g. '- export BUNDLE_WITHOUT=\"\${BUNDLE_WITHOUT}:any:other:group:not:to:install\"'."
+ exit 1;
+ fi;
+
+ bundle --version
+ bundle config set path 'vendor'
+ bundle config set clean 'true'
+
+ echo $BUNDLE_WITHOUT
+ bundle config
+
+ run_timed_command "bundle install ${BUNDLE_INSTALL_FLAGS} ${extra_install_args} && bundle check"
+
+ if [[ $(bundle info pg) ]]; then
+ # When we test multiple versions of PG in the same pipeline, we have a single `setup-test-env`
+ # job but the `pg` gem needs to be rebuilt since it includes extensions (https://guides.rubygems.org/gems-with-extensions).
+ # Uncomment the following line if multiple versions of PG are tested in the same pipeline.
+ run_timed_command "bundle pristine pg"
+ fi
+}
+
function setup_db_user_only() {
source scripts/create_postgres_user.sh
}