Commit 6f9978f9 authored by Georges Racinet's avatar Georges Racinet 🦑
Browse files

Fix the infamous ENOENT for /opt/gitlab/licenses/registry.csv

Until now, every few builds failed with ENOENT for the (apparently)
just copied /opt/gitlab/licenses/registry.csv

I finally went through the lengthy steps to reproduce, using an
actual cache zip from S3, and it turns
out that the ENOENT is due to the missing parent directory.

This never happens without the cache, probably because
an earlier step that creates this directory gets then always executed.

Ensuring the directory before hand as done in the CI configuration
was enough to fix the problem on the reproduction setup, but not in
CI, but the `mkdir` from `registry.rb` did fix it. We're keeping the
former one in case it would help with other cases of licenses aggregation.

--HG--
branch : heptapod-stable
parent 60e8e5159fd9
Pipeline #31170 passed with stages
in 46 minutes and 5 seconds
......@@ -44,5 +44,7 @@ build do
move "#{cwd}/bin/*", "#{install_dir}/embedded/bin", force: true
command "license_finder report --decisions-file=#{Omnibus::Config.project_root}/support/dependency_decisions.yml --format=csv --save=license.csv"
# According to https://rubydoc.info/github/chef/omnibus/Omnibus/Builder#mkdir-instance_method this is supposed to be the equivalent of /usr/bin/mkdir -p
mkdir install_dir + '/licenses'
copy "license.csv", "#{install_dir}/licenses/registry.csv"
end
......@@ -71,6 +71,7 @@ pkg-ubuntu-focal:
- bundle exec rake docker:build:prepare
- echo "Docker RELEASE file:"
- cat docker/RELEASE
- mkdir -p /opt/gitlab/licenses
- bundle exec rake build:project
- support/heptapod-push-packages.sh
- support/heptapod-save-cache.sh
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment