From fd46fc522f14a5af3f4fe8ef4be6aac9c6ee427b Mon Sep 17 00:00:00 2001 From: Eric Ball Date: Fri, 26 Mar 2021 10:32:41 -0700 Subject: [PATCH 1/1] Add script to update nodejs for Sonarcloud scans Some projects have been seeing failures in Sonarcloud scans, as they are no longer compatible with Node --- global-jjb | 2 +- jjb/externalapi/externalapi-nbi.yaml | 3 ++- jjb/policy/policy-gui.yaml | 3 ++- jjb/portal-sdk/portal-sdk.yaml | 3 ++- jjb/portal/portal.yaml | 3 ++- jjb/ubuntu-latest-nodejs.sh | 18 ++++++++++++++++++ jjb/vid/vid.yaml | 3 ++- 7 files changed, 29 insertions(+), 6 deletions(-) create mode 100644 jjb/ubuntu-latest-nodejs.sh diff --git a/global-jjb b/global-jjb index eb2415e34..c8b9acd16 160000 --- a/global-jjb +++ b/global-jjb @@ -1 +1 @@ -Subproject commit eb2415e3459abd8e3f3dbad90cddc1b03b14b92a +Subproject commit c8b9acd166fcbd88139a65f7721e522980a0e013 diff --git a/jjb/externalapi/externalapi-nbi.yaml b/jjb/externalapi/externalapi-nbi.yaml index 7620cca0c..6bda3cba0 100644 --- a/jjb/externalapi/externalapi-nbi.yaml +++ b/jjb/externalapi/externalapi-nbi.yaml @@ -67,7 +67,7 @@ - project: name: externalapi-nbi-sonar jobs: - - gerrit-maven-sonar + - gerrit-maven-sonar-prescan-script sonarcloud: true sonarcloud-project-organization: '{sonarcloud_project_organization}' sonarcloud-api-token: '{sonarcloud_api_token}' @@ -82,6 +82,7 @@ mvn-goals: 'clean install' mvn-opts: '-Xmx1024m -XX:MaxPermSize=256m' java-version: openjdk11 + sonar-prescan-script: !include-raw-escape: ../ubuntu-latest-nodejs.sh - project: name: externalapi-nbi-info diff --git a/jjb/policy/policy-gui.yaml b/jjb/policy/policy-gui.yaml index 862c04031..43f096649 100644 --- a/jjb/policy/policy-gui.yaml +++ b/jjb/policy/policy-gui.yaml @@ -36,7 +36,7 @@ - project: name: policy-gui-sonar jobs: - - gerrit-maven-sonar + - gerrit-maven-sonar-prescan-script sonarcloud: true sonarcloud-project-organization: '{sonarcloud_project_organization}' sonarcloud-api-token: '{sonarcloud_api_token}' @@ -51,6 +51,7 @@ java-version: openjdk11 mvn-goals: 'clean install' mvn-opts: '-Xmx1024m -XX:MaxPermSize=256m' + sonar-prescan-script: !include-raw-escape: ../ubuntu-latest-nodejs.sh - project: name: policy-gui-clm diff --git a/jjb/portal-sdk/portal-sdk.yaml b/jjb/portal-sdk/portal-sdk.yaml index 0c54744ff..86b4e69c8 100644 --- a/jjb/portal-sdk/portal-sdk.yaml +++ b/jjb/portal-sdk/portal-sdk.yaml @@ -34,7 +34,7 @@ - project: name: portal-sdk-sonar jobs: - - gerrit-maven-sonar + - gerrit-maven-sonar-prescan-script sonarcloud: true sonarcloud-project-organization: '{sonarcloud_project_organization}' sonarcloud-api-token: '{sonarcloud_api_token}' @@ -49,6 +49,7 @@ mvn-settings: 'portal-settings' mvn-goals: 'clean install' mvn-opts: '-Xmx1024m -XX:MaxPermSize=256m' + sonar-prescan-script: !include-raw-escape: ../ubuntu-latest-nodejs.sh - project: name: portal-sdk-clm diff --git a/jjb/portal/portal.yaml b/jjb/portal/portal.yaml index 2a6d6e5a0..ec3377276 100644 --- a/jjb/portal/portal.yaml +++ b/jjb/portal/portal.yaml @@ -31,7 +31,7 @@ - project: name: portal-sonar jobs: - - gerrit-maven-sonar + - gerrit-maven-sonar-prescan-script sonarcloud: true sonarcloud-project-organization: '{sonarcloud_project_organization}' sonarcloud-api-token: '{sonarcloud_api_token}' @@ -45,6 +45,7 @@ mvn-settings: 'portal-settings' mvn-goals: 'clean install' mvn-opts: '-Xmx1024m -XX:MaxPermSize=256m' + sonar-prescan-script: !include-raw-escape: ../ubuntu-latest-nodejs.sh - project: name: 'portal-coverity' diff --git a/jjb/ubuntu-latest-nodejs.sh b/jjb/ubuntu-latest-nodejs.sh new file mode 100644 index 000000000..04e3a10fb --- /dev/null +++ b/jjb/ubuntu-latest-nodejs.sh @@ -0,0 +1,18 @@ +#!/bin/bash +# SPDX-License-Identifier: EPL-1.0 +############################################################################## +# Copyright (c) 2021 The Linux Foundation and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +############################################################################## +echo "---> ubuntu-latest-nodejs.sh" + +set -eufo pipefail + +sudo apt update +sudo apt install -y nodejs npm +sudo npm install -g n +sudo n stable diff --git a/jjb/vid/vid.yaml b/jjb/vid/vid.yaml index ad118a866..748bb5e16 100644 --- a/jjb/vid/vid.yaml +++ b/jjb/vid/vid.yaml @@ -53,7 +53,7 @@ - project: name: vid-sonar jobs: - - gerrit-maven-sonar + - gerrit-maven-sonar-prescan-script sonarcloud: true sonarcloud-project-organization: '{sonarcloud_project_organization}' sonarcloud-api-token: '{sonarcloud_api_token}' @@ -67,6 +67,7 @@ mvn-settings: 'vid-settings' mvn-goals: 'clean install' mvn-opts: '-Xmx1024m -XX:MaxPermSize=256m' + sonar-prescan-script: !include-raw-escape: ../ubuntu-latest-nodejs.sh - project: name: vid-clm -- 2.16.6