I have a bitbucket-pipelines.yml for pull-requests.
But when start "Container 'docker' exceeded memory limit."
How to organize code verification at the moment pull-requests?
clone:
depth: full
definitions:
caches:
sonar: ~/.sonar/cache
services:
docker:
memory: 2048
steps:
- step: &build-test-sonarcloud
size: 2x
name: Build, test and analyze on SonarCloud
caches:
- sonar
script:
- pipe: sonarsource/sonarcloud-scan:1.0.1
variables:
DEBUG: "true"
SONAR_SCANNER_OPTS: -Xmx512m
- step: &check-quality-gate-sonarcloud
name: Check the Quality Gate on SonarCloud
script:
- pipe: sonarsource/sonarcloud-quality-gate:0.1.3
pipelines:
pull-requests:
'**':
- step: *build-test-sonarcloud
- step: *check-quality-gate-sonarcloud
Looking at the logs it seems like you are also analyzing all the code of the library you use in your project, I see a lot of jquery files. So you should start by ignoring all those files that are probably minified and will raise a lot of issue that you don’t want to fix. You can do it by setting the sonar.exclusions parameter.
I also noticed that you have some files that are not parsable by our css analyzer, so you wont get issues reported on these:
ERROR: Failed to parse file:///opt/atlassian/pipelines/agent/build/docs/themes/frontend/desktope/core/global.css, line 163, Unexpected }
ERROR: Failed to parse file:///opt/atlassian/pipelines/agent/build/docs/themes/default/css/jstree/default/style.css, line 605, Unknown word
ERROR: Failed to parse file:///opt/atlassian/pipelines/agent/build/docs/themes/default/css/acat.css, line 1008, Unclosed block
Yes that’s right.
At the first stage I want to exclude everything and check only one protected folder
Then I tried to exclude all styles and js so as not to load bb
Maybe you know how to make it select a specific folder for verification so that I don’t have to write a bunch of rules.
Thanks
And one more mistake
I removed the files but for some reason the sonar wants to check them and crashes
I could not find the full description for setting bitbucket-pipelines.yml
Can you suggest where you can see examples?
If there are no examples, tell me how to select only the folders that interest me
next test EXTRA_ARGS: -Dsonar.sources=docs/protected/models/*
and next EXTRA_ARGS: -Dsonar.sources=docs/protected/models/**.php
But the scanner does not check files from these directories. Tell me what should be the setting to check the docs / protected / models / directory?
I found only a description in the documentation, but I don’t see any examples
Comma-separated paths to directories containing main source files. Read from build system for Maven, Gradle, MSBuild projects. Defaults to project base directory when neither sonar.sources nor sonar.tests is provided.