screwdriver-coverage-sonar 3.4.1 → 4.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/commands.txt +5 -2
  2. package/index.js +4 -13
  3. package/package.json +13 -13
package/commands.txt CHANGED
@@ -10,8 +10,11 @@ if echo $SCM_URL | grep git@ > /dev/null 2>&1; then export SONAR_SCM_URL=`echo $
10
10
  if [ ! -z "$SD_SELF_SONAR_HOST" ]; then SCANNER_OPTION='"-Dsonar.host.url=$SD_SELF_SONAR_HOST" "-Dsonar.login=$SONAR_TOKEN" "-Dsonar.projectKey=$SD_SONAR_PROJECT_KEY" "-Dsonar.projectName=$SD_SONAR_PROJECT_NAME" "-Dsonar.projectVersion=$PROJECT_VERSION" "-Dsonar.links.scm=$SONAR_SCM_URL" "-Dsonar.links.ci=$SD_UI_URL/pipelines/$SD_PIPELINE_ID" "-Dsonar.scm.revision=$SD_BUILD_SHA" $SONAR_OPTIONS'; else SCANNER_OPTION='"-Dsonar.host.url=$SD_SONAR_HOST" "-Dsonar.login=$SONAR_TOKEN" "-Dsonar.projectKey=$SD_SONAR_PROJECT_KEY" "-Dsonar.projectName=$SD_SONAR_PROJECT_NAME" "-Dsonar.projectVersion=$PROJECT_VERSION" "-Dsonar.links.scm=$SONAR_SCM_URL" "-Dsonar.links.ci=$SD_UI_URL/pipelines/$SD_PIPELINE_ID" "-Dsonar.scm.revision=$SD_BUILD_SHA" $SONAR_OPTIONS'; fi
11
11
  SCANNER_PATH="/opt/sd/sonar-scanner/bin/sonar-scanner"
12
12
  if [ -s ${SCANNER_PATH} ] && [ -x ${SCANNER_PATH} ]; then eval $SCANNER_PATH $SCANNER_OPTION || true; exit 0; fi
13
- if [ `uname` = 'Darwin' ]; then TARGET_OS='macosx'; else TARGET_OS='linux'; fi
14
- SCANNER_PATH="/opt/sd/sonarscanner-cli-${TARGET_OS}/bin/sonar-scanner"
13
+ OS="$(uname)"
14
+ ARCH="$(uname -m)"
15
+ if [ "$OS" = 'Darwin' ]; then TARGET_OS='macosx'; else TARGET_OS='linux'; fi
16
+ if [ "$ARCH" = "aarch64" ] || [ "$ARCH" = "arm64" ]; then TARGET_ARCH='-arm64'; else TARGET_ARCH=''; fi
17
+ SCANNER_PATH="/opt/sd/sonarscanner-cli-${TARGET_OS}${TARGET_ARCH}/bin/sonar-scanner"
15
18
  if [ -s ${SCANNER_PATH} ] && [ -x ${SCANNER_PATH} ]; then eval $SCANNER_PATH $SCANNER_OPTION || true; exit 0; fi
16
19
  if unzip -version > /dev/null 2>&1; then SD_UNZIP_CMD_WRAPPER="eval"; else SD_UNZIP_CMD_WRAPPER="sd-step exec --pkg-version 6.0 core/unzip"; fi
17
20
  export SD_UNZIP_CMD_WRAPPER
package/index.js CHANGED
@@ -7,7 +7,7 @@ const joi = require('joi');
7
7
  const hoek = require('@hapi/hoek');
8
8
  const path = require('path');
9
9
  const request = require('screwdriver-request');
10
- const uuidv4 = require('uuid/v4');
10
+ const { v4: uuidv4 } = require('uuid');
11
11
  const logger = require('screwdriver-logger');
12
12
  const CoverageBase = require('screwdriver-coverage-base');
13
13
 
@@ -34,18 +34,9 @@ class CoverageSonar extends CoverageBase {
34
34
  joi
35
35
  .object()
36
36
  .keys({
37
- sdApiUrl: joi
38
- .string()
39
- .uri()
40
- .required(),
41
- sdUiUrl: joi
42
- .string()
43
- .uri()
44
- .required(),
45
- sonarHost: joi
46
- .string()
47
- .uri()
48
- .required(),
37
+ sdApiUrl: joi.string().uri().required(),
38
+ sdUiUrl: joi.string().uri().required(),
39
+ sonarHost: joi.string().uri().required(),
49
40
  adminToken: joi.string().required(),
50
41
  sonarEnterprise: joi.boolean().default(false),
51
42
  sonarGitAppName: joi.string().default(DEFAULT_GIT_APP_NAME)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "screwdriver-coverage-sonar",
3
- "version": "3.4.1",
3
+ "version": "4.1.0",
4
4
  "description": "SonarQube implementation of the coverage-base class",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -29,23 +29,23 @@
29
29
  "Tiffany Kyi <tiffanykyi@gmail.com>"
30
30
  ],
31
31
  "devDependencies": {
32
- "chai": "^4.3.6",
33
- "eslint": "^7.32.0",
34
- "eslint-config-screwdriver": "^5.0.1",
35
- "mocha": "^9.2.2",
32
+ "chai": "^4.3.7",
33
+ "eslint": "^8.28.0",
34
+ "eslint-config-screwdriver": "^7.0.0",
35
+ "mocha": "^10.1.0",
36
36
  "mocha-multi-reporters": "^1.5.1",
37
37
  "mocha-sonarqube-reporter": "^1.0.2",
38
38
  "mockery": "^2.1.0",
39
- "nyc": "^15.0.0",
40
- "sinon": "^9.0.0"
39
+ "nyc": "^15.1.0",
40
+ "sinon": "^15.0.0"
41
41
  },
42
42
  "dependencies": {
43
- "@hapi/hoek": "^9.3.0",
44
- "joi": "^17.6.0",
45
- "screwdriver-coverage-base": "^2.1.0",
46
- "screwdriver-logger": "^1.1.0",
47
- "screwdriver-request": "^1.0.3",
48
- "uuid": "^3.4.0"
43
+ "@hapi/hoek": "^10.0.1",
44
+ "joi": "^17.7.0",
45
+ "screwdriver-coverage-base": "^3.0.0",
46
+ "screwdriver-logger": "^2.0.0",
47
+ "screwdriver-request": "^2.0.1",
48
+ "uuid": "^9.0.0"
49
49
  },
50
50
  "release": {
51
51
  "debug": false