Workaround gem build path bug
What does this MR do?
There seems to be a problem when gems are built from a different path than the gemspec file. That bug is reported in https://github.com/rubygems/rubygems/issues/2587
In our case it meant trying to build a gem from source fails because it looks for the files to include in the working directory instead of the gemspec directory, so the executable doesn't get installed.
Successfully installed gitlab-qa-7.29.1
27 gems installed
$ echo "Running - 'gitlab-qa $QA_SCENARIO $RELEASE'"
Running - 'gitlab-qa Test::Sanity::Version EE'
$ gitlab-qa $QA_SCENARIO $RELEASE
/bin/bash: line 192: gitlab-qa: command not found
Ultimately that bug is fixed in https://github.com/rubygems/rubygems/pull/3983 but seems to require the use of the -C
flag, and a later version of rubygems than the one that comes with ruby 2.7
One option would be to update rubygems, but this MR takes the boring option of changing directories
Check-list
Tested in https://gitlab.com/gitlab-org/quality/nightly/-/merge_requests/110
Successfully installed gitlab-qa-7.29.1
27 gems installed
$ echo "Running - 'gitlab-qa $QA_SCENARIO $RELEASE'"
Running - 'gitlab-qa Test::Sanity::Version EE'
$ gitlab-qa $QA_SCENARIO $RELEASE
[date=2022-06-01 04:26:05 +0000 from=Gitlab QA] DEBUG -- Skipping starting telegraf container!
-
Verify the change in all affected pipelines.
Edited by Mark Lapierre