diff options
author | Jeremy Davis <jeremy.davis@sonarsource.com> | 2021-01-26 18:42:02 +0100 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2021-02-04 20:07:06 +0000 |
commit | 38069298aa720559a7630734131491a6b207948c (patch) | |
tree | acacd046eceba5c5690d5a6606259b764424f2d5 | |
parent | 23ea081c88ba66a768dbc303020607778875c0de (diff) | |
download | sonarqube-38069298aa720559a7630734131491a6b207948c.tar.gz sonarqube-38069298aa720559a7630734131491a6b207948c.zip |
SONAR-14353 GitlabCI tutorial for CE
15 files changed, 212 insertions, 235 deletions
diff --git a/server/sonar-web/src/main/js/components/tutorials/gitlabci/YmlFileStep.tsx b/server/sonar-web/src/main/js/components/tutorials/gitlabci/YmlFileStep.tsx index 1dec8870dc1..cb4126ee72e 100644 --- a/server/sonar-web/src/main/js/components/tutorials/gitlabci/YmlFileStep.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/gitlabci/YmlFileStep.tsx @@ -22,18 +22,18 @@ import { FormattedMessage } from 'react-intl'; import { Link } from 'react-router'; import { ClipboardIconButton } from 'sonar-ui-common/components/controls/clipboard'; import { translate } from 'sonar-ui-common/helpers/l10n'; +import { withAppState } from '../../hoc/withAppState'; import Step from '../components/Step'; -import PipeCommandGradle from './commands/PipeCommandGradle'; -import PipeCommandMaven from './commands/PipeCommandMaven'; -import PipeCommandOther from './commands/PipeCommandOther'; +import PipeCommand from './commands/PipeCommand'; import { BuildTools } from './types'; export interface YmlFileStepProps { + appState: T.AppState; buildTool?: BuildTools; open: boolean; } -export default function YmlFileStep({ buildTool, open }: YmlFileStepProps) { +export function YmlFileStep({ appState: { branchesEnabled }, buildTool, open }: YmlFileStepProps) { const renderForm = () => ( <div className="boxed-group-inner"> <div className="flex-columns"> @@ -61,13 +61,13 @@ export default function YmlFileStep({ buildTool, open }: YmlFileStepProps) { </div> <div className="big-spacer-bottom"> - {buildTool === BuildTools.Maven && <PipeCommandMaven />} - {buildTool === BuildTools.Gradle && <PipeCommandGradle />} - {buildTool === BuildTools.Other && <PipeCommandOther />} + <PipeCommand buildTool={buildTool} branchesEnabled={branchesEnabled} /> </div> <p className="little-spacer-bottom"> - {translate('onboarding.tutorial.with.gitlab_ci.yml.baseconfig')} + {branchesEnabled + ? translate('onboarding.tutorial.with.gitlab_ci.yml.baseconfig') + : translate('onboarding.tutorial.with.gitlab_ci.yml.baseconfig.no_branches')} </p> <p className="huge-spacer-bottom"> @@ -134,3 +134,5 @@ export default function YmlFileStep({ buildTool, open }: YmlFileStepProps) { /> ); } + +export default withAppState(YmlFileStep); diff --git a/server/sonar-web/src/main/js/components/tutorials/gitlabci/__tests__/YmlFileStep-test.tsx b/server/sonar-web/src/main/js/components/tutorials/gitlabci/__tests__/YmlFileStep-test.tsx index afa0332d886..6d24ad7873e 100644 --- a/server/sonar-web/src/main/js/components/tutorials/gitlabci/__tests__/YmlFileStep-test.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/gitlabci/__tests__/YmlFileStep-test.tsx @@ -19,9 +19,10 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; +import { mockAppState } from '../../../../helpers/testMocks'; import { renderStepContent } from '../../jenkins/test-utils'; import { BuildTools } from '../types'; -import YmlFileStep, { YmlFileStepProps } from '../YmlFileStep'; +import { YmlFileStep, YmlFileStepProps } from '../YmlFileStep'; it('should render correctly', () => { const wrapper = shallowRender(); @@ -37,5 +38,7 @@ it.each([[BuildTools.Maven], [BuildTools.Gradle], [BuildTools.Other]])( ); function shallowRender(props: Partial<YmlFileStepProps> = {}) { - return shallow<YmlFileStepProps>(<YmlFileStep open={true} {...props} />); + return shallow<YmlFileStepProps>( + <YmlFileStep appState={mockAppState({ branchesEnabled: true })} open={true} {...props} /> + ); } diff --git a/server/sonar-web/src/main/js/components/tutorials/gitlabci/__tests__/__snapshots__/GitLabCITutorial-test.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/gitlabci/__tests__/__snapshots__/GitLabCITutorial-test.tsx.snap index 2f3e5aa150a..00c4ef25f2c 100644 --- a/server/sonar-web/src/main/js/components/tutorials/gitlabci/__tests__/__snapshots__/GitLabCITutorial-test.tsx.snap +++ b/server/sonar-web/src/main/js/components/tutorials/gitlabci/__tests__/__snapshots__/GitLabCITutorial-test.tsx.snap @@ -77,7 +77,7 @@ exports[`should render correctly 1`] = ` onOpen={[Function]} open={false} /> - <YmlFileStep + <Connect(withAppState(YmlFileStep)) open={false} /> </Fragment> diff --git a/server/sonar-web/src/main/js/components/tutorials/gitlabci/__tests__/__snapshots__/YmlFileStep-test.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/gitlabci/__tests__/__snapshots__/YmlFileStep-test.tsx.snap index 95bf2abb6e3..2fed2d0975b 100644 --- a/server/sonar-web/src/main/js/components/tutorials/gitlabci/__tests__/__snapshots__/YmlFileStep-test.tsx.snap +++ b/server/sonar-web/src/main/js/components/tutorials/gitlabci/__tests__/__snapshots__/YmlFileStep-test.tsx.snap @@ -37,7 +37,10 @@ exports[`should render correctly for build tool gradle 1`] = ` <div className="big-spacer-bottom" > - <PipeCommandGradle /> + <PipeCommand + branchesEnabled={true} + buildTool="gradle" + /> </div> <p className="little-spacer-bottom" @@ -145,7 +148,10 @@ exports[`should render correctly for build tool maven 1`] = ` <div className="big-spacer-bottom" > - <PipeCommandMaven /> + <PipeCommand + branchesEnabled={true} + buildTool="maven" + /> </div> <p className="little-spacer-bottom" @@ -253,7 +259,10 @@ exports[`should render correctly for build tool other 1`] = ` <div className="big-spacer-bottom" > - <PipeCommandOther /> + <PipeCommand + branchesEnabled={true} + buildTool="other" + /> </div> <p className="little-spacer-bottom" diff --git a/server/sonar-web/src/main/js/components/tutorials/gitlabci/commands/PipeCommandOther.tsx b/server/sonar-web/src/main/js/components/tutorials/gitlabci/commands/PipeCommand.tsx index 66b8954fe2a..e3b14660cff 100644 --- a/server/sonar-web/src/main/js/components/tutorials/gitlabci/commands/PipeCommandOther.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/gitlabci/commands/PipeCommand.tsx @@ -19,12 +19,40 @@ */ import * as React from 'react'; import CodeSnippet from '../../../common/CodeSnippet'; +import { BuildTools } from '../types'; -export default function PipeCommandOther() { - const command = `sonarqube-check: - image: +export interface PipeCommandProps { + branchesEnabled?: boolean; + buildTool: BuildTools; +} + +const BUILD_TOOL_SPECIFIC = { + [BuildTools.Gradle]: { image: 'gradle:jre11-slim', script: 'gradle sonarqube' }, + [BuildTools.Maven]: { + image: 'maven:3.6.3-jdk-11', + script: ` + - mvn verify sonar:sonar` + }, + [BuildTools.Other]: { + image: ` name: sonarsource/sonar-scanner-cli:latest - entrypoint: [""] + entrypoint: [""]`, + script: ` + - sonar-scanner` + } +}; + +export default function PipeCommand({ branchesEnabled, buildTool }: PipeCommandProps) { + const onlyBlock = branchesEnabled + ? `- merge_requests + - master + - develop` + : '- master # or the name of your main branch'; + + const { image, script } = BUILD_TOOL_SPECIFIC[buildTool]; + + const command = `sonarqube-check: + image: ${image} 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 @@ -32,13 +60,10 @@ export default function PipeCommandOther() { key: "\${CI_JOB_NAME}" paths: - .sonar/cache - script: - - sonar-scanner + script: ${script} allow_failure: true only: - - merge_requests - - master - - develop + ${onlyBlock} `; return <CodeSnippet snippet={command} />; diff --git a/server/sonar-web/src/main/js/components/tutorials/gitlabci/commands/PipeCommandGradle.tsx b/server/sonar-web/src/main/js/components/tutorials/gitlabci/commands/PipeCommandGradle.tsx deleted file mode 100644 index 6454875ac0f..00000000000 --- a/server/sonar-web/src/main/js/components/tutorials/gitlabci/commands/PipeCommandGradle.tsx +++ /dev/null @@ -1,42 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2021 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -import * as React from 'react'; -import CodeSnippet from '../../../common/CodeSnippet'; - -export default function PipeCommandGradle() { - const command = `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 - - develop -`; - - return <CodeSnippet snippet={command} />; -} diff --git a/server/sonar-web/src/main/js/components/tutorials/gitlabci/commands/PipeCommandMaven.tsx b/server/sonar-web/src/main/js/components/tutorials/gitlabci/commands/PipeCommandMaven.tsx deleted file mode 100644 index 875a71c4191..00000000000 --- a/server/sonar-web/src/main/js/components/tutorials/gitlabci/commands/PipeCommandMaven.tsx +++ /dev/null @@ -1,43 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2021 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -import * as React from 'react'; -import CodeSnippet from '../../../common/CodeSnippet'; - -export default function PipeCommandMaven() { - const command = `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 - - develop -`; - - return <CodeSnippet snippet={command} />; -} diff --git a/server/sonar-web/src/main/js/components/tutorials/gitlabci/commands/__tests__/PipeCommandOther-test.tsx b/server/sonar-web/src/main/js/components/tutorials/gitlabci/commands/__tests__/PipeCommand-test.tsx index d1ad81beb2a..8e2c9367182 100644 --- a/server/sonar-web/src/main/js/components/tutorials/gitlabci/commands/__tests__/PipeCommandOther-test.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/gitlabci/commands/__tests__/PipeCommand-test.tsx @@ -19,8 +19,17 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; -import PipeCommandOther from '../PipeCommandOther'; +import { BuildTools } from '../../types'; +import PipeCommand from '../PipeCommand'; -it('should render correctly', () => { - expect(shallow(<PipeCommandOther />)).toMatchSnapshot(); -}); +it.each([[BuildTools.Gradle], [BuildTools.Maven], [BuildTools.Other]])( + 'should render correctly for %s', + buildTool => { + expect(shallow(<PipeCommand buildTool={buildTool} branchesEnabled={true} />)).toMatchSnapshot( + 'branches enabled' + ); + expect(shallow(<PipeCommand buildTool={buildTool} branchesEnabled={true} />)).toMatchSnapshot( + 'branches not enabled' + ); + } +); diff --git a/server/sonar-web/src/main/js/components/tutorials/gitlabci/commands/__tests__/PipeCommandGradle-test.tsx b/server/sonar-web/src/main/js/components/tutorials/gitlabci/commands/__tests__/PipeCommandGradle-test.tsx deleted file mode 100644 index f259f1a7a0f..00000000000 --- a/server/sonar-web/src/main/js/components/tutorials/gitlabci/commands/__tests__/PipeCommandGradle-test.tsx +++ /dev/null @@ -1,26 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2021 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -import { shallow } from 'enzyme'; -import * as React from 'react'; -import PipeCommandGradle from '../PipeCommandGradle'; - -it('should render correctly', () => { - expect(shallow(<PipeCommandGradle />)).toMatchSnapshot(); -}); diff --git a/server/sonar-web/src/main/js/components/tutorials/gitlabci/commands/__tests__/PipeCommandMaven-test.tsx b/server/sonar-web/src/main/js/components/tutorials/gitlabci/commands/__tests__/PipeCommandMaven-test.tsx deleted file mode 100644 index 2e5c109d030..00000000000 --- a/server/sonar-web/src/main/js/components/tutorials/gitlabci/commands/__tests__/PipeCommandMaven-test.tsx +++ /dev/null @@ -1,26 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2021 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -import { shallow } from 'enzyme'; -import * as React from 'react'; -import PipeCommandMaven from '../PipeCommandMaven'; - -it('should render correctly', () => { - expect(shallow(<PipeCommandMaven />)).toMatchSnapshot(); -}); diff --git a/server/sonar-web/src/main/js/components/tutorials/gitlabci/commands/__tests__/__snapshots__/PipeCommand-test.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/gitlabci/commands/__tests__/__snapshots__/PipeCommand-test.tsx.snap new file mode 100644 index 00000000000..019eef78564 --- /dev/null +++ b/server/sonar-web/src/main/js/components/tutorials/gitlabci/commands/__tests__/__snapshots__/PipeCommand-test.tsx.snap @@ -0,0 +1,135 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`should render correctly for gradle: branches enabled 1`] = ` +<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 + - develop +" +/> +`; + +exports[`should render correctly for gradle: branches not enabled 1`] = ` +<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 + - develop +" +/> +`; + +exports[`should render correctly for maven: branches enabled 1`] = ` +<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 + - develop +" +/> +`; + +exports[`should render correctly for maven: branches not enabled 1`] = ` +<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 + - develop +" +/> +`; + +exports[`should render correctly for other: branches enabled 1`] = ` +<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 + - develop +" +/> +`; + +exports[`should render correctly for other: branches not enabled 1`] = ` +<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 + - develop +" +/> +`; diff --git a/server/sonar-web/src/main/js/components/tutorials/gitlabci/commands/__tests__/__snapshots__/PipeCommandGradle-test.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/gitlabci/commands/__tests__/__snapshots__/PipeCommandGradle-test.tsx.snap deleted file mode 100644 index 61f4c68d1f1..00000000000 --- a/server/sonar-web/src/main/js/components/tutorials/gitlabci/commands/__tests__/__snapshots__/PipeCommandGradle-test.tsx.snap +++ /dev/null @@ -1,22 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`should render correctly 1`] = ` -<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 - - develop -" -/> -`; diff --git a/server/sonar-web/src/main/js/components/tutorials/gitlabci/commands/__tests__/__snapshots__/PipeCommandMaven-test.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/gitlabci/commands/__tests__/__snapshots__/PipeCommandMaven-test.tsx.snap deleted file mode 100644 index 0b843680c84..00000000000 --- a/server/sonar-web/src/main/js/components/tutorials/gitlabci/commands/__tests__/__snapshots__/PipeCommandMaven-test.tsx.snap +++ /dev/null @@ -1,23 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`should render correctly 1`] = ` -<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 - - develop -" -/> -`; diff --git a/server/sonar-web/src/main/js/components/tutorials/gitlabci/commands/__tests__/__snapshots__/PipeCommandOther-test.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/gitlabci/commands/__tests__/__snapshots__/PipeCommandOther-test.tsx.snap deleted file mode 100644 index 74e84b88d82..00000000000 --- a/server/sonar-web/src/main/js/components/tutorials/gitlabci/commands/__tests__/__snapshots__/PipeCommandOther-test.tsx.snap +++ /dev/null @@ -1,25 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`should render correctly 1`] = ` -<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 - - develop -" -/> -`; diff --git a/sonar-core/src/main/resources/org/sonar/l10n/core.properties b/sonar-core/src/main/resources/org/sonar/l10n/core.properties index 50ef223c143..680894af399 100644 --- a/sonar-core/src/main/resources/org/sonar/l10n/core.properties +++ b/sonar-core/src/main/resources/org/sonar/l10n/core.properties @@ -3357,7 +3357,8 @@ onboarding.tutorial.with.gitlab_ci.env_variables.section2.step4=Leave the "Mask onboarding.tutorial.with.gitlab_ci.yml.title=Create or update the configuration file onboarding.tutorial.with.gitlab_ci.yml.description=Create or update your {filename} file with the following content. onboarding.tutorial.with.gitlab_ci.yml.filename=.gitlab-ci.yml -onboarding.tutorial.with.gitlab_ci.yml.baseconfig=Note that this is a minimal base configuration to run a SonarQube analysis on your master branch and merge requests. +onboarding.tutorial.with.gitlab_ci.yml.baseconfig=Note that this is a minimal base configuration to run a SonarQube analysis on your main branch and merge requests. +onboarding.tutorial.with.gitlab_ci.yml.baseconfig.no_branches=Note that this is a minimal base configuration to run a SonarQube analysis on your main branch. onboarding.tutorial.with.gitlab_ci.yml.existing=If you already have a pipeline configured and running, you might want to add the example from this step to your existing yml file. onboarding.tutorial.with.gitlab_ci.yml.done=Is it done? onboarding.tutorial.with.gitlab_ci.yml.done.description=You should see the page refresh itself in a few moments with your analysis results if the {link}. |