From 5527480b2919ee5f3bd5dfc1ff69188b81c52deb Mon Sep 17 00:00:00 2001 From: Martin Idel Date: Thu, 3 Dec 2020 10:21:02 +0100 Subject: [PATCH 1/2] Add configurable FossID server URL --- integrations/docker/docker-ort-run.yml | 1 + integrations/ocass-ortpipeline.yml | 7 +++++++ integrations/stages/complete-ort-run.yml | 2 ++ integrations/stages/scan.yml | 6 ++++++ 4 files changed, 16 insertions(+) diff --git a/integrations/docker/docker-ort-run.yml b/integrations/docker/docker-ort-run.yml index 872c4eec0e7cf..519985ea4cb4e 100644 --- a/integrations/docker/docker-ort-run.yml +++ b/integrations/docker/docker-ort-run.yml @@ -35,6 +35,7 @@ steps: -v $(System.DefaultWorkingDirectory)/package-managers/settings.xml:/root/.m2/settings.xml \ -v $(System.DefaultWorkingDirectory)/netrc/.netrc:/root/.netrc \ --env ort__scanner__storages__postgresStorage__password=$(DB_PASSWORD) \ + --env ort__scanner__options__FossId__serverUrl=$(fossidServerUrl) \ --env ort__scanner__options__FossId__apiKey=$(FOSSID_API_KEY) \ --env ort__advisor__nexusiq__password=$(NEXUS_IQ_PASSWORD) \ --env JAVA_OPTS='-Xmx12g' \ diff --git a/integrations/ocass-ortpipeline.yml b/integrations/ocass-ortpipeline.yml index 8f1dde41081dd..d447bfecc1b66 100644 --- a/integrations/ocass-ortpipeline.yml +++ b/integrations/ocass-ortpipeline.yml @@ -49,6 +49,12 @@ parameters: default: "ScanCode" values: ["ScanCode", "fossid"] + - name: fossid_server_url + type: string + displayName: "FossID Server to use when running FossId (otherwise ignore" + default: "none" + values: ["none", "https://rb-fossid.de.bosch.com/IO", "https://rb-fossid.de.bosch.com/EB/", "https://rb-fossid.de.bosch.com/test/"] + name: "${{parameters.project_name}} $(Date:yyyy-MM-dd) No $(Rev:.r)" variables: @@ -85,6 +91,7 @@ stages: allowDynamicVersions: ${{parameters.allow_dynamic_versions}} useClearlyDefined: ${{parameters.use_clearly_defined}} scanner: ${{parameters.scanner}} + fossidServerUrl: ${{parameters.fossid_server_url}} skipErrors: ${{parameters.skip_errors}} imageName: osmimages.azurecr.io/ort/ort imageTag: 'latest' diff --git a/integrations/stages/complete-ort-run.yml b/integrations/stages/complete-ort-run.yml index 9d445cf221caa..28a54b8b299df 100644 --- a/integrations/stages/complete-ort-run.yml +++ b/integrations/stages/complete-ort-run.yml @@ -39,6 +39,7 @@ parameters: type: string - name: scanner + - name: fossidServerUrl stages: - template: analyze.yml @@ -77,6 +78,7 @@ stages: imageTag: ${{parameters.imageTag}} dependsOn: advise_project scanner: ${{parameters.scanner}} + fossidServerUrl: ${{parameters.fossidServerUrl}} containerRegistryServiceConnection: ${{parameters.containerRegistryServiceConnection}} - template: evaluate.yml parameters: diff --git a/integrations/stages/scan.yml b/integrations/stages/scan.yml index cc793ebd825df..d99872ff34f33 100644 --- a/integrations/stages/scan.yml +++ b/integrations/stages/scan.yml @@ -36,6 +36,11 @@ parameters: type: string - name: scanner + type: string + default: "ScanCode" + - name: fossidServerUrl + type: string + default: "none" stages: - stage: scan_project @@ -49,6 +54,7 @@ stages: steps: - script: | echo '##vso[task.setvariable variable=scannerVar]-s ${{parameters.scanner}}' + echo '##vso[task.setvariable variable=fossidServerUrl]-s ${{parameters.fossidServerUrl}}' displayName: "Convert additional variables used in pipeline to CLI flags" - template: ../docker/docker-pull-image.yml parameters: From 1d703b37b13921894ccbe23ffa382dc8ed2bc539 Mon Sep 17 00:00:00 2001 From: Martin Idel Date: Thu, 3 Dec 2020 10:31:58 +0100 Subject: [PATCH 2/2] Use variable group --- integrations/docker/docker-ort-run.yml | 2 +- integrations/ocass-ortpipeline.yml | 14 ++++++++------ integrations/stages/complete-ort-run.yml | 2 -- integrations/stages/scan.yml | 4 ---- 4 files changed, 9 insertions(+), 13 deletions(-) diff --git a/integrations/docker/docker-ort-run.yml b/integrations/docker/docker-ort-run.yml index 519985ea4cb4e..dac358adb79bb 100644 --- a/integrations/docker/docker-ort-run.yml +++ b/integrations/docker/docker-ort-run.yml @@ -35,7 +35,7 @@ steps: -v $(System.DefaultWorkingDirectory)/package-managers/settings.xml:/root/.m2/settings.xml \ -v $(System.DefaultWorkingDirectory)/netrc/.netrc:/root/.netrc \ --env ort__scanner__storages__postgresStorage__password=$(DB_PASSWORD) \ - --env ort__scanner__options__FossId__serverUrl=$(fossidServerUrl) \ + --env ort__scanner__options__FossId__serverUrl=$(FOSSID_URL) \ --env ort__scanner__options__FossId__apiKey=$(FOSSID_API_KEY) \ --env ort__advisor__nexusiq__password=$(NEXUS_IQ_PASSWORD) \ --env JAVA_OPTS='-Xmx12g' \ diff --git a/integrations/ocass-ortpipeline.yml b/integrations/ocass-ortpipeline.yml index d447bfecc1b66..3aea2a4ca41e2 100644 --- a/integrations/ocass-ortpipeline.yml +++ b/integrations/ocass-ortpipeline.yml @@ -49,22 +49,25 @@ parameters: default: "ScanCode" values: ["ScanCode", "fossid"] - - name: fossid_server_url + - name: fossid_server type: string - displayName: "FossID Server to use when running FossId (otherwise ignore" - default: "none" - values: ["none", "https://rb-fossid.de.bosch.com/IO", "https://rb-fossid.de.bosch.com/EB/", "https://rb-fossid.de.bosch.com/test/"] + displayName: "FossID credentials variable group to use when running FossId (otherwise ignore)" + default: "fossid_credentials_test" + values: + - 'fossid_credentials_test' + - 'fossid_credentials_eb' + - 'fossid_credentials_io' name: "${{parameters.project_name}} $(Date:yyyy-MM-dd) No $(Rev:.r)" variables: - group: ${{parameters.use_credentials}} + - group: ${{parameters.fossid_server}} - group: 'ort_config_credentials' - group: 'ort_db_credentials' - group: 'ort_nexus_iq_credentials' - group: 'maven_settings' - group: 'npm_settings' - - group: 'fossid_credentials' resources: repositories: @@ -91,7 +94,6 @@ stages: allowDynamicVersions: ${{parameters.allow_dynamic_versions}} useClearlyDefined: ${{parameters.use_clearly_defined}} scanner: ${{parameters.scanner}} - fossidServerUrl: ${{parameters.fossid_server_url}} skipErrors: ${{parameters.skip_errors}} imageName: osmimages.azurecr.io/ort/ort imageTag: 'latest' diff --git a/integrations/stages/complete-ort-run.yml b/integrations/stages/complete-ort-run.yml index 28a54b8b299df..9d445cf221caa 100644 --- a/integrations/stages/complete-ort-run.yml +++ b/integrations/stages/complete-ort-run.yml @@ -39,7 +39,6 @@ parameters: type: string - name: scanner - - name: fossidServerUrl stages: - template: analyze.yml @@ -78,7 +77,6 @@ stages: imageTag: ${{parameters.imageTag}} dependsOn: advise_project scanner: ${{parameters.scanner}} - fossidServerUrl: ${{parameters.fossidServerUrl}} containerRegistryServiceConnection: ${{parameters.containerRegistryServiceConnection}} - template: evaluate.yml parameters: diff --git a/integrations/stages/scan.yml b/integrations/stages/scan.yml index d99872ff34f33..12118b78e5cb2 100644 --- a/integrations/stages/scan.yml +++ b/integrations/stages/scan.yml @@ -38,9 +38,6 @@ parameters: - name: scanner type: string default: "ScanCode" - - name: fossidServerUrl - type: string - default: "none" stages: - stage: scan_project @@ -54,7 +51,6 @@ stages: steps: - script: | echo '##vso[task.setvariable variable=scannerVar]-s ${{parameters.scanner}}' - echo '##vso[task.setvariable variable=fossidServerUrl]-s ${{parameters.fossidServerUrl}}' displayName: "Convert additional variables used in pipeline to CLI flags" - template: ../docker/docker-pull-image.yml parameters: