Created
August 12, 2020 17:18
-
-
Save harshanas/8b7b38ca63bb7799b8c11452910ea00b to your computer and use it in GitHub Desktop.
Integrate SonarCloud with AWS CodeCommit and CodeBuild
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: 0.2 | |
phases: | |
install: | |
runtime-versions: | |
nodejs: 10 | |
commands: | |
- apt-get update | |
- apt-get install -y jq | |
- wget https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-3.3.0.1492-linux.zip | |
- unzip ./sonar-scanner-cli-3.3.0.1492-linux.zip | |
- export PATH=$PATH:./sonar-scanner-3.3.0.1492-linux/bin/ | |
pre_build: | |
commands: | |
- sonar-scanner -Dsonar.organization=$SONARCLOUD_ORG -Dsonar.projectKey=$PROJECTKEY -Dsonar.sources=src -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=$SONARCLOUD_TOKEN | |
- sleep 5 | |
- curl https://sonarcloud.io/api/qualitygates/project_status?projectKey=$PROJECTKEY > analysis.json | |
- cat analysis.json | |
build: | |
commands: | |
- echo Building Project | |
- echo Finished Building | |
cache: | |
paths: | |
- "node_modules/**/*" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment