summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormo khan <mo.khan@gmail.com>2020-08-06 12:01:01 -0600
committermo khan <mo.khan@gmail.com>2020-08-06 12:01:01 -0600
commita1621bf89917c4159762ec8ae3635d5aff14f148 (patch)
treee1696a86848971c133ddb50e85c7e15412940380
parentdae67cdc5db97d87b90b76b3283b674edc052e16 (diff)
Package license management deb from deb job
-rw-r--r--.dockerignore1
-rw-r--r--.gitlab/deb.yml1
-rw-r--r--Dockerfile10
-rw-r--r--config/files/.bashrc1
-rw-r--r--config/files/.config/NuGet/NuGet.Config2
-rw-r--r--config/files/.gradle/init.gradle2
-rw-r--r--config/files/.m2/settings.xml2
-rw-r--r--config/install.sh1
-rw-r--r--lib/license/finder/ext/bundler.rb1
-rw-r--r--lib/license/management.rb2
-rw-r--r--spec/integration/dotnet/nuget_spec.rb4
-rw-r--r--spec/support/proxy_helper.rb1
12 files changed, 13 insertions, 15 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/Dockerfile b/Dockerfile
index 50ee6b7..dab3bff 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -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/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/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