Skip to content

Commit

Permalink
add some DOCKER and props for SC
Browse files Browse the repository at this point in the history
  • Loading branch information
lucas-paulger-sonarsource committed Sep 27, 2024
1 parent 393daf0 commit 1488062
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# syntax = docker/dockerfile:1
FROM node:20-slim

ARG SONARQUBE_SCANNER_VERSION=4

RUN apt-get update && apt-get install -y \
git \
&& rm -rf /var/lib/apt/lists/* \
&& npm i -g sonarqube-scanner@^${SONARQUBE_SCANNER_VERSION}
File renamed without changes.
41 changes: 41 additions & 0 deletions azure-pipelines-sq-v6.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Node.js
# Build a general Node.js project with npm.
# Add steps that analyze code, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/javascript

pool:
vmImage: ubuntu-latest

steps:
- task: NodeTool@0
inputs:
versionSpec: '18.x'
displayName: 'Install Node.js'

- script: |
echo Unsetting JAVA_HOME_17_X64
set JAVA_HOME_17_X64=
echo JAVA_HOME_17_X64 is now: %JAVA_HOME_17_X64%
displayName: 'Emulate non-set JAVA_HOME_17_X64'

- task: SonarQubePrepare@6
inputs:
SonarQube: 'local sq instance'
scannerMode: 'CLI'
configMode: 'manual'
cliProjectKey: 'react-demo'
cliSources: '.'

- task: SonarQubeAnalyze@6
inputs:
jdkversion: 'JAVA_HOME_17_X64'

- task: SonarQubePublish@6
inputs:
pollingTimeoutSec: '300'

# this would go first, but I care more that the SQ tasks pass
- script: |
npm install
npm run build
displayName: "npm install and build"
File renamed without changes.
3 changes: 3 additions & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
sonar.projectKey=lucas-paulger-sonarsource_react-demo
sonar.organization=lucas-paulger-sonarsource
sonar.token=aee84d3cd71bebb94399062a710b6313d1dcd74d
sonar.verbose=true
sonar.userHome=/project/.sonar
sonar.working.directory=.sonarwork

0 comments on commit 1488062

Please sign in to comment.