Docs: Remove pip install method from RTD config
[releng/global-jjb.git] / jjb / lf-whitesource-jobs.yaml
index 8967374..ed3a5d6 100644 (file)
@@ -1,12 +1,35 @@
 ---
-
 ##########
 # Macros #
 ##########
 
+- builder:
+    name: lf-infra-wss-mvn-clean-install
+    builders:
+      - inject:
+          properties-content: JAVA_OPTS={java-opts}
+      - conditional-step:
+          condition-kind: boolean-expression
+          condition-expression: "{mvn-clean-install}"
+          steps:
+            - maven-target:
+                maven-version: "{mvn-version}"
+                pom: "{mvn-pom}"
+                goals: "clean install"
+                settings: "{mvn-settings}"
+                settings-type: cfp
+                global-settings: "global-settings"
+                global-settings-type: cfp
+
 - builder:
     name: lf-infra-wss-unified-agent-scan
     builders:
+      - config-file-provider:
+          files:
+            - file-id: wss-unified-agent.config
+              target: $WORKSPACE/wss-unified-agent.config
+            - file-id: global-settings
+              target: $WORKSPACE/global-settings.xml
       - shell: !include-raw:
           - ../shell/whitesource-unified-agent-cli.sh
 
@@ -14,7 +37,7 @@
 # COMMON FUNCTIONS #
 ####################
 
-- lf_whitesource_common: &lf_whitesource_common
+- _lf_whitesource_common: &lf_whitesource_common
     name: lf-whitesource-common
 
     ######################
     #####################
 
     project-type: freestyle
-    node: '{build-node}'
+    node: "{build-node}"
 
     properties:
       - lf-infra-properties:
-          build-days-to-keep: '{build-days-to-keep}'
+          build-days-to-keep: "{build-days-to-keep}"
 
     parameters:
       - lf-infra-parameters:
-          project: '{project}'
-          branch: '{branch}'
-          stream: '{stream}'
+          project: "{project}"
+          branch: "{branch}"
+          stream: "{stream}"
 
     wrappers:
       - lf-infra-wrappers:
-          build-timeout: '{build-timeout}'
-          jenkins-ssh-credential: '{jenkins-ssh-credential}'
+          build-timeout: "{build-timeout}"
+          jenkins-ssh-credential: "{jenkins-ssh-credential}"
       - credentials-binding:
           - text:
               credential-id: wss-apiKey
@@ -57,7 +80,7 @@
 # WHITESOURCE UNIFIED AGENT SCAN #
 ##################################
 
-- lf_wss_unified_agent_scan: &lf_wss_unified_agent_scan
+- _lf_wss_unified_agent_scan: &lf_wss_unified_agent_scan
     name: lf-wss-unified-agent-scan
 
     ######################
     branch: master
     build-days-to-keep: 30
     build-timeout: 60
-    cron: '@daily'
+    cron: "H H * * 7"
     disable-job: false
-    git-url: '$GIT_URL/$PROJECT'
-    github-url: 'https://github.com'
-    java-version: openjdk8
+    git-url: "$GIT_URL/$PROJECT"
+    github-url: "https://github.com"
+    java-opts: ""
+    java-version: openjdk11
+    mvn-clean-install: false
+    mvn-global-settings: global-settings
+    mvn-pom: ""
+    mvn-version: mvn35
     stream: master
     submodule-recursive: true
     submodule-timeout: 10
-    wss-unified-agent-opts: ''
-    wss-unified-agent-version: 19.2.2.2
+    submodule-disable: false
+    wss-unified-agent-opts: ""
+    wss-unified-agent-version: 21.2.1
 
     gerrit_trigger_file_paths:
       - compare-type: ANT
-        pattern: '.*'
+        pattern: ".*"
 
     # github_included_regions MUST match gerrit_trigger_file_paths
     github_included_regions:
-      - '.*'
+      - ".*"
 
     #####################
     # Job Configuration #
     #####################
 
-    disabled: '{disable-job}'
+    disabled: "{disable-job}"
 
     parameters:
       - lf-infra-parameters:
-          project: '{project}'
-          branch: '{branch}'
-          stream: '{stream}'
+          project: "{project}"
+          branch: "{branch}"
+          stream: "{stream}"
       - string:
           name: WSS_PROJECT_NAME
-          default: '{project-name}'
+          default: "{project-name}"
           description: Project to asociate the WhiteSource report in the dashboard.
       - string:
           name: WSS_PRODUCT_NAME
-          default: '{wss-product-name}'
+          default: "{wss-product-name}"
           description: Product to asociate the WhiteSource report in the dashboard.
-      - string:
-          name: WSS_UNIFIED_AGENT_CONFIG
-          default: '{wss-unified-agent-config}'
-          description: Path to wss-unifed-agent.config
       - string:
           name: WSS_UNIFIED_AGENT_OPTIONS
