diff options
| author | mo khan <mo.khan@gmail.com> | 2020-05-28 12:44:01 -0600 |
|---|---|---|
| committer | mo khan <mo.khan@gmail.com> | 2020-05-29 00:57:47 -0600 |
| commit | a8d9eac2cbe0c7863fc43d04d4a5be1c239be681 (patch) | |
| tree | a4a431995d918b63e33d3dc5f1ad83fba00041a4 /lib | |
| parent | 0b976fcffe0a9b8e80587adb076bcdf279c9331c (diff) | |
Allow custom conan configuration
* Use git fetch with a depth of 1
* Control Conan environment via environment variables
* Allow specifying a custom CONAN_LOGIN_USERNAME and CONAN_PASSWORD
* Specify a default CONAN_CACERT_PATH to point the system cert file
* Tie CONAN_LOGGING_LEVEL to LOG_LEVEL
* Tag and skip offline environment tests because it was shutdown
* Add CHANGELOG entry
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/license/finder/ext/conan.rb | 21 | ||||
| -rw-r--r-- | lib/license/management/version.rb | 2 |
2 files changed, 18 insertions, 5 deletions
diff --git a/lib/license/finder/ext/conan.rb b/lib/license/finder/ext/conan.rb index 1369e6a..1336882 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,19 @@ module LicenseFinder def parse(line) JSON.parse(line) end + + def 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_USER_HOME' => ENV.fetch('CONAN_USER_HOME', Dir.pwd) + } + 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 |
