Commit 191185c4 authored by mo's avatar mo

Merge branch '273255-streaming' into 'main'

Stream `npm ci` output to log

See merge request !16
parents 1bc270fe 91f1671c
Pipeline #215580902 passed with stages
in 65 minutes and 16 seconds
# GitLab License management changelog
## v3.28.3
- Stream `npm ci` output to log. (https://gitlab.com/gitlab-org/security-products/analyzers/license-finder/-/merge_requests/16)
## v3.28.2
- Detect maven wrapper in nested directories. (https://gitlab.com/gitlab-org/security-products/analyzers/license-finder/-/merge_requests/15)
......
......@@ -8,7 +8,7 @@ GIT
PATH
remote: .
specs:
license-management (3.28.2)
license-management (3.28.3)
license_finder (~> 6.7)
spandx (~> 0.13)
......@@ -104,7 +104,7 @@ GEM
plist (~> 3.1)
systemu (~> 2.6.4)
wmi-lite (~> 1.0)
oj (3.10.14)
oj (3.10.15)
omnibus (7.0.13)
aws-sdk-s3 (~> 1)
chef-cleanroom (~> 1.0)
......@@ -202,7 +202,7 @@ GEM
with_env (1.1.0)
wmi-lite (1.0.5)
xml-simple (1.1.5)
zeitwerk (2.4.0)
zeitwerk (2.4.1)
zhexdump (0.0.2)
PLATFORMS
......
......@@ -17,7 +17,7 @@ module LicenseFinder
'--verbose',
'--loglevel',
:debug
], env: default_env)
], env: default_env, capture: false)
end
end
......
......@@ -11,16 +11,15 @@ module LicenseFinder
shell.execute([
:gem, :install, gem,
'--no-document',
'--verbose',
'--no-update-sources',
'--ignore-dependencies',
'--no-suggestions',
'--local'
], env: default_env)
], env: default_env, capture: false)
end
shell.execute([:asdf, :reshim], env: default_env)
shell.execute([:bundle, :config, '--local', :path, vendor_path], env: default_env)
shell.execute([:bundle, :install, '--verbose'], env: default_env)
shell.execute([:asdf, :reshim], env: default_env, capture: false)
shell.execute([:bundle, :config, '--local', :path, vendor_path], env: default_env, capture: false)
shell.execute([:bundle, :install], env: default_env, capture: false)
end
end
......
......@@ -13,7 +13,7 @@ module LicenseFinder
within_project_path do
tool_box.install(tool: :rust)
shell.execute([:cargo, :fetch, '-vv'], env: default_env)
shell.execute([:cargo, :fetch, '-vv'], env: default_env, capture: false)
end
end
......
......@@ -17,7 +17,7 @@ module LicenseFinder
'--no-progress',
'--no-scripts',
'--verbose'
], env: default_env)
], env: default_env, capture: false)
end
end
......
......@@ -9,8 +9,8 @@ module LicenseFinder
def prepare
within_project_path do
tool_box.install(tool: :python)
shell.execute([:conan, :install, '--build=missing', '.'], env: default_env)
shell.execute([:conan, :inspect, '.'], env: default_env)
shell.execute([:conan, :install, '--build=missing', '.'], env: default_env, capture: false)
shell.execute([:conan, :inspect, '.'], env: default_env, capture: false)
end
end
......
......@@ -24,7 +24,7 @@ module LicenseFinder
'--no-cache',
'--packages', vendor_path,
'--verbosity', :normal
])
], capture: false)
end
def current_packages
......
......@@ -10,7 +10,7 @@ module LicenseFinder
within_project_path do
tool_box.install(tool: :golang)
shell.execute([:go, :mod, :download, '-json'])
shell.execute([:go, :mod, :download, '-json'], capture: false)
end
end
......
......@@ -13,7 +13,7 @@ module LicenseFinder
if lockfile?
shell.execute([:npm, :ci, "--production"], env: default_env, capture: false)
else
shell.execute([:npm, :install, '--no-save', "--production"], env: default_env)
shell.execute([:npm, :install, '--no-save', "--production"], env: default_env, capture: false)
end
end
end
......@@ -32,7 +32,7 @@ module LicenseFinder
def npm_json
stdout, _stderr, status = within_project_path do
shell.execute("npm list --json --long --production")
shell.execute([:npm, "list", "--json", "--long", "--production"])
end
status.success? ? JSON.parse(stdout) : {}
end
......
......@@ -7,7 +7,7 @@ module LicenseFinder
within_project_path do
tool_box.install(tool: :mono)
shell.execute([:cert_sync, shell.default_certificate_path])
shell.execute([:cert_sync, shell.default_certificate_path], capture: false)
shell.execute([
:mono,
:nuget,
......@@ -16,7 +16,7 @@ module LicenseFinder
'-NoCache',
'-PackagesDirectory', vendor_path,
'-Verbosity', :normal
])
], capture: false)
end
end
......
......@@ -19,7 +19,7 @@ module LicenseFinder
return unless prepare_command
within_project_path do
shell.execute(prepare_command)
shell.execute(prepare_command, capture: false)
end
end
......@@ -39,7 +39,7 @@ module LicenseFinder
end
def create_vendor_path
shell.execute([:mkdir, '-p', vendor_path]) unless vendor_path.exist?
shell.execute([:mkdir, '-p', vendor_path], capture: false) unless vendor_path.exist?
end
def within_project_path
......
......@@ -8,8 +8,8 @@ module LicenseFinder
return unless pipfile?
tool_box.install(tool: :python, version: python_version, env: default_env)
shell.execute([:asdf, :exec, :pipenv, '--python', python_version], env: default_env)
shell.execute([:asdf, :exec, :pipenv, :sync], env: default_env)
shell.execute([:asdf, :exec, :pipenv, '--python', python_version], env: default_env, capture: false)
shell.execute([:asdf, :exec, :pipenv, :sync], env: default_env, capture: false)
end
end
......
......@@ -16,7 +16,7 @@ module LicenseFinder
:yarn, :install,
'--ignore-engines', '--ignore-scripts',
'--production'
], env: default_env)
], env: default_env, capture: false)
end
end
......
......@@ -16,6 +16,7 @@ module License
keytool: '/opt/asdf/bin/asdf exec keytool',
mono: '/opt/asdf/installs/mono/6.8.0.123/bin/mono',
mvn: '/opt/asdf/bin/asdf exec mvn',
npm: '/opt/asdf/bin/asdf exec npm',
nuget: '/opt/asdf/installs/mono/6.8.0.123/bin/nuget.exe',
pip: '/opt/asdf/bin/asdf exec pip',
ruby: '/opt/asdf/bin/asdf exec ruby',
......@@ -64,15 +65,15 @@ module License
def trust!(certificate)
custom_certificate_path.write(certificate)
Dir.chdir custom_certificate_path.dirname do
execute([:awk, SPLIT_SCRIPT, '<', custom_certificate_path])
execute('update-ca-certificates -v')
execute([:awk, SPLIT_SCRIPT, '<', custom_certificate_path], capture: false)
execute('update-ca-certificates -v', capture: false)
Dir.glob('custom.*.crt').each do |path|
execute([:openssl, :x509, '-in', File.expand_path(path), '-text', '-noout'])
execute([:openssl, :x509, '-in', File.expand_path(path), '-text', '-noout'], capture: false)
end
end
execute([:cp, custom_certificate_path.to_s, "/usr/lib/ssl/certs/"])
execute([:c_rehash, '-v'])
execute([:cp, custom_certificate_path.to_s, "/usr/lib/ssl/certs/"], capture: false)
execute([:c_rehash, '-v'], capture: false)
end
def present?(item)
......
......@@ -16,17 +16,15 @@ module License
Dir.chdir(project_path) do
deb = deb_for(tool, version)
if deb&.exist?
::License::Management.logger.error("Installing #{deb} ...")
shell.execute([:dpkg, '-i', deb], capture: false)
else
::License::Management.logger.error("Installing #{version} via asdf ...")
shell.execute([:asdf, "plugin-update", tool.to_s], env: env)
shell.execute(['/opt/asdf/plugins/nodejs/bin/import-release-team-keyring']) if tool == :nodejs
shell.execute([:asdf, "plugin-update", tool.to_s], env: env, capture: false)
shell.execute(['/opt/asdf/plugins/nodejs/bin/import-release-team-keyring'], capture: false) if tool == :nodejs
end
install_common_libraries(env: env) if C_BASED_TOOLS.include?(tool.to_sym)
shell.execute([:asdf, :install, tool.to_s, version], env: env, capture: false)
shell.execute([:asdf, :local, tool.to_s, version], env: env)
shell.execute([:asdf, :reshim], env: env)
shell.execute([:asdf, :local, tool.to_s, version], env: env, capture: false)
shell.execute([:asdf, :reshim], env: env, capture: false)
end
install_certificates_into_java_keystore(env, version) if tool == :java
end
......@@ -56,8 +54,8 @@ module License
Dir.chdir(project_path) do
return unless deb_for(tool, version)&.exist?
shell.execute([:dpkg, '-r', "#{tool}-#{version}"])
shell.execute([:asdf, :reshim])
shell.execute([:dpkg, '-r', "#{tool}-#{version}"], capture: false)
shell.execute([:asdf, :reshim], capture: false)
end
end
......@@ -124,8 +122,8 @@ module License
Dir.chdir shell.custom_certificate_path.dirname do
Dir.glob('custom.*.crt').each do |path|
shell.execute([:keytool, '-importcert', '-alias', Time.now.to_i, '-file', File.expand_path(path), '-trustcacerts', '-noprompt', '-storepass', 'changeit', '-keystore', keystore_path], env: env)
shell.execute([:keytool, '-list', '-v', '-storepass changeit', '-keystore', keystore_path], env: env)
shell.execute([:keytool, '-importcert', '-alias', Time.now.to_i, '-file', File.expand_path(path), '-trustcacerts', '-noprompt', '-storepass', 'changeit', '-keystore', keystore_path], env: env, capture: false)
shell.execute([:keytool, '-list', '-v', '-storepass changeit', '-keystore', keystore_path], env: env, capture: false)
end
end
end
......
......@@ -2,6 +2,6 @@
module License
module Management
VERSION = '3.28.2'
VERSION = '3.28.3'
end
end
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