diff options
Diffstat (limited to 'lib/license')
| -rw-r--r-- | lib/license/finder/ext/conan.rb | 27 | ||||
| -rw-r--r-- | lib/license/management/version.rb | 2 |
2 files changed, 24 insertions, 5 deletions
diff --git a/lib/license/finder/ext/conan.rb b/lib/license/finder/ext/conan.rb index 1369e6a..ca2ee03 100644 --- a/lib/license/finder/ext/conan.rb +++ b/lib/license/finder/ext/conan.rb @@ -7,11 +7,10 @@ module LicenseFinder end def current_packages - Dir.chdir(project_path) do - shell.execute([:conan, :install, '.']) - end stdout, _stderr, status = Dir.chdir(project_path) do - shell.execute([:conan, :info, '-j', '/dev/stdout', '.']) + shell.execute([:conan, :install, '--build=missing', '.'], env: default_env) + shell.execute([:conan, :inspect, '.'], env: default_env) + shell.execute([:conan, :info, '-j', '/dev/stdout', '.'], env: default_env) end return [] unless status.success? @@ -38,5 +37,25 @@ module LicenseFinder def parse(line) JSON.parse(line) end + + def default_env + @default_env ||= { + 'CONAN_CACERT_PATH' => ENV.fetch('CONAN_CACERT_PATH', '/etc/ssl/certs/ca-certificates.crt'), + 'CONAN_LOGGING_LEVEL' => ENV['LOG_LEVEL'], + 'CONAN_LOGIN_USERNAME' => ENV.fetch('CONAN_LOGIN_USERNAME', 'ci_user'), + 'CONAN_LOG_RUN_TO_OUTPUT' => '1', + 'CONAN_NON_INTERACTIVE' => '1', + 'CONAN_PASSWORD' => ENV.fetch('CONAN_PASSWORD', ENV['CI_JOB_TOKEN']), + 'CONAN_PRINT_RUN_COMMANDS' => '1', + 'CONAN_REQUEST_TIMEOUT' => '5', + 'CONAN_RETRY' => '1', + 'CONAN_RETRY_WAIT' => jitter, + 'CONAN_USER_HOME' => Dir.pwd + } + end + + def jitter + rand(5).to_s + end end end diff --git a/lib/license/management/version.rb b/lib/license/management/version.rb index 595ee3a..e53a751 100644 --- a/lib/license/management/version.rb +++ b/lib/license/management/version.rb @@ -2,6 +2,6 @@ module License module Management - VERSION = '3.10.0' + VERSION = '3.11.0' end end |
