123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283 |
- // Jest Snapshot v1, https://goo.gl/fbAQLP
-
- exports[`should render correctly for cfamily: branches enabled 1`] = `
- <Fragment>
- <CodeSnippet
- snippet="image: <image ready for your build toolchain>
-
- cache:
- paths:
- - .sonar
-
- stages:
- - download
- - build
- - scan
-
- download:
- stage: download
- script:
- - mkdir -p .sonar
- - curl -sSLo build-wrapper-linux-x86.zip $SONAR_HOST_URL/static/cpp/build-wrapper-linux-x86.zip
- - unzip -o build-wrapper-linux-x86.zip -d .sonar
-
- build:
- stage: build
- script:
- - .sonar/build-wrapper-linux-x86/build-wrapper-linux-x86-64 --out-dir .sonar/bw-output <your clean build command>
-
- sonarqube-check:
- stage: scan
- script:
- - curl -sSLo sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.6.2.2472-linux.zip
- - unzip -o sonar-scanner.zip -d .sonar
- - .sonar/sonar-scanner-4.6.2.2472-linux/bin/sonar-scanner -Dsonar.cfamily.build-wrapper-output=.sonar/bw-output
- allow_failure: true"
- />
- <CompilationInfo />
- </Fragment>
- `;
-
- exports[`should render correctly for cfamily: branches not enabled 1`] = `
- <Fragment>
- <CodeSnippet
- snippet="image: <image ready for your build toolchain>
-
- cache:
- paths:
- - .sonar
-
- stages:
- - download
- - build
- - scan
-
- download:
- stage: download
- script:
- - mkdir -p .sonar
- - curl -sSLo build-wrapper-linux-x86.zip $SONAR_HOST_URL/static/cpp/build-wrapper-linux-x86.zip
- - unzip -o build-wrapper-linux-x86.zip -d .sonar
-
- build:
- stage: build
- script:
- - .sonar/build-wrapper-linux-x86/build-wrapper-linux-x86-64 --out-dir .sonar/bw-output <your clean build command>
-
- sonarqube-check:
- stage: scan
- script:
- - curl -sSLo sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.6.2.2472-linux.zip
- - unzip -o sonar-scanner.zip -d .sonar
- - .sonar/sonar-scanner-4.6.2.2472-linux/bin/sonar-scanner -Dsonar.cfamily.build-wrapper-output=.sonar/bw-output
- allow_failure: true"
- />
- <CompilationInfo />
- </Fragment>
- `;
-
- exports[`should render correctly for dotnet: branches enabled 1`] = `
- <Fragment>
- <CodeSnippet
- snippet="sonarqube-check:
- image: mcr.microsoft.com/dotnet/core/sdk:latest
- variables:
- SONAR_USER_HOME: \\"\${CI_PROJECT_DIR}/.sonar\\" # Defines the location of the analysis task cache
- GIT_DEPTH: \\"0\\" # Tells git to fetch all the branches of the project, required by the analysis task
- cache:
- key: \\"\${CI_JOB_NAME}\\"
- paths:
- - .sonar/cache
- script:
- - \\"apt-get update\\"
- - \\"apt-get install --yes openjdk-11-jre\\"
- - \\"dotnet tool install --global dotnet-sonarscanner\\"
- - \\"export PATH=\\\\\\"$PATH:$HOME/.dotnet/tools\\\\\\"\\"
- - \\"dotnet sonarscanner begin /k:\\\\\\"test\\\\\\" /d:sonar.login=\\\\\\"$SONAR_TOKEN\\\\\\" /d:\\\\\\"sonar.host.url=$SONAR_HOST_URL\\\\\\" \\"
- - \\"dotnet build\\"
- - \\"dotnet sonarscanner end /d:sonar.login=\\\\\\"$SONAR_TOKEN\\\\\\"\\"
- allow_failure: true
- only:
- - merge_requests
- - master # or the name of your main branch
- - develop
- "
- />
- </Fragment>
- `;
-
- exports[`should render correctly for dotnet: branches not enabled 1`] = `
- <Fragment>
- <CodeSnippet
- snippet="sonarqube-check:
- image: mcr.microsoft.com/dotnet/core/sdk:latest
- variables:
- SONAR_USER_HOME: \\"\${CI_PROJECT_DIR}/.sonar\\" # Defines the location of the analysis task cache
- GIT_DEPTH: \\"0\\" # Tells git to fetch all the branches of the project, required by the analysis task
- cache:
- key: \\"\${CI_JOB_NAME}\\"
- paths:
- - .sonar/cache
- script:
- - \\"apt-get update\\"
- - \\"apt-get install --yes openjdk-11-jre\\"
- - \\"dotnet tool install --global dotnet-sonarscanner\\"
- - \\"export PATH=\\\\\\"$PATH:$HOME/.dotnet/tools\\\\\\"\\"
- - \\"dotnet sonarscanner begin /k:\\\\\\"test\\\\\\" /d:sonar.login=\\\\\\"$SONAR_TOKEN\\\\\\" /d:\\\\\\"sonar.host.url=$SONAR_HOST_URL\\\\\\" \\"
- - \\"dotnet build\\"
- - \\"dotnet sonarscanner end /d:sonar.login=\\\\\\"$SONAR_TOKEN\\\\\\"\\"
- allow_failure: true
- only:
- - merge_requests
- - master # or the name of your main branch
- - develop
- "
- />
- </Fragment>
- `;
-
- exports[`should render correctly for gradle: branches enabled 1`] = `
- <Fragment>
- <CodeSnippet
- snippet="sonarqube-check:
- image: gradle:jre11-slim
- variables:
- SONAR_USER_HOME: \\"\${CI_PROJECT_DIR}/.sonar\\" # Defines the location of the analysis task cache
- GIT_DEPTH: \\"0\\" # Tells git to fetch all the branches of the project, required by the analysis task
- cache:
- key: \\"\${CI_JOB_NAME}\\"
- paths:
- - .sonar/cache
- script: gradle sonarqube
- allow_failure: true
- only:
- - merge_requests
- - master # or the name of your main branch
- - develop
- "
- />
- </Fragment>
- `;
-
- exports[`should render correctly for gradle: branches not enabled 1`] = `
- <Fragment>
- <CodeSnippet
- snippet="sonarqube-check:
- image: gradle:jre11-slim
- variables:
- SONAR_USER_HOME: \\"\${CI_PROJECT_DIR}/.sonar\\" # Defines the location of the analysis task cache
- GIT_DEPTH: \\"0\\" # Tells git to fetch all the branches of the project, required by the analysis task
- cache:
- key: \\"\${CI_JOB_NAME}\\"
- paths:
- - .sonar/cache
- script: gradle sonarqube
- allow_failure: true
- only:
- - merge_requests
- - master # or the name of your main branch
- - develop
- "
- />
- </Fragment>
- `;
-
- exports[`should render correctly for maven: branches enabled 1`] = `
- <Fragment>
- <CodeSnippet
- snippet="sonarqube-check:
- image: maven:3.6.3-jdk-11
- variables:
- SONAR_USER_HOME: \\"\${CI_PROJECT_DIR}/.sonar\\" # Defines the location of the analysis task cache
- GIT_DEPTH: \\"0\\" # Tells git to fetch all the branches of the project, required by the analysis task
- cache:
- key: \\"\${CI_JOB_NAME}\\"
- paths:
- - .sonar/cache
- script:
- - mvn verify sonar:sonar
- allow_failure: true
- only:
- - merge_requests
- - master # or the name of your main branch
- - develop
- "
- />
- </Fragment>
- `;
-
- exports[`should render correctly for maven: branches not enabled 1`] = `
- <Fragment>
- <CodeSnippet
- snippet="sonarqube-check:
- image: maven:3.6.3-jdk-11
- variables:
- SONAR_USER_HOME: \\"\${CI_PROJECT_DIR}/.sonar\\" # Defines the location of the analysis task cache
- GIT_DEPTH: \\"0\\" # Tells git to fetch all the branches of the project, required by the analysis task
- cache:
- key: \\"\${CI_JOB_NAME}\\"
- paths:
- - .sonar/cache
- script:
- - mvn verify sonar:sonar
- allow_failure: true
- only:
- - merge_requests
- - master # or the name of your main branch
- - develop
- "
- />
- </Fragment>
- `;
-
- exports[`should render correctly for other: branches enabled 1`] = `
- <Fragment>
- <CodeSnippet
- snippet="sonarqube-check:
- image:
- name: sonarsource/sonar-scanner-cli:latest
- entrypoint: [\\"\\"]
- variables:
- SONAR_USER_HOME: \\"\${CI_PROJECT_DIR}/.sonar\\" # Defines the location of the analysis task cache
- GIT_DEPTH: \\"0\\" # Tells git to fetch all the branches of the project, required by the analysis task
- cache:
- key: \\"\${CI_JOB_NAME}\\"
- paths:
- - .sonar/cache
- script:
- - sonar-scanner
- allow_failure: true
- only:
- - merge_requests
- - master # or the name of your main branch
- - develop
- "
- />
- </Fragment>
- `;
-
- exports[`should render correctly for other: branches not enabled 1`] = `
- <Fragment>
- <CodeSnippet
- snippet="sonarqube-check:
- image:
- name: sonarsource/sonar-scanner-cli:latest
- entrypoint: [\\"\\"]
- variables:
- SONAR_USER_HOME: \\"\${CI_PROJECT_DIR}/.sonar\\" # Defines the location of the analysis task cache
- GIT_DEPTH: \\"0\\" # Tells git to fetch all the branches of the project, required by the analysis task
- cache:
- key: \\"\${CI_JOB_NAME}\\"
- paths:
- - .sonar/cache
- script:
- - sonar-scanner
- allow_failure: true
- only:
- - merge_requests
- - master # or the name of your main branch
- - develop
- "
- />
- </Fragment>
- `;
|