diff options
| author | Can Eldem <celdem@gitlab.com> | 2020-08-07 12:51:11 +0000 |
|---|---|---|
| committer | Can Eldem <celdem@gitlab.com> | 2020-08-07 12:51:11 +0000 |
| commit | 71e548e24191f9afe53f5679906d464b24c5c985 (patch) | |
| tree | f738829459a032079cf3afab3cc6cde895812c7c | |
| parent | dae67cdc5db97d87b90b76b3283b674edc052e16 (diff) | |
| parent | a89906bb5f31fd2cbc7762aaaa8f4d9955568c48 (diff) | |
Merge branch '217904-deb-docker' into 'master'v3.20.1
Package license management deb from deb job
See merge request gitlab-org/security-products/license-management!203
| -rw-r--r-- | .dockerignore | 1 | ||||
| -rw-r--r-- | .gitlab/deb.yml | 1 | ||||
| -rw-r--r-- | CHANGELOG.md | 5 | ||||
| -rw-r--r-- | Dockerfile | 10 | ||||
| -rw-r--r-- | Gemfile.lock | 2 | ||||
| -rw-r--r-- | config/files/.bashrc | 1 | ||||
| -rw-r--r-- | config/files/.config/NuGet/NuGet.Config | 2 | ||||
| -rw-r--r-- | config/files/.gradle/init.gradle | 2 | ||||
| -rw-r--r-- | config/files/.m2/settings.xml | 2 | ||||
| -rw-r--r-- | config/install.sh | 1 | ||||
| -rw-r--r-- | lib/license/finder/ext/bundler.rb | 1 | ||||
| -rw-r--r-- | lib/license/management.rb | 2 | ||||
| -rw-r--r-- | lib/license/management/version.rb | 2 | ||||
| -rw-r--r-- | spec/integration/dotnet/nuget_spec.rb | 4 | ||||
| -rw-r--r-- | spec/support/proxy_helper.rb | 1 |
15 files changed, 20 insertions, 17 deletions
diff --git a/.dockerignore b/.dockerignore index 26c9de0..3cbd10c 100644 --- a/.dockerignore +++ b/.dockerignore @@ -2,7 +2,6 @@ coverage Dockerfile .dockerignore .git* -pkg spec tags tmp diff --git a/.gitlab/deb.yml b/.gitlab/deb.yml index 89708f4..9a6652d 100644 --- a/.gitlab/deb.yml +++ b/.gitlab/deb.yml @@ -28,6 +28,7 @@ gem: extends: .deb variables: OMNIBUS_PROJECT: license_management + allow_failure: false golang-1-14: extends: .deb diff --git a/CHANGELOG.md b/CHANGELOG.md index 0933d60..05f56bf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # GitLab License management changelog +## v3.20.1 + +- Ensure that error messages are converted to strings before writing to the log. (!203) +- Do not reconfigure bundler from the scanners ruby process. (!203) + ## v3.20.0 - Fallback to parsing the `composer.lock` file when it is present (!200) @@ -1,12 +1,4 @@ # syntax = docker/dockerfile:experimental -FROM debian:stable AS gem-builder -WORKDIR /build -COPY . ./ -RUN ./bin/omnibus setup && \ - ./bin/omnibus build license_management && \ - mkdir -p /opt/toolcache && \ - cp pkg/*.deb /opt/toolcache/ - FROM debian:stable AS mono-builder RUN apt-get update -q RUN apt-get install --no-install-recommends -y apt-transport-https dirmngr gnupg ca-certificates @@ -24,8 +16,8 @@ ENV TERM="xterm" WORKDIR /opt/gitlab COPY config/01_nodoc /etc/dpkg/dpkg.cfg.d/01_nodoc RUN mkdir -p /opt/toolcache -COPY --from=gem-builder /opt/toolcache/*.deb /opt/toolcache/ COPY --from=mono-builder /opt/toolcache/*.deb /opt/toolcache/mono/ +COPY pkg/license*.deb /opt/toolcache/ COPY config/install.sh /opt/install.sh RUN bash /opt/install.sh COPY run.sh / diff --git a/Gemfile.lock b/Gemfile.lock index 6290ce0..7356717 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -8,7 +8,7 @@ GIT PATH remote: . specs: - license-management (3.20.0) + license-management (3.20.1) license_finder (~> 6.6.0) GEM diff --git a/config/files/.bashrc b/config/files/.bashrc index 388f93d..fa70e9c 100644 --- a/config/files/.bashrc +++ b/config/files/.bashrc @@ -71,6 +71,7 @@ inflate /usr/lib/gcc.tar.zst /usr/lib inflate /usr/lib/git-core.tar.zst /usr/lib inflate /usr/lib/llvm-7.tar.zst /usr/lib inflate /usr/lib/rustlib.tar.zst /usr/lib +inflate /usr/share.tar.zst /usr # shellcheck source=/dev/null . "$ASDF_DATA_DIR/asdf.sh" diff --git a/config/files/.config/NuGet/NuGet.Config b/config/files/.config/NuGet/NuGet.Config index 449478c..48a1fd4 100644 --- a/config/files/.config/NuGet/NuGet.Config +++ b/config/files/.config/NuGet/NuGet.Config @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8"?> <configuration> <config> - <add key="repositoryPath" value="/root/.nuget/packages" /> + <add key="repositoryPath" value="/opt/gitlab/.nuget/packages" /> </config> <packageSources> <add key="nuget.org" value="https://api.nuget.org/v3/index.json" /> diff --git a/config/files/.gradle/init.gradle b/config/files/.gradle/init.gradle index b8cc7f1..1a27cde 100644 --- a/config/files/.gradle/init.gradle +++ b/config/files/.gradle/init.gradle @@ -1,6 +1,6 @@ initscript { repositories { - maven { url uri('/root/.m2/repository') } + maven { url uri('/opt/gitlab/.m2/repository') } maven { url "https://plugins.gradle.org/m2" } } dependencies { diff --git a/config/files/.m2/settings.xml b/config/files/.m2/settings.xml index 9a89d90..34844ad 100644 --- a/config/files/.m2/settings.xml +++ b/config/files/.m2/settings.xml @@ -1,5 +1,5 @@ <settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 https://maven.apache.org/xsd/settings-1.0.0.xsd"> - <localRepository>${user.home}/.m2/repository</localRepository> + <localRepository>/opt/gitlab/.m2/repository</localRepository> <interactiveMode>false</interactiveMode> <offline>false</offline> <profiles> diff --git a/config/install.sh b/config/install.sh index 8d555c4..62a64fd 100644 --- a/config/install.sh +++ b/config/install.sh @@ -190,6 +190,7 @@ tar --use-compress-program "$zstd_command" -cf /opt/gitlab/embedded.tar.zst embe cd /usr tar --use-compress-program "$zstd_command" -cf /usr/include.tar.zst include & +tar --use-compress-program "$zstd_command" -cf /usr/share.tar.zst share & cd /usr/lib tar --use-compress-program "$zstd_command" -cf /usr/lib/elixir.tar.zst elixir & diff --git a/lib/license/finder/ext/bundler.rb b/lib/license/finder/ext/bundler.rb index 7d3fe30..0530f32 100644 --- a/lib/license/finder/ext/bundler.rb +++ b/lib/license/finder/ext/bundler.rb @@ -83,7 +83,6 @@ module LicenseFinder Dir.chdir(project_path) do ::Gem.clear_paths ::Bundler.reset! - ::Bundler.configure if ::Bundler.respond_to?(:with_unbundled_env) ::Bundler.with_unbundled_env { yield } else diff --git a/lib/license/management.rb b/lib/license/management.rb index 0824157..41885d5 100644 --- a/lib/license/management.rb +++ b/lib/license/management.rb @@ -26,7 +26,7 @@ module License def self.logger @logger ||= Logger.new(STDOUT, level: ENV.fetch('LOG_LEVEL', Logger::WARN)).tap do |x| x.formatter = proc do |_severity, _datetime, _progname, message| - prefix = message.start_with?("\n") ? "" : "[v#{VERSION}] " + prefix = message.to_s.start_with?("\n") ? "" : "[v#{VERSION}] " "#{prefix}#{message}\n" end end diff --git a/lib/license/management/version.rb b/lib/license/management/version.rb index ac8abbd..9e5f556 100644 --- a/lib/license/management/version.rb +++ b/lib/license/management/version.rb @@ -2,6 +2,6 @@ module License module Management - VERSION = '3.20.0' + VERSION = '3.20.1' end end diff --git a/spec/integration/dotnet/nuget_spec.rb b/spec/integration/dotnet/nuget_spec.rb index 1d9a62c..90a189b 100644 --- a/spec/integration/dotnet/nuget_spec.rb +++ b/spec/integration/dotnet/nuget_spec.rb @@ -1,6 +1,10 @@ require 'spec_helper' RSpec.describe "nuget" do + before do + system("rm -fr /opt/gitlab/.nuget/packages") + end + include_examples "each report version", "csharp", "nuget-dotnetcore" context "when a project has a nuget packages.config file in the root" do diff --git a/spec/support/proxy_helper.rb b/spec/support/proxy_helper.rb index 9b42e18..9ad0dde 100644 --- a/spec/support/proxy_helper.rb +++ b/spec/support/proxy_helper.rb @@ -39,5 +39,6 @@ RSpec.configure do |config| system("rm -f /usr/lib/ssl/certs/custom.*") system("update-ca-certificates -v") system("c_rehash -v") + system("cert_sync /etc/ssl/certs/ca-certificates.crt") end end |
