-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SC-1063 provide orb that adds support for SonarCloud in CircleCI #2
Conversation
b33861b
to
a9eaa9b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
README.md
Outdated
```yaml | ||
version: 2.1 | ||
orbs: | ||
sonarcloud: sonarsource/sonarcloud@dev:alpha |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can already change to v1.0.0
3306dd0
to
97315d6
Compare
97315d6
to
920f783
Compare
command: mkdir -p /tmp/cache/scanner | ||
- restore_cache: | ||
keys: | ||
- v<<parameters.cache_version>>-sonarcloud-scanner-4.1.0.1829 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The scanner version does not need to be part of the cache key. The cached files are compatible with all versions of scanners.
- v<<parameters.cache_version>>-sonarcloud-scanner-4.1.0.1829 | |
- v<<parameters.cache_version>>-sonarcloud-scanner |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That looks like a cache for the (versioned) sonar-scanner executable, not necessarily a cache of generated files
(sorry to butt in here, I've been following this issue, and have already created a similar orb myself)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, the cache will hold the scanner executable, and the plugins downloaded by the scanner. It is not a big deal if we remove it, but if we ever want to use another scanner executable version then we should change the cache name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tom-vanbraband-sonarsource, have you been able to get it to avoid downloading plugins by caching? It seems that even when I'm using a cache, sonar-scanner still downloads plugins every time, and it's the longest 17 seconds of my life.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no I failed to make it work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @jrnail23, the SONAR_USER_HOME variable determines among other things the directory where your downloaded plugins are stored. So you can use that to make sure that your plugins are stored within the circleci cache directory.
environment: | ||
SONARQUBE_SCANNER_PARAMS: '{"sonar.host.url":"https://dogfood-core.sc-dev.io"}' | ||
- save_cache: | ||
key: v<<parameters.cache_version>>-sonarcloud-scanner-4.1.0.1829 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
key: v<<parameters.cache_version>>-sonarcloud-scanner-4.1.0.1829 | |
key: v<<parameters.cache_version>>-sonarcloud-scanner |
src/main/commands/scan.yml
Outdated
|
||
$SCANNER_DIRECTORY/sonar-scanner-$VERSION-$OS/bin/sonar-scanner | ||
environment: | ||
SONARQUBE_SCANNER_PARAMS: '{"sonar.host.url":"https://dogfood-core.sc-dev.io"}' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do not forget to replace sonarcloud.io!
SONARQUBE_SCANNER_PARAMS: '{"sonar.host.url":"https://dogfood-core.sc-dev.io"}' | |
SONARQUBE_SCANNER_PARAMS: '{"sonar.host.url":"https://sonarcloud.io"}' |
50ecae0
to
f70c359
Compare
No description provided.