-          default: '{wss-unified-agent-opts}'
+          default: "{wss-unified-agent-opts}"
           description: Options to pass to the WhiteSource Unified Agent CLI.
       - string:
           name: WSS_UNIFIED_AGENT_VERSION
-          default: '{wss-unified-agent-version}'
+          default: "{wss-unified-agent-version}"
           description: WhiteSource Unified Agent version package to download and use.
 
     builders:
       - lf-infra-pre-build
       - lf-update-java-alternatives:
-          java-version: '{java-version}'
+          java-version: "{java-version}"
+      - lf-infra-wss-mvn-clean-install:
+          java-opts: "{java-opts}"
+          mvn-clean-install: "{mvn-clean-install}"
+          mvn-version: "{mvn-version}"
+          mvn-pom: "{mvn-pom}"
+          mvn-settings: "{mvn-settings}"
       - lf-infra-wss-unified-agent-scan
 
 - job-template:
-    name: '{project-name}-whitesource-scan-{stream}'
+    name: "{project-name}-whitesource-scan-{stream}"
     id: gerrit-whitesource-scan
     <<: *lf_whitesource_common
     # yamllint disable-line rule:key-duplicates
 
     gerrit_wss_triggers:
       - comment-added-contains-event:
-          comment-contains-value: run-whitesource$
+          comment-contains-value: '^Patch Set\s+\d+:\s+(run-whitesource)\s*$'
 
     #####################
     # Job Configuration #
 
     scm:
       - lf-infra-gerrit-scm:
-          jenkins-ssh-credential: '{jenkins-ssh-credential}'
-          git-url: '{git-url}'
-          refspec: '$GERRIT_REFSPEC'
-          branch: '$GERRIT_BRANCH'
-          submodule-recursive: '{submodule-recursive}'
-          submodule-timeout: '{submodule-timeout}'
+          jenkins-ssh-credential: "{jenkins-ssh-credential}"
+          git-url: "{git-url}"
+          refspec: "$GERRIT_REFSPEC"
+          branch: "$GERRIT_BRANCH"
+          submodule-recursive: "{submodule-recursive}"
+          submodule-timeout: "{submodule-timeout}"
+          submodule-disable: "{submodule-disable}"
           choosing-strategy: default
 
     triggers:
       # Build weekly on Saturdays
-      - timed: '{obj:cron}'
+      - timed: "{obj:cron}"
       - gerrit:
-          server-name: '{gerrit-server-name}'
-          trigger-on: '{obj:gerrit_wss_triggers}'
+          server-name: "{gerrit-server-name}"
+          trigger-on: "{obj:gerrit_wss_triggers}"
           projects:
             - project-compare-type: ANT
-              project-pattern: '{project}'
+              project-pattern: "{project}"
               branches:
                 - branch-compare-type: ANT
-                  branch-pattern: '**/{branch}'
-              file-paths: '{obj:gerrit_trigger_file_paths}'
+                  branch-pattern: "**/{branch}"
+              file-paths: "{obj:gerrit_trigger_file_paths}"
           skip-vote:
             successful: true
             failed: true
             notbuilt: true
 
 - job-template:
-    name: '{project-name}-whitesource-scan-{stream}'
+    name: "{project-name}-whitesource-scan-{stream}"
     id: github-whitesource-scan
     <<: *lf_whitesource_common
     # yamllint disable-line rule:key-duplicates
 
     properties:
       - lf-infra-properties:
-          build-days-to-keep: '{build-days-to-keep}'
+          build-days-to-keep: "{build-days-to-keep}"
       - github:
-          url: '{github-url}/{github-org}/{project}'
+          url: "{github-url}/{github-org}/{project}"
 
     scm:
       - lf-infra-github-scm:
-          url: '{git-clone-url}{github-org}/{project}'
-          refspec: ''
-          branch: 'refs/heads/{branch}'
-          submodule-recursive: '{submodule-recursive}'
-          submodule-timeout: '{submodule-timeout}'
+          url: "{git-clone-url}{github-org}/{project}"
+          refspec: ""
+          branch: "refs/heads/{branch}"
+          submodule-recursive: "{submodule-recursive}"
+          submodule-timeout: "{submodule-timeout}"
+          submodule-disable: "{submodule-disable}"
           choosing-strategy: default
-          jenkins-ssh-credential: '{jenkins-ssh-credential}'
+          jenkins-ssh-credential: "{jenkins-ssh-credential}"
 
     triggers:
       # Build weekly on Saturdays
-      - timed: '{obj:cron}'
+      - timed: "{obj:cron}"
       - github-pull-request:
-          trigger-phrase: '^run-whitesource$'
+          trigger-phrase: "^run-whitesource$"
           only-trigger-phrase: false
-          status-context: 'WhiteSource'
+          status-context: "WhiteSource"
           permit-all: true
           github-hooks: true
           white-list-target-branches:
-            - '{branch}'
-          included-regions: '{obj:github_included_regions}'
+            - "{branch}"
+          included-regions: "{obj:github_included_regions}"