mirror of
https://github.com/elastic/kibana.git
synced 2025-06-28 11:05:39 -04:00
[ci] Run sonarqube daily (#173961)
Adds a pipeline for a daily SonarQube scan. https://buildkite.com/elastic/kibana-bot-sonarqube/builds/7#018ca703-4b56-4a56-b6ce-ae6630cd81e3 (ignore the pipeline name/slug, that was a copy paste error. I'll fix it after)
This commit is contained in:
parent
c4821c5b00
commit
0b23e346bf
5 changed files with 66 additions and 6 deletions
|
@ -1,7 +1,8 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
if [[ "$BUILDKITE_AGENT_NAME" =~ ^bk-agent ]]; then
|
if [[ "$BUILDKITE_AGENT_NAME" =~ ^bk-agent ]]; then
|
||||||
echo "Pipeline file triggered from outside the kibana executors, skipping pre_command"
|
echo "Pipeline file triggered from outside the kibana executors, skipping .buildkite/scripts/lifecycle/pre_command.sh"
|
||||||
|
export SONAR_LOGIN=$(vault read -field=token secret/ci/elastic-kibana/sonarqube)
|
||||||
else
|
else
|
||||||
source .buildkite/scripts/lifecycle/pre_command.sh
|
source .buildkite/scripts/lifecycle/pre_command.sh
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
|
- label: ":sonarqube: Continuous Code Inspection"
|
||||||
steps:
|
agents:
|
||||||
- label: Placeholder
|
image: docker.elastic.co/cloud-ci/sonarqube/buildkite-scanner:latest
|
||||||
command: echo "Hello!"
|
memory: 16G
|
||||||
|
command: /scan-source-code.sh
|
||||||
|
|
|
@ -10,6 +10,7 @@ metadata:
|
||||||
github.com/project-slug: elastic/kibana
|
github.com/project-slug: elastic/kibana
|
||||||
github.com/team-slug: elastic/kibana-tech-leads
|
github.com/team-slug: elastic/kibana-tech-leads
|
||||||
buildkite.com/project-slug: elastic/kibana
|
buildkite.com/project-slug: elastic/kibana
|
||||||
|
sonarqube.org/project-key: elastic_kibana_AYvOkAHeQZlFqhqWIr9
|
||||||
|
|
||||||
tags:
|
tags:
|
||||||
- typescript
|
- typescript
|
||||||
|
@ -200,11 +201,15 @@ spec:
|
||||||
apiVersion: buildkite.elastic.dev/v1
|
apiVersion: buildkite.elastic.dev/v1
|
||||||
kind: Pipeline
|
kind: Pipeline
|
||||||
metadata:
|
metadata:
|
||||||
name: kibana-bot / sonarqube
|
name: kibana / sonarqube
|
||||||
spec:
|
spec:
|
||||||
repository: elastic/kibana
|
repository: elastic/kibana
|
||||||
provider_settings:
|
provider_settings:
|
||||||
trigger_mode: none
|
trigger_mode: none
|
||||||
|
schedules:
|
||||||
|
daily:
|
||||||
|
branch: main
|
||||||
|
cronline: "@daily"
|
||||||
pipeline_file: ".buildkite/pipelines/sonarqube.yml"
|
pipeline_file: ".buildkite/pipelines/sonarqube.yml"
|
||||||
teams:
|
teams:
|
||||||
kibana-operations:
|
kibana-operations:
|
||||||
|
|
52
sonar-project.properties
Normal file
52
sonar-project.properties
Normal file
|
@ -0,0 +1,52 @@
|
||||||
|
sonar.projectKey=elastic_kibana_AYvOkAHeQZlFqhqWIr9Y
|
||||||
|
sonar.projectName=Kibana
|
||||||
|
sonar.host.url=https://sonar.elastic.dev
|
||||||
|
|
||||||
|
sonar.sources=\
|
||||||
|
packages, \
|
||||||
|
plugins, \
|
||||||
|
src, \
|
||||||
|
x-pack/packages, \
|
||||||
|
x-pack/plugins
|
||||||
|
sonar.exclusions=\
|
||||||
|
**/*.mock.*, \
|
||||||
|
**/*.mocks.*, \
|
||||||
|
**/*.spec.*, \
|
||||||
|
**/*.stories.js, \
|
||||||
|
**/*.stories.ts, \
|
||||||
|
**/*.story.js, \
|
||||||
|
**/*.story.ts, \
|
||||||
|
**/*.test.*, \
|
||||||
|
**/*.test.mocks.*, \
|
||||||
|
**/.storybook/**/*, \
|
||||||
|
**/__fixtures__/**/*, \
|
||||||
|
**/__jest__/**/*, \
|
||||||
|
**/__mocks__/**/*, \
|
||||||
|
**/__snapshots__/**/*, \
|
||||||
|
**/__stories__/**/*, \
|
||||||
|
**/__tests__/**/*, \
|
||||||
|
**/cypress/**/*, \
|
||||||
|
**/dev_docs/**/*, \
|
||||||
|
**/docs/**/*, \
|
||||||
|
**/e2e/**/*, \
|
||||||
|
**/fixtures/**/*, \
|
||||||
|
**/ftr_e2e/**/*, \
|
||||||
|
**/integration_tests/**/*, \
|
||||||
|
**/jest*, \
|
||||||
|
**/manual_tests/**/*, \
|
||||||
|
**/mock_responses/**/*, \
|
||||||
|
**/mocks/**/*, \
|
||||||
|
**/node_modules/**/*, \
|
||||||
|
**/packages/**/*, \
|
||||||
|
**/public/**/*, \
|
||||||
|
**/scripts/**/*, \
|
||||||
|
**/storybook/**/*, \
|
||||||
|
**/stubs.ts, \
|
||||||
|
**/test/**/*, \
|
||||||
|
**/test_data/**/*, \
|
||||||
|
**/test_mocks.ts, \
|
||||||
|
**/test_resources/**/*, \
|
||||||
|
**/tests/**/*, \
|
||||||
|
src/dev/**/*
|
||||||
|
|
||||||
|
sonar.javascript.node.maxspace=8192
|
|
@ -15,6 +15,7 @@
|
||||||
*/
|
*/
|
||||||
export const IGNORE_FILE_GLOBS = [
|
export const IGNORE_FILE_GLOBS = [
|
||||||
'.node-version',
|
'.node-version',
|
||||||
|
'sonar-project.properties',
|
||||||
'.github/**/*',
|
'.github/**/*',
|
||||||
'docs/**/*',
|
'docs/**/*',
|
||||||
'**/bin/**/*',
|
'**/bin/**/*',
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue