aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--server/sonar-web/src/main/js/components/tutorials/bitbucket-pipelines/AnalysisCommand.tsx19
-rw-r--r--server/sonar-web/src/main/js/components/tutorials/bitbucket-pipelines/__tests__/__snapshots__/BitbucketPipelinesTutorial-it.tsx.snap24
-rw-r--r--server/sonar-web/src/main/js/components/tutorials/components/JreRequiredWarning.tsx50
-rw-r--r--server/sonar-web/src/main/js/components/tutorials/github-action/__tests__/__snapshots__/GithubActionTutorial-it.tsx.snap16
-rw-r--r--server/sonar-web/src/main/js/components/tutorials/github-action/commands/CFamily.tsx6
-rw-r--r--server/sonar-web/src/main/js/components/tutorials/gitlabci/YmlFileStep.tsx26
-rw-r--r--server/sonar-web/src/main/js/components/tutorials/gitlabci/__tests__/GitLabCITutorial-it.tsx17
-rw-r--r--server/sonar-web/src/main/js/components/tutorials/gitlabci/__tests__/__snapshots__/GitLabCITutorial-it.tsx.snap452
-rw-r--r--server/sonar-web/src/main/js/components/tutorials/gitlabci/commands/PipeCommand.tsx87
-rw-r--r--server/sonar-web/src/main/js/components/tutorials/other/__tests__/__snapshots__/OtherTutorial-it.tsx.snap78
-rw-r--r--server/sonar-web/src/main/js/components/tutorials/other/commands/DownloadScanner.tsx25
-rw-r--r--server/sonar-web/src/main/js/components/tutorials/utils.ts23
-rw-r--r--sonar-core/src/main/resources/org/sonar/l10n/core.properties2
13 files changed, 140 insertions, 685 deletions
diff --git a/server/sonar-web/src/main/js/components/tutorials/bitbucket-pipelines/AnalysisCommand.tsx b/server/sonar-web/src/main/js/components/tutorials/bitbucket-pipelines/AnalysisCommand.tsx
index 1e9a2874bb1..fa956930e0b 100644
--- a/server/sonar-web/src/main/js/components/tutorials/bitbucket-pipelines/AnalysisCommand.tsx
+++ b/server/sonar-web/src/main/js/components/tutorials/bitbucket-pipelines/AnalysisCommand.tsx
@@ -26,8 +26,7 @@ import { Feature } from '../../../types/features';
import { Component } from '../../../types/types';
import { CompilationInfo } from '../components/CompilationInfo';
import CreateYmlFile from '../components/CreateYmlFile';
-import { JreRequiredWarning } from '../components/JreRequiredWarning';
-import { Arch, AutoConfig, BuildTools, TutorialConfig } from '../types';
+import { Arch, BuildTools, TutorialConfig } from '../types';
import { isCFamily } from '../utils';
import { PreambuleYaml } from './PreambuleYaml';
import cFamilyExample from './commands/CFamily';
@@ -61,16 +60,6 @@ const YamlTemplate: Dictionary<BuildToolExampleBuilder> = {
[BuildTools.Other]: othersExample,
};
-const showJreWarning = (config: TutorialConfig, arch: Arch) => {
- if (!isCFamily(config.buildTool)) {
- return false;
- }
- if (config.autoConfig === AutoConfig.Automatic) {
- return false;
- }
- return arch === Arch.Arm64;
-};
-
export function AnalysisCommand(props: Readonly<AnalysisCommandProps>) {
const { config, arch, mainBranchName, component } = props;
const branchesEnabled = props.hasFeature(Feature.BranchSupport);
@@ -91,11 +80,7 @@ export function AnalysisCommand(props: Readonly<AnalysisCommandProps>) {
return (
<>
<PreambuleYaml buildTool={config.buildTool} component={component} />
- <CreateYmlFile
- yamlFileName="bitbucket-pipelines.yml"
- yamlTemplate={yamlTemplate}
- warning={showJreWarning(config, arch) && <JreRequiredWarning />}
- />
+ <CreateYmlFile yamlFileName="bitbucket-pipelines.yml" yamlTemplate={yamlTemplate} />
{isCFamily(config.buildTool) && <CompilationInfo />}
</>
);
diff --git a/server/sonar-web/src/main/js/components/tutorials/bitbucket-pipelines/__tests__/__snapshots__/BitbucketPipelinesTutorial-it.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/bitbucket-pipelines/__tests__/__snapshots__/BitbucketPipelinesTutorial-it.tsx.snap
index a88b747697f..8652ad9cb41 100644
--- a/server/sonar-web/src/main/js/components/tutorials/bitbucket-pipelines/__tests__/__snapshots__/BitbucketPipelinesTutorial-it.tsx.snap
+++ b/server/sonar-web/src/main/js/components/tutorials/bitbucket-pipelines/__tests__/__snapshots__/BitbucketPipelinesTutorial-it.tsx.snap
@@ -101,13 +101,13 @@ definitions:
- step: &build-step
name: Build the project, and run the SonarQube analysis
script:
- - export SONAR_SCANNER_VERSION=6.0.0.4432
+ - export SONAR_SCANNER_VERSION=6.1.0.4477
- mkdir $HOME/.sonar
- curl -sSLo $HOME/.sonar/build-wrapper-linux-aarch64.zip \${SONAR_HOST_URL}/static/cpp/build-wrapper-linux-aarch64.zip
- unzip -o $HOME/.sonar/build-wrapper-linux-aarch64.zip -d $HOME/.sonar/
- - curl -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-\${SONAR_SCANNER_VERSION}.zip
+ - curl -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-\${SONAR_SCANNER_VERSION}-linux-aarch64.zip
- unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/
- - export PATH="$PATH:$HOME/.sonar/sonar-scanner-\${SONAR_SCANNER_VERSION}/bin"
+ - export PATH="$PATH:$HOME/.sonar/sonar-scanner-\${SONAR_SCANNER_VERSION}-linux-aarch64/bin"
- <any step required before running your build, like ./configure>
- $HOME/.sonar/build-wrapper-linux-aarch64/build-wrapper-linux-aarch64 --out-dir bw-output <your clean build command>
- sonar-scanner -Dsonar.cfamily.compile-commands=bw-output/compile_commands.json
@@ -139,13 +139,13 @@ definitions:
- step: &build-step
name: Build the project, and run the SonarQube analysis
script:
- - export SONAR_SCANNER_VERSION=6.0.0.4432
+ - export SONAR_SCANNER_VERSION=6.1.0.4477
- mkdir $HOME/.sonar
- curl -sSLo $HOME/.sonar/build-wrapper-linux-aarch64.zip \${SONAR_HOST_URL}/static/cpp/build-wrapper-linux-aarch64.zip
- unzip -o $HOME/.sonar/build-wrapper-linux-aarch64.zip -d $HOME/.sonar/
- - curl -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-\${SONAR_SCANNER_VERSION}.zip
+ - curl -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-\${SONAR_SCANNER_VERSION}-linux-aarch64.zip
- unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/
- - export PATH="$PATH:$HOME/.sonar/sonar-scanner-\${SONAR_SCANNER_VERSION}/bin"
+ - export PATH="$PATH:$HOME/.sonar/sonar-scanner-\${SONAR_SCANNER_VERSION}-linux-aarch64/bin"
- <any step required before running your build, like ./configure>
- $HOME/.sonar/build-wrapper-linux-aarch64/build-wrapper-linux-aarch64 --out-dir bw-output <your clean build command>
- sonar-scanner -Dsonar.cfamily.compile-commands=bw-output/compile_commands.json
@@ -173,13 +173,13 @@ definitions:
- step: &build-step
name: Build the project, and run the SonarQube analysis
script:
- - export SONAR_SCANNER_VERSION=6.0.0.4432
+ - export SONAR_SCANNER_VERSION=6.1.0.4477
- mkdir $HOME/.sonar
- curl -sSLo $HOME/.sonar/build-wrapper-linux-x86.zip \${SONAR_HOST_URL}/static/cpp/build-wrapper-linux-x86.zip
- unzip -o $HOME/.sonar/build-wrapper-linux-x86.zip -d $HOME/.sonar/
- - curl -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-\${SONAR_SCANNER_VERSION}-linux.zip
+ - curl -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-\${SONAR_SCANNER_VERSION}-linux-x64.zip
- unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/
- - export PATH="$PATH:$HOME/.sonar/sonar-scanner-\${SONAR_SCANNER_VERSION}-linux/bin"
+ - export PATH="$PATH:$HOME/.sonar/sonar-scanner-\${SONAR_SCANNER_VERSION}-linux-x64/bin"
- <any step required before running your build, like ./configure>
- $HOME/.sonar/build-wrapper-linux-x86/build-wrapper-linux-x86-64 --out-dir bw-output <your clean build command>
- sonar-scanner -Dsonar.cfamily.compile-commands=bw-output/compile_commands.json
@@ -211,13 +211,13 @@ definitions:
- step: &build-step
name: Build the project, and run the SonarQube analysis
script:
- - export SONAR_SCANNER_VERSION=6.0.0.4432
+ - export SONAR_SCANNER_VERSION=6.1.0.4477
- mkdir $HOME/.sonar
- curl -sSLo $HOME/.sonar/build-wrapper-linux-x86.zip \${SONAR_HOST_URL}/static/cpp/build-wrapper-linux-x86.zip
- unzip -o $HOME/.sonar/build-wrapper-linux-x86.zip -d $HOME/.sonar/
- - curl -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-\${SONAR_SCANNER_VERSION}-linux.zip
+ - curl -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-\${SONAR_SCANNER_VERSION}-linux-x64.zip
- unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/
- - export PATH="$PATH:$HOME/.sonar/sonar-scanner-\${SONAR_SCANNER_VERSION}-linux/bin"
+ - export PATH="$PATH:$HOME/.sonar/sonar-scanner-\${SONAR_SCANNER_VERSION}-linux-x64/bin"
- <any step required before running your build, like ./configure>
- $HOME/.sonar/build-wrapper-linux-x86/build-wrapper-linux-x86-64 --out-dir bw-output <your clean build command>
- sonar-scanner -Dsonar.cfamily.compile-commands=bw-output/compile_commands.json
diff --git a/server/sonar-web/src/main/js/components/tutorials/components/JreRequiredWarning.tsx b/server/sonar-web/src/main/js/components/tutorials/components/JreRequiredWarning.tsx
deleted file mode 100644
index 2b3cf62bef6..00000000000
--- a/server/sonar-web/src/main/js/components/tutorials/components/JreRequiredWarning.tsx
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2024 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 { LinkStandalone } from '@sonarsource/echoes-react';
-import { FlagMessage } from 'design-system';
-import React from 'react';
-import { FormattedMessage } from 'react-intl';
-import { DocLink } from '../../../helpers/doc-links';
-import { useDocUrl } from '../../../helpers/docs';
-import { translate } from '../../../helpers/l10n';
-
-export function JreRequiredWarning() {
- const scannerRequirementsUrl = useDocUrl(DocLink.SonarScannerRequirements);
-
- return (
- <div>
- <FlagMessage className="sw-mt-2 sw-w-abs-600" variant="warning">
- <p className="sw-mb-2">
- <FormattedMessage
- defaultMessage={translate('onboarding.analysis.sq_scanner.jre_required_warning')}
- id="onboarding.analysis.sq_scanner.jre_required_warning"
- values={{
- link: (
- <LinkStandalone to={scannerRequirementsUrl}>
- {translate('onboarding.analysis.sq_scanner.jre_required_warning.link')}
- </LinkStandalone>
- ),
- }}
- />
- </p>
- </FlagMessage>
- </div>
- );
-}
diff --git a/server/sonar-web/src/main/js/components/tutorials/github-action/__tests__/__snapshots__/GithubActionTutorial-it.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/github-action/__tests__/__snapshots__/GithubActionTutorial-it.tsx.snap
index 2ace2a276ea..182aded2f28 100644
--- a/server/sonar-web/src/main/js/components/tutorials/github-action/__tests__/__snapshots__/GithubActionTutorial-it.tsx.snap
+++ b/server/sonar-web/src/main/js/components/tutorials/github-action/__tests__/__snapshots__/GithubActionTutorial-it.tsx.snap
@@ -143,7 +143,7 @@ jobs:
- name: Install sonar-scanner and build-wrapper
env:
SONAR_HOST_URL: \${{secrets.SONAR_HOST_URL}}
- uses: SonarSource/sonarqube-github-c-cpp@v1
+ uses: SonarSource/sonarqube-github-c-cpp@v2
- name: Run build-wrapper
run: |
build-wrapper-linux-aarch64 --out-dir \${{ env.BUILD_WRAPPER_OUT_DIR }} <insert_your_clean_build_command>
@@ -179,7 +179,7 @@ jobs:
- name: Install sonar-scanner and build-wrapper
env:
SONAR_HOST_URL: \${{secrets.SONAR_HOST_URL}}
- uses: SonarSource/sonarqube-github-c-cpp@v1
+ uses: SonarSource/sonarqube-github-c-cpp@v2
- name: Run build-wrapper
run: |
build-wrapper-linux-x86-64 --out-dir \${{ env.BUILD_WRAPPER_OUT_DIR }} <insert_your_clean_build_command>
@@ -215,7 +215,7 @@ jobs:
- name: Install sonar-scanner and build-wrapper
env:
SONAR_HOST_URL: \${{secrets.SONAR_HOST_URL}}
- uses: SonarSource/sonarqube-github-c-cpp@v1
+ uses: SonarSource/sonarqube-github-c-cpp@v2
- name: Run build-wrapper
run: |
build-wrapper-macosx-x86 --out-dir \${{ env.BUILD_WRAPPER_OUT_DIR }} <insert_your_clean_build_command>
@@ -251,7 +251,7 @@ jobs:
- name: Install sonar-scanner and build-wrapper
env:
SONAR_HOST_URL: \${{secrets.SONAR_HOST_URL}}
- uses: SonarSource/sonarqube-github-c-cpp@v1
+ uses: SonarSource/sonarqube-github-c-cpp@v2
- name: Run build-wrapper
run: |
build-wrapper-win-x86-64 --out-dir \${{ env.BUILD_WRAPPER_OUT_DIR }} <insert_your_clean_build_command>
@@ -399,7 +399,7 @@ jobs:
- name: Install sonar-scanner and build-wrapper
env:
SONAR_HOST_URL: \${{secrets.SONAR_HOST_URL}}
- uses: SonarSource/sonarqube-github-c-cpp@v1
+ uses: SonarSource/sonarqube-github-c-cpp@v2
- name: Run build-wrapper
run: |
build-wrapper-linux-aarch64 --out-dir \${{ env.BUILD_WRAPPER_OUT_DIR }} <insert_your_clean_build_command>
@@ -435,7 +435,7 @@ jobs:
- name: Install sonar-scanner and build-wrapper
env:
SONAR_HOST_URL: \${{secrets.SONAR_HOST_URL}}
- uses: SonarSource/sonarqube-github-c-cpp@v1
+ uses: SonarSource/sonarqube-github-c-cpp@v2
- name: Run build-wrapper
run: |
build-wrapper-linux-x86-64 --out-dir \${{ env.BUILD_WRAPPER_OUT_DIR }} <insert_your_clean_build_command>
@@ -471,7 +471,7 @@ jobs:
- name: Install sonar-scanner and build-wrapper
env:
SONAR_HOST_URL: \${{secrets.SONAR_HOST_URL}}
- uses: SonarSource/sonarqube-github-c-cpp@v1
+ uses: SonarSource/sonarqube-github-c-cpp@v2
- name: Run build-wrapper
run: |
build-wrapper-macosx-x86 --out-dir \${{ env.BUILD_WRAPPER_OUT_DIR }} <insert_your_clean_build_command>
@@ -507,7 +507,7 @@ jobs:
- name: Install sonar-scanner and build-wrapper
env:
SONAR_HOST_URL: \${{secrets.SONAR_HOST_URL}}
- uses: SonarSource/sonarqube-github-c-cpp@v1
+ uses: SonarSource/sonarqube-github-c-cpp@v2
- name: Run build-wrapper
run: |
build-wrapper-win-x86-64 --out-dir \${{ env.BUILD_WRAPPER_OUT_DIR }} <insert_your_clean_build_command>
diff --git a/server/sonar-web/src/main/js/components/tutorials/github-action/commands/CFamily.tsx b/server/sonar-web/src/main/js/components/tutorials/github-action/commands/CFamily.tsx
index ae686befe7d..a38cc8b2f65 100644
--- a/server/sonar-web/src/main/js/components/tutorials/github-action/commands/CFamily.tsx
+++ b/server/sonar-web/src/main/js/components/tutorials/github-action/commands/CFamily.tsx
@@ -46,7 +46,7 @@ const STEPS = (os?: OSs, arch?: Arch) => {
- name: Install sonar-scanner and build-wrapper
env:
SONAR_HOST_URL: \${{secrets.SONAR_HOST_URL}}
- uses: SonarSource/sonarqube-github-c-cpp@v1
+ uses: SonarSource/sonarqube-github-c-cpp@v2
- name: Run build-wrapper
run: |
${getBuildWrapperExecutableLinux(arch)} --out-dir \${{ env.BUILD_WRAPPER_OUT_DIR }} <insert_your_clean_build_command>
@@ -62,7 +62,7 @@ const STEPS = (os?: OSs, arch?: Arch) => {
- name: Install sonar-scanner and build-wrapper
env:
SONAR_HOST_URL: \${{secrets.SONAR_HOST_URL}}
- uses: SonarSource/sonarqube-github-c-cpp@v1
+ uses: SonarSource/sonarqube-github-c-cpp@v2
- name: Run build-wrapper
run: |
build-wrapper-macosx-x86 --out-dir \${{ env.BUILD_WRAPPER_OUT_DIR }} <insert_your_clean_build_command>
@@ -78,7 +78,7 @@ const STEPS = (os?: OSs, arch?: Arch) => {
- name: Install sonar-scanner and build-wrapper
env:
SONAR_HOST_URL: \${{secrets.SONAR_HOST_URL}}
- uses: SonarSource/sonarqube-github-c-cpp@v1
+ uses: SonarSource/sonarqube-github-c-cpp@v2
- name: Run build-wrapper
run: |
build-wrapper-win-x86-64 --out-dir \${{ env.BUILD_WRAPPER_OUT_DIR }} <insert_your_clean_build_command>
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 fd25ce98de3..992c09c3ca7 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
@@ -38,14 +38,9 @@ import BuildConfigSelection from '../components/BuildConfigSelection';
import GithubCFamilyExampleRepositories from '../components/GithubCFamilyExampleRepositories';
import GradleBuildSelection from '../components/GradleBuildSelection';
import { InlineSnippet } from '../components/InlineSnippet';
-import { JreRequiredWarning } from '../components/JreRequiredWarning';
import RenderOptions from '../components/RenderOptions';
import { Arch, BuildTools, GradleBuildDSL, OSs, TutorialConfig, TutorialModes } from '../types';
-import {
- shouldShowArchSelector,
- shouldShowGithubCFamilyExampleRepositories,
- showJreWarning,
-} from '../utils';
+import { shouldShowArchSelector, shouldShowGithubCFamilyExampleRepositories } from '../utils';
import PipeCommand from './commands/PipeCommand';
export interface YmlFileStepProps extends WithAvailableFeaturesProps {
@@ -118,7 +113,6 @@ const snippetLanguageForBuildTool = {
export function YmlFileStep(props: Readonly<YmlFileStepProps>) {
const { component, hasCLanguageFeature, setDone } = props;
- const [os, setOs] = React.useState<OSs>(OSs.Linux);
const [arch, setArch] = React.useState<Arch>(Arch.X86_64);
const [config, setConfig] = React.useState<TutorialConfig>({});
@@ -141,19 +135,7 @@ export function YmlFileStep(props: Readonly<YmlFileStepProps>) {
supportCFamily={hasCLanguageFeature}
onSetConfig={onSetConfig}
/>
- {(config.buildTool === BuildTools.Other ||
- config.buildTool === BuildTools.Cpp ||
- config.buildTool === BuildTools.ObjectiveC) && (
- <RenderOptions
- label={translate('onboarding.build.other.os')}
- checked={os}
- onCheck={(value: OSs) => setOs(value)}
- optionLabelKey="onboarding.build.other.os"
- options={[OSs.Linux, OSs.Windows, OSs.MacOS]}
- titleLabelKey="onboarding.build.other.os"
- />
- )}
- {shouldShowArchSelector(os, config) && (
+ {shouldShowArchSelector(OSs.Linux, config) && (
<RenderOptions
label={translate('onboarding.build.other.architecture')}
checked={arch}
@@ -250,13 +232,11 @@ export function YmlFileStep(props: Readonly<YmlFileStepProps>) {
),
}}
/>
- {showJreWarning(config, arch) && <JreRequiredWarning />}
<PipeCommand
buildTool={buildTool}
projectKey={component.key}
- os={os}
- arch={arch}
+ arch={shouldShowArchSelector(OSs.Linux, config) ? arch : Arch.X86_64}
config={config}
/>
diff --git a/server/sonar-web/src/main/js/components/tutorials/gitlabci/__tests__/GitLabCITutorial-it.tsx b/server/sonar-web/src/main/js/components/tutorials/gitlabci/__tests__/GitLabCITutorial-it.tsx
index 97860958469..fc5ac5c8a7e 100644
--- a/server/sonar-web/src/main/js/components/tutorials/gitlabci/__tests__/GitLabCITutorial-it.tsx
+++ b/server/sonar-web/src/main/js/components/tutorials/gitlabci/__tests__/GitLabCITutorial-it.tsx
@@ -81,30 +81,13 @@ it('should follow and complete all steps', async () => {
// C++/Objective-C
await user.click(ui.cppBuildButton.get());
- //linux
expect(getCopyToClipboardValue(0, 'Copy')).toMatchSnapshot('CPP: sonar-project.properties');
expect(getCopyToClipboardValue(1, 'Copy')).toMatchSnapshot('CPP: gitlab-ci.yml');
- //windows
- await user.click(ui.windowsButton.get());
- expect(getCopyToClipboardValue(1, 'Copy')).toMatchSnapshot('CPP - windows: gitlab-ci.yml');
- //macos
- await user.click(ui.macosButton.get());
- expect(getCopyToClipboardValue(1, 'Copy')).toMatchSnapshot('CPP - macos: gitlab-ci.yml');
// c++ manual config
await user.click(ui.autoConfigManual.get());
-
- //linux
- await user.click(ui.linuxButton.get());
expect(getCopyToClipboardValue(1, 'Copy')).toMatchSnapshot('CPP - manual: gitlab-ci.yml');
- //windows
- await user.click(ui.windowsButton.get());
- expect(getCopyToClipboardValue(1, 'Copy')).toMatchSnapshot('CPP - windows: gitlab-ci.yml');
- //macos
- await user.click(ui.macosButton.get());
- expect(getCopyToClipboardValue(1, 'Copy')).toMatchSnapshot('CPP - macos: gitlab-ci.yml');
-
// Other
await user.click(ui.otherBuildButton.get());
expect(getCopyToClipboardValue(0, 'Copy')).toMatchSnapshot('Other: sonar-project.properties');
diff --git a/server/sonar-web/src/main/js/components/tutorials/gitlabci/__tests__/__snapshots__/GitLabCITutorial-it.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/gitlabci/__tests__/__snapshots__/GitLabCITutorial-it.tsx.snap
index 304f4025ddc..c2e41a10cbc 100644
--- a/server/sonar-web/src/main/js/components/tutorials/gitlabci/__tests__/__snapshots__/GitLabCITutorial-it.tsx.snap
+++ b/server/sonar-web/src/main/js/components/tutorials/gitlabci/__tests__/__snapshots__/GitLabCITutorial-it.tsx.snap
@@ -13,16 +13,7 @@ stages:
sonarqube-check:
stage: sonarqube-check
- dependencies:
- - get-binaries
- - build
- cache:
- policy: pull
- key: "\${CI_COMMIT_SHORT_SHA}"
- paths:
- - sonar-scanner/
-
-
+
script:
- "apt-get update"
- "apt-get install --yes --no-install-recommends openjdk-17-jre"
@@ -55,180 +46,6 @@ sonarqube-vulnerability-report:
"
`;
-exports[`should follow and complete all steps: CPP - macos: gitlab-ci.yml 1`] = `
-"image: gcc
-
-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
-
-
-stages:
- - get-binaries
- - build
- - sonarqube-check
- - sonarqube-vulnerability-report
-
-get-binaries:
- stage: get-binaries
- cache:
- policy: push
- key: "\${CI_COMMIT_SHORT_SHA}"
- paths:
- - sonar-scanner/
-
- script:
- # Download sonar-scanner
- - curl -sSLo ./sonar-scanner.zip 'https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-6.0.0.4432-macosx.zip'
- - unzip -o sonar-scanner.zip
- - mv sonar-scanner-6.0.0.4432-macosx sonar-scanner
-
-
- rules:
- - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
- - if: $CI_COMMIT_BRANCH == 'master'
- - if: $CI_COMMIT_BRANCH == 'main'
- - if: $CI_COMMIT_BRANCH == 'develop'
-
-build:
- stage: build
- script:
- # prepare the build tree
- - mkdir build
-
- cache:
- policy: pull-push
- key: "\${CI_COMMIT_SHORT_SHA}"
- paths:
- - sonar-scanner/
-
-
-sonarqube-check:
- stage: sonarqube-check
- dependencies:
- - get-binaries
- - build
- cache:
- policy: pull
- key: "\${CI_COMMIT_SHORT_SHA}"
- paths:
- - sonar-scanner/
-
-
- script: sonar-scanner/bin/sonar-scanner --define sonar.host.url="\${SONAR_HOST_URL}"
- allow_failure: true
- rules:
- - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
- - if: $CI_COMMIT_BRANCH == 'master'
- - if: $CI_COMMIT_BRANCH == 'main'
- - if: $CI_COMMIT_BRANCH == 'develop'
-
-sonarqube-vulnerability-report:
- stage: sonarqube-vulnerability-report
- script:
- - 'curl -u "\${SONAR_TOKEN}:" "\${SONAR_HOST_URL}/api/issues/gitlab_sast_export?projectKey=my-project&branch=\${CI_COMMIT_BRANCH}&pullRequest=\${CI_MERGE_REQUEST_IID}" -o gl-sast-sonar-report.json'
- allow_failure: true
- rules:
- - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
- - if: $CI_COMMIT_BRANCH == 'master'
- - if: $CI_COMMIT_BRANCH == 'main'
- - if: $CI_COMMIT_BRANCH == 'develop'
- artifacts:
- expire_in: 1 day
- reports:
- sast: gl-sast-sonar-report.json
-"
-`;
-
-exports[`should follow and complete all steps: CPP - macos: gitlab-ci.yml 2`] = `
-"image: gcc
-
-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
- BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed
-
-stages:
- - get-binaries
- - build
- - sonarqube-check
- - sonarqube-vulnerability-report
-
-get-binaries:
- stage: get-binaries
- cache:
- policy: push
- key: "\${CI_COMMIT_SHORT_SHA}"
- paths:
- - sonar-scanner/
- - build-wrapper/
- script:
- # Download sonar-scanner
- - curl -sSLo ./sonar-scanner.zip 'https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-6.0.0.4432-macosx.zip'
- - unzip -o sonar-scanner.zip
- - mv sonar-scanner-6.0.0.4432-macosx sonar-scanner
- # Download build-wrapper
- - curl -sSLo ./build-wrapper-macosx-x86.zip "$SONAR_HOST_URL/static/cpp/build-wrapper-macosx-x86.zip"
- - unzip -o build-wrapper-macosx-x86.zip
- - mv build-wrapper-macosx-x86 build-wrapper
-
- rules:
- - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
- - if: $CI_COMMIT_BRANCH == 'master'
- - if: $CI_COMMIT_BRANCH == 'main'
- - if: $CI_COMMIT_BRANCH == 'develop'
-
-build:
- stage: build
- script:
- # prepare the build tree
- - mkdir build
- - build-wrapper/build-wrapper-macosx-x86 --out-dir "\${BUILD_WRAPPER_OUT_DIR}" <your clean build command>
- cache:
- policy: pull-push
- key: "\${CI_COMMIT_SHORT_SHA}"
- paths:
- - sonar-scanner/
- - build-wrapper/
- - "\${BUILD_WRAPPER_OUT_DIR}"
-
-sonarqube-check:
- stage: sonarqube-check
- dependencies:
- - get-binaries
- - build
- cache:
- policy: pull
- key: "\${CI_COMMIT_SHORT_SHA}"
- paths:
- - sonar-scanner/
- - "\${BUILD_WRAPPER_OUT_DIR}"
-
- script: sonar-scanner/bin/sonar-scanner --define sonar.host.url="\${SONAR_HOST_URL}"
- allow_failure: true
- rules:
- - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
- - if: $CI_COMMIT_BRANCH == 'master'
- - if: $CI_COMMIT_BRANCH == 'main'
- - if: $CI_COMMIT_BRANCH == 'develop'
-
-sonarqube-vulnerability-report:
- stage: sonarqube-vulnerability-report
- script:
- - 'curl -u "\${SONAR_TOKEN}:" "\${SONAR_HOST_URL}/api/issues/gitlab_sast_export?projectKey=my-project&branch=\${CI_COMMIT_BRANCH}&pullRequest=\${CI_MERGE_REQUEST_IID}" -o gl-sast-sonar-report.json'
- allow_failure: true
- rules:
- - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
- - if: $CI_COMMIT_BRANCH == 'master'
- - if: $CI_COMMIT_BRANCH == 'main'
- - if: $CI_COMMIT_BRANCH == 'develop'
- artifacts:
- expire_in: 1 day
- reports:
- sast: gl-sast-sonar-report.json
-"
-`;
-
exports[`should follow and complete all steps: CPP - manual: gitlab-ci.yml 1`] = `
"image: gcc
@@ -239,8 +56,7 @@ variables:
stages:
- get-binaries
- - build
- - sonarqube-check
+ - build-analyze
- sonarqube-vulnerability-report
get-binaries:
@@ -253,100 +69,14 @@ get-binaries:
- build-wrapper/
script:
# Download sonar-scanner
- - curl -sSLo ./sonar-scanner.zip 'https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-6.0.0.4432-linux.zip'
+ - curl -sSLo ./sonar-scanner.zip 'https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-6.1.0.4477-linux-x64.zip'
- unzip -o sonar-scanner.zip
- - mv sonar-scanner-6.0.0.4432-linux sonar-scanner
+ - mv sonar-scanner-6.1.0.4477-linux-x64 sonar-scanner
# Download build-wrapper
- curl -sSLo ./build-wrapper-linux-x86.zip "$SONAR_HOST_URL/static/cpp/build-wrapper-linux-x86.zip"
- unzip -o build-wrapper-linux-x86.zip
- mv build-wrapper-linux-x86 build-wrapper
-
- rules:
- - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
- - if: $CI_COMMIT_BRANCH == 'master'
- - if: $CI_COMMIT_BRANCH == 'main'
- - if: $CI_COMMIT_BRANCH == 'develop'
-
-build:
- stage: build
- script:
- # prepare the build tree
- - mkdir build
- - build-wrapper/build-wrapper-linux-x86-64 --out-dir "\${BUILD_WRAPPER_OUT_DIR}" <your clean build command>
- cache:
- policy: pull-push
- key: "\${CI_COMMIT_SHORT_SHA}"
- paths:
- - sonar-scanner/
- - build-wrapper/
- - "\${BUILD_WRAPPER_OUT_DIR}"
-sonarqube-check:
- stage: sonarqube-check
- dependencies:
- - get-binaries
- - build
- cache:
- policy: pull
- key: "\${CI_COMMIT_SHORT_SHA}"
- paths:
- - sonar-scanner/
- - "\${BUILD_WRAPPER_OUT_DIR}"
-
- script: sonar-scanner/bin/sonar-scanner --define sonar.host.url="\${SONAR_HOST_URL}"
- allow_failure: true
- rules:
- - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
- - if: $CI_COMMIT_BRANCH == 'master'
- - if: $CI_COMMIT_BRANCH == 'main'
- - if: $CI_COMMIT_BRANCH == 'develop'
-
-sonarqube-vulnerability-report:
- stage: sonarqube-vulnerability-report
- script:
- - 'curl -u "\${SONAR_TOKEN}:" "\${SONAR_HOST_URL}/api/issues/gitlab_sast_export?projectKey=my-project&branch=\${CI_COMMIT_BRANCH}&pullRequest=\${CI_MERGE_REQUEST_IID}" -o gl-sast-sonar-report.json'
- allow_failure: true
- rules:
- - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
- - if: $CI_COMMIT_BRANCH == 'master'
- - if: $CI_COMMIT_BRANCH == 'main'
- - if: $CI_COMMIT_BRANCH == 'develop'
- artifacts:
- expire_in: 1 day
- reports:
- sast: gl-sast-sonar-report.json
-"
-`;
-
-exports[`should follow and complete all steps: CPP - windows: gitlab-ci.yml 1`] = `
-"image: gcc
-
-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
-
-
-stages:
- - get-binaries
- - build
- - sonarqube-check
- - sonarqube-vulnerability-report
-
-get-binaries:
- stage: get-binaries
- cache:
- policy: push
- key: "\${CI_COMMIT_SHORT_SHA}"
- paths:
- - sonar-scanner/
-
- script:
- # Download sonar-scanner
- - curl -sSLo ./sonar-scanner.zip 'https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-6.0.0.4432-windows.zip'
- - unzip -o sonar-scanner.zip
- - mv sonar-scanner-6.0.0.4432-windows sonar-scanner
-
-
rules:
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
- if: $CI_COMMIT_BRANCH == 'master'
@@ -354,126 +84,16 @@ get-binaries:
- if: $CI_COMMIT_BRANCH == 'develop'
build:
- stage: build
+ stage: build-analyze
script:
- # prepare the build tree
- - mkdir build
-
- cache:
- policy: pull-push
- key: "\${CI_COMMIT_SHORT_SHA}"
- paths:
- - sonar-scanner/
-
-
-sonarqube-check:
- stage: sonarqube-check
- dependencies:
- - get-binaries
- - build
+ - build-wrapper/build-wrapper-linux-x86-64 --out-dir "\${BUILD_WRAPPER_OUT_DIR}" <your clean build command>
+ - sonar-scanner/bin/sonar-scanner --define sonar.host.url="\${SONAR_HOST_URL}" --define sonar.cfamily.compile-commands="\${BUILD_WRAPPER_OUT_DIR}/compile_commands.json"
cache:
policy: pull
key: "\${CI_COMMIT_SHORT_SHA}"
paths:
- - sonar-scanner/
-
-
- script: sonar-scanner/bin/sonar-scanner --define sonar.host.url="\${SONAR_HOST_URL}"
- allow_failure: true
- rules:
- - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
- - if: $CI_COMMIT_BRANCH == 'master'
- - if: $CI_COMMIT_BRANCH == 'main'
- - if: $CI_COMMIT_BRANCH == 'develop'
-
-sonarqube-vulnerability-report:
- stage: sonarqube-vulnerability-report
- script:
- - 'curl -u "\${SONAR_TOKEN}:" "\${SONAR_HOST_URL}/api/issues/gitlab_sast_export?projectKey=my-project&branch=\${CI_COMMIT_BRANCH}&pullRequest=\${CI_MERGE_REQUEST_IID}" -o gl-sast-sonar-report.json'
- allow_failure: true
- rules:
- - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
- - if: $CI_COMMIT_BRANCH == 'master'
- - if: $CI_COMMIT_BRANCH == 'main'
- - if: $CI_COMMIT_BRANCH == 'develop'
- artifacts:
- expire_in: 1 day
- reports:
- sast: gl-sast-sonar-report.json
-"
-`;
-
-exports[`should follow and complete all steps: CPP - windows: gitlab-ci.yml 2`] = `
-"image: gcc
-
-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
- BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed
-
-stages:
- - get-binaries
- - build
- - sonarqube-check
- - sonarqube-vulnerability-report
-
-get-binaries:
- stage: get-binaries
- cache:
- policy: push
- key: "\${CI_COMMIT_SHORT_SHA}"
- paths:
- - sonar-scanner/
- - build-wrapper/
- script:
- # Download sonar-scanner
- - curl -sSLo ./sonar-scanner.zip 'https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-6.0.0.4432-windows.zip'
- - unzip -o sonar-scanner.zip
- - mv sonar-scanner-6.0.0.4432-windows sonar-scanner
- # Download build-wrapper
- - curl -sSLo ./build-wrapper-win-x86.zip "$SONAR_HOST_URL/static/cpp/build-wrapper-win-x86.zip"
- - unzip -o build-wrapper-win-x86.zip
- - mv build-wrapper-win-x86 build-wrapper
-
- rules:
- - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
- - if: $CI_COMMIT_BRANCH == 'master'
- - if: $CI_COMMIT_BRANCH == 'main'
- - if: $CI_COMMIT_BRANCH == 'develop'
-
-build:
- stage: build
- script:
- # prepare the build tree
- - mkdir build
- - build-wrapper/build-wrapper-win-x86-64.exe --out-dir "\${BUILD_WRAPPER_OUT_DIR}" <your clean build command>
- cache:
- policy: pull-push
- key: "\${CI_COMMIT_SHORT_SHA}"
- paths:
- sonar-scanner/
- build-wrapper/
- - "\${BUILD_WRAPPER_OUT_DIR}"
-
-sonarqube-check:
- stage: sonarqube-check
- dependencies:
- - get-binaries
- - build
- cache:
- policy: pull
- key: "\${CI_COMMIT_SHORT_SHA}"
- paths:
- - sonar-scanner/
- - "\${BUILD_WRAPPER_OUT_DIR}"
-
- script: sonar-scanner/bin/sonar-scanner --define sonar.host.url="\${SONAR_HOST_URL}"
- allow_failure: true
- rules:
- - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
- - if: $CI_COMMIT_BRANCH == 'master'
- - if: $CI_COMMIT_BRANCH == 'main'
- - if: $CI_COMMIT_BRANCH == 'develop'
sonarqube-vulnerability-report:
stage: sonarqube-vulnerability-report
@@ -502,7 +122,6 @@ variables:
stages:
- get-binaries
- - build
- sonarqube-check
- sonarqube-vulnerability-report
@@ -516,42 +135,26 @@ get-binaries:
script:
# Download sonar-scanner
- - curl -sSLo ./sonar-scanner.zip 'https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-6.0.0.4432-linux.zip'
+ - curl -sSLo ./sonar-scanner.zip 'https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-6.1.0.4477-linux-x64.zip'
- unzip -o sonar-scanner.zip
- - mv sonar-scanner-6.0.0.4432-linux sonar-scanner
+ - mv sonar-scanner-6.1.0.4477-linux-x64 sonar-scanner
-
rules:
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
- if: $CI_COMMIT_BRANCH == 'master'
- if: $CI_COMMIT_BRANCH == 'main'
- if: $CI_COMMIT_BRANCH == 'develop'
-build:
- stage: build
- script:
- # prepare the build tree
- - mkdir build
-
- cache:
- policy: pull-push
- key: "\${CI_COMMIT_SHORT_SHA}"
- paths:
- - sonar-scanner/
-
-
sonarqube-check:
stage: sonarqube-check
dependencies:
- get-binaries
- - build
cache:
policy: pull
key: "\${CI_COMMIT_SHORT_SHA}"
paths:
- sonar-scanner/
-
-
+
script: sonar-scanner/bin/sonar-scanner --define sonar.host.url="\${SONAR_HOST_URL}"
allow_failure: true
rules:
@@ -596,16 +199,7 @@ stages:
sonarqube-check:
stage: sonarqube-check
- dependencies:
- - get-binaries
- - build
- cache:
- policy: pull
- key: "\${CI_COMMIT_SHORT_SHA}"
- paths:
- - sonar-scanner/
-
-
+
script: gradle sonar
allow_failure: true
rules:
@@ -672,16 +266,7 @@ stages:
sonarqube-check:
stage: sonarqube-check
- dependencies:
- - get-binaries
- - build
- cache:
- policy: pull
- key: "\${CI_COMMIT_SHORT_SHA}"
- paths:
- - sonar-scanner/
-
-
+
script:
- mvn verify sonar:sonar
allow_failure: true
@@ -731,18 +316,9 @@ stages:
sonarqube-check:
stage: sonarqube-check
- dependencies:
- - get-binaries
- - build
- cache:
- policy: pull
- key: "\${CI_COMMIT_SHORT_SHA}"
- paths:
- - sonar-scanner/
-
-
+
script:
- - sonar-scanner
+ - sonar-scanner --define sonar.host.url="\${SONAR_HOST_URL}"
allow_failure: true
rules:
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
diff --git a/server/sonar-web/src/main/js/components/tutorials/gitlabci/commands/PipeCommand.tsx b/server/sonar-web/src/main/js/components/tutorials/gitlabci/commands/PipeCommand.tsx
index ed1a2df2780..0e819d263f7 100644
--- a/server/sonar-web/src/main/js/components/tutorials/gitlabci/commands/PipeCommand.tsx
+++ b/server/sonar-web/src/main/js/components/tutorials/gitlabci/commands/PipeCommand.tsx
@@ -23,17 +23,17 @@ import { CompilationInfo } from '../../components/CompilationInfo';
import { Arch, AutoConfig, BuildTools, OSs, TutorialConfig } from '../../types';
import {
SONAR_SCANNER_CLI_LATEST_VERSION,
- getBuildWrapperExecutable,
- getBuildWrapperFolder,
+ getBuildWrapperExecutableLinux,
+ getBuildWrapperFolderLinux,
getScannerUrlSuffix,
isCFamily,
+ shouldFetchBuildWrapper,
} from '../../utils';
export interface PipeCommandProps {
arch: Arch;
buildTool: BuildTools;
config: TutorialConfig;
- os: OSs;
projectKey: string;
}
@@ -67,30 +67,35 @@ const BUILD_TOOL_SPECIFIC: {
},
[BuildTools.Cpp]: {
image: 'gcc',
- script: (autoConfig?: AutoConfig) =>
- `sonar-scanner/bin/sonar-scanner --define sonar.host.url="\${SONAR_HOST_URL}" ${autoConfig === AutoConfig.Manual ? `--define sonar.cfamily.compile-commands="\${BUILD_WRAPPER_OUT_DIR}/compile_commands.json"` : ''}`,
+ script: (_, autoConfig?: AutoConfig) =>
+ `sonar-scanner/bin/sonar-scanner --define sonar.host.url="\${SONAR_HOST_URL}" ` +
+ (autoConfig === AutoConfig.Manual
+ ? `--define sonar.cfamily.compile-commands="\${BUILD_WRAPPER_OUT_DIR}/compile_commands.json"`
+ : ''),
},
[BuildTools.ObjectiveC]: {
image: 'gcc',
- script: (autoConfig?: AutoConfig) =>
- `sonar-scanner/bin/sonar-scanner --define sonar.host.url="\${SONAR_HOST_URL}" ${autoConfig === AutoConfig.Manual ? `--define sonar.cfamily.compile-commands="\${BUILD_WRAPPER_OUT_DIR}/compile_commands.json"` : ''}`,
+ script: (_) =>
+ `sonar-scanner/bin/sonar-scanner --define sonar.host.url="\${SONAR_HOST_URL}" ` +
+ `--define sonar.cfamily.compile-commands="\${BUILD_WRAPPER_OUT_DIR}/compile_commands.json"`,
},
[BuildTools.Other]: {
image: `
name: sonarsource/sonar-scanner-cli:latest
entrypoint: [""]`,
script: () => `
- - sonar-scanner`,
+ - sonar-scanner --define sonar.host.url="\${SONAR_HOST_URL}"`,
},
};
export default function PipeCommand(props: Readonly<PipeCommandProps>) {
- const { projectKey, buildTool, config, os, arch } = props;
+ const { projectKey, buildTool, config, arch } = props;
const { autoConfig } = config;
const { image, script } = BUILD_TOOL_SPECIFIC[buildTool];
- const suffix = getScannerUrlSuffix(os, arch);
+ const suffix = getScannerUrlSuffix(OSs.Linux, arch);
+ const buildWrapperFolder = getBuildWrapperFolderLinux(arch);
const getBinaries = `get-binaries:
stage: get-binaries
@@ -99,61 +104,53 @@ export default function PipeCommand(props: Readonly<PipeCommandProps>) {
key: "\${CI_COMMIT_SHORT_SHA}"
paths:
- sonar-scanner/
- ${autoConfig === AutoConfig.Manual ? `- build-wrapper/` : ''}
+ ${shouldFetchBuildWrapper(buildTool, autoConfig) ? `- build-wrapper/` : ''}
script:
# Download sonar-scanner
- curl -sSLo ./sonar-scanner.zip 'https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-${SONAR_SCANNER_CLI_LATEST_VERSION}${suffix}.zip'
- unzip -o sonar-scanner.zip
- mv sonar-scanner-${SONAR_SCANNER_CLI_LATEST_VERSION}${suffix} sonar-scanner
${
- autoConfig === AutoConfig.Manual
+ shouldFetchBuildWrapper(buildTool, autoConfig)
? `# Download build-wrapper
- - curl -sSLo ./${getBuildWrapperFolder(os, arch)}.zip "$SONAR_HOST_URL/static/cpp/${getBuildWrapperFolder(os, arch)}.zip"
- - unzip -o ${getBuildWrapperFolder(os, arch)}.zip
- - mv ${getBuildWrapperFolder(os, arch)} build-wrapper`
+ - curl -sSLo ./${buildWrapperFolder}.zip "$SONAR_HOST_URL/static/cpp/${buildWrapperFolder}.zip"
+ - unzip -o ${buildWrapperFolder}.zip
+ - mv ${buildWrapperFolder} build-wrapper
+`
: ''
}
-
rules:
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
- if: $CI_COMMIT_BRANCH == 'master'
- if: $CI_COMMIT_BRANCH == 'main'
- if: $CI_COMMIT_BRANCH == 'develop'`;
- const build = `build:
- stage: build
+ const buildAnalyze = `build:
+ stage: build-analyze
script:
- # prepare the build tree
- - mkdir build
- ${
- autoConfig === AutoConfig.Manual
- ? `- build-wrapper/${getBuildWrapperExecutable(os, arch)} --out-dir "\${BUILD_WRAPPER_OUT_DIR}" <your clean build command>`
- : ''
- }
+ - build-wrapper/${getBuildWrapperExecutableLinux(arch)} --out-dir "\${BUILD_WRAPPER_OUT_DIR}" <your clean build command>
+ - ${script(projectKey, autoConfig)}
cache:
- policy: pull-push
+ policy: pull
key: "\${CI_COMMIT_SHORT_SHA}"
paths:
- sonar-scanner/
- ${
- autoConfig === AutoConfig.Manual
- ? `- build-wrapper/
- - "\${BUILD_WRAPPER_OUT_DIR}"`
- : ''
- }`;
+ - build-wrapper/`;
const sonarqubeCheck = `sonarqube-check:
stage: sonarqube-check
- dependencies:
+ ${
+ isCFamily(buildTool)
+ ? `dependencies:
- get-binaries
- - build
cache:
policy: pull
key: "\${CI_COMMIT_SHORT_SHA}"
paths:
- sonar-scanner/
- ${autoConfig === AutoConfig.Manual ? `- "\${BUILD_WRAPPER_OUT_DIR}"` : ''}
-
+`
+ : ''
+ }
script: ${script(projectKey, autoConfig)}
allow_failure: true
rules:
@@ -178,13 +175,21 @@ export default function PipeCommand(props: Readonly<PipeCommandProps>) {
sast: gl-sast-sonar-report.json
`;
- let stageDeclaration = ['sonarqube-check', 'sonarqube-vulnerability-report'];
- let stages = [sonarqubeCheck, vulnerabilityReport];
+ let stageDeclaration = ['sonarqube-vulnerability-report'];
+ let stages = [vulnerabilityReport];
- if (buildTool === BuildTools.Cpp || buildTool === BuildTools.ObjectiveC) {
+ if (shouldFetchBuildWrapper(buildTool, autoConfig)) {
// only for c-family languages on manual configuration
- stages = [getBinaries, build, ...stages];
- stageDeclaration = ['get-binaries', 'build', ...stageDeclaration];
+ stages = [buildAnalyze, ...stages];
+ stageDeclaration = ['build-analyze', ...stageDeclaration];
+ } else {
+ stages = [sonarqubeCheck, ...stages];
+ stageDeclaration = ['sonarqube-check', ...stageDeclaration];
+ }
+
+ if (isCFamily(buildTool)) {
+ stages = [getBinaries, ...stages];
+ stageDeclaration = ['get-binaries', ...stageDeclaration];
}
const stageDefinition =
diff --git a/server/sonar-web/src/main/js/components/tutorials/other/__tests__/__snapshots__/OtherTutorial-it.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/other/__tests__/__snapshots__/OtherTutorial-it.tsx.snap
index 2ae0900ed2d..fce78d03bc7 100644
--- a/server/sonar-web/src/main/js/components/tutorials/other/__tests__/__snapshots__/OtherTutorial-it.tsx.snap
+++ b/server/sonar-web/src/main/js/components/tutorials/other/__tests__/__snapshots__/OtherTutorial-it.tsx.snap
@@ -1,9 +1,9 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`can choose build tools and copy provided settings: c++ (automatic) and other linux arm64: download scanner 1`] = `
-"export SONAR_SCANNER_VERSION=6.0.0.4432
-export SONAR_SCANNER_HOME=$HOME/.sonar/sonar-scanner-$SONAR_SCANNER_VERSION
-curl --create-dirs -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$SONAR_SCANNER_VERSION.zip
+"export SONAR_SCANNER_VERSION=6.1.0.4477
+export SONAR_SCANNER_HOME=$HOME/.sonar/sonar-scanner-$SONAR_SCANNER_VERSION-linux-aarch64
+curl --create-dirs -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$SONAR_SCANNER_VERSION-linux-aarch64.zip
unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/
export PATH=$SONAR_SCANNER_HOME/bin:$PATH
export SONAR_SCANNER_OPTS="-server"
@@ -18,9 +18,9 @@ exports[`can choose build tools and copy provided settings: c++ (automatic) and
`;
exports[`can choose build tools and copy provided settings: c++ (automatic) and other linux: download scanner 1`] = `
-"export SONAR_SCANNER_VERSION=6.0.0.4432
-export SONAR_SCANNER_HOME=$HOME/.sonar/sonar-scanner-$SONAR_SCANNER_VERSION-linux
-curl --create-dirs -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$SONAR_SCANNER_VERSION-linux.zip
+"export SONAR_SCANNER_VERSION=6.1.0.4477
+export SONAR_SCANNER_HOME=$HOME/.sonar/sonar-scanner-$SONAR_SCANNER_VERSION-linux-x64
+curl --create-dirs -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$SONAR_SCANNER_VERSION-linux-x64.zip
unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/
export PATH=$SONAR_SCANNER_HOME/bin:$PATH
export SONAR_SCANNER_OPTS="-server"
@@ -35,9 +35,9 @@ exports[`can choose build tools and copy provided settings: c++ (automatic) and
`;
exports[`can choose build tools and copy provided settings: c++ (automatic) and other linux: execute scanner 2`] = `
-"export SONAR_SCANNER_VERSION=6.0.0.4432
-export SONAR_SCANNER_HOME=$HOME/.sonar/sonar-scanner-$SONAR_SCANNER_VERSION-linux
-curl --create-dirs -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$SONAR_SCANNER_VERSION-linux.zip
+"export SONAR_SCANNER_VERSION=6.1.0.4477
+export SONAR_SCANNER_HOME=$HOME/.sonar/sonar-scanner-$SONAR_SCANNER_VERSION-linux-x64
+curl --create-dirs -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$SONAR_SCANNER_VERSION-linux-x64.zip
unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/
export PATH=$SONAR_SCANNER_HOME/bin:$PATH
export SONAR_SCANNER_OPTS="-server"
@@ -52,9 +52,9 @@ exports[`can choose build tools and copy provided settings: c++ (automatic) and
`;
exports[`can choose build tools and copy provided settings: c++ (automatic) and other macos: execute scanner 2`] = `
-"export SONAR_SCANNER_VERSION=6.0.0.4432
-export SONAR_SCANNER_HOME=$HOME/.sonar/sonar-scanner-$SONAR_SCANNER_VERSION-macosx
-curl --create-dirs -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$SONAR_SCANNER_VERSION-macosx.zip
+"export SONAR_SCANNER_VERSION=6.1.0.4477
+export SONAR_SCANNER_HOME=$HOME/.sonar/sonar-scanner-$SONAR_SCANNER_VERSION-macosx-x64
+curl --create-dirs -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$SONAR_SCANNER_VERSION-macosx-x64.zip
unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/
export PATH=$SONAR_SCANNER_HOME/bin:$PATH
export SONAR_SCANNER_OPTS="-server"
@@ -64,12 +64,12 @@ export SONAR_SCANNER_OPTS="-server"
exports[`can choose build tools and copy provided settings: c++ (automatic) and other windows: execute scanner 1`] = `"sonar-scanner.bat -D"sonar.projectKey=my-project" -D"sonar.sources=." -D"sonar.host.url=http://localhost:9000""`;
exports[`can choose build tools and copy provided settings: c++ (automatic) and other windows: execute scanner 2`] = `
-"$env:SONAR_SCANNER_VERSION = "6.0.0.4432"
+"$env:SONAR_SCANNER_VERSION = "6.1.0.4477"
$env:SONAR_DIRECTORY = [System.IO.Path]::Combine($(get-location).Path,".sonar")
-$env:SONAR_SCANNER_HOME = "$env:SONAR_DIRECTORY/sonar-scanner-$env:SONAR_SCANNER_VERSION-windows"
+$env:SONAR_SCANNER_HOME = "$env:SONAR_DIRECTORY/sonar-scanner-$env:SONAR_SCANNER_VERSION-windows-x64"
rm $env:SONAR_SCANNER_HOME -Force -Recurse -ErrorAction SilentlyContinue
New-Item -path $env:SONAR_SCANNER_HOME -type directory
-(New-Object System.Net.WebClient).DownloadFile("https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$env:SONAR_SCANNER_VERSION-windows.zip", "$env:SONAR_DIRECTORY/sonar-scanner.zip")
+(New-Object System.Net.WebClient).DownloadFile("https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$env:SONAR_SCANNER_VERSION-windows-x64.zip", "$env:SONAR_DIRECTORY/sonar-scanner.zip")
Add-Type -AssemblyName System.IO.Compression.FileSystem
[System.IO.Compression.ZipFile]::ExtractToDirectory("$env:SONAR_DIRECTORY/sonar-scanner.zip", "$env:SONAR_DIRECTORY")
rm ./.sonar/sonar-scanner.zip -Force -ErrorAction SilentlyContinue
@@ -86,9 +86,9 @@ export PATH=$HOME/.sonar/build-wrapper-linux-aarch64:$PATH
`;
exports[`can choose build tools and copy provided settings: c++ (manual) linux arm64: download scanner 1`] = `
-"export SONAR_SCANNER_VERSION=6.0.0.4432
-export SONAR_SCANNER_HOME=$HOME/.sonar/sonar-scanner-$SONAR_SCANNER_VERSION
-curl --create-dirs -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$SONAR_SCANNER_VERSION.zip
+"export SONAR_SCANNER_VERSION=6.1.0.4477
+export SONAR_SCANNER_HOME=$HOME/.sonar/sonar-scanner-$SONAR_SCANNER_VERSION-linux-aarch64
+curl --create-dirs -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$SONAR_SCANNER_VERSION-linux-aarch64.zip
unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/
export PATH=$SONAR_SCANNER_HOME/bin:$PATH
export SONAR_SCANNER_OPTS="-server"
@@ -113,9 +113,9 @@ export PATH=$HOME/.sonar/build-wrapper-linux-x86:$PATH
`;
exports[`can choose build tools and copy provided settings: c++ (manual) linux: download scanner 1`] = `
-"export SONAR_SCANNER_VERSION=6.0.0.4432
-export SONAR_SCANNER_HOME=$HOME/.sonar/sonar-scanner-$SONAR_SCANNER_VERSION-linux
-curl --create-dirs -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$SONAR_SCANNER_VERSION-linux.zip
+"export SONAR_SCANNER_VERSION=6.1.0.4477
+export SONAR_SCANNER_HOME=$HOME/.sonar/sonar-scanner-$SONAR_SCANNER_VERSION-linux-x64
+curl --create-dirs -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$SONAR_SCANNER_VERSION-linux-x64.zip
unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/
export PATH=$SONAR_SCANNER_HOME/bin:$PATH
export SONAR_SCANNER_OPTS="-server"
@@ -140,9 +140,9 @@ export PATH=$HOME/.sonar/build-wrapper-macosx-x86:$PATH
`;
exports[`can choose build tools and copy provided settings: c++ (manual) macos: download scanner 1`] = `
-"export SONAR_SCANNER_VERSION=6.0.0.4432
-export SONAR_SCANNER_HOME=$HOME/.sonar/sonar-scanner-$SONAR_SCANNER_VERSION-macosx
-curl --create-dirs -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$SONAR_SCANNER_VERSION-macosx.zip
+"export SONAR_SCANNER_VERSION=6.1.0.4477
+export SONAR_SCANNER_HOME=$HOME/.sonar/sonar-scanner-$SONAR_SCANNER_VERSION-macosx-x64
+curl --create-dirs -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$SONAR_SCANNER_VERSION-macosx-x64.zip
unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/
export PATH=$SONAR_SCANNER_HOME/bin:$PATH
export SONAR_SCANNER_OPTS="-server"
@@ -171,12 +171,12 @@ $env:Path += ";$env:SONAR_DIRECTORY/build-wrapper-win-x86"
`;
exports[`can choose build tools and copy provided settings: c++ (manual) windows: download scanner 1`] = `
-"$env:SONAR_SCANNER_VERSION = "6.0.0.4432"
+"$env:SONAR_SCANNER_VERSION = "6.1.0.4477"
$env:SONAR_DIRECTORY = [System.IO.Path]::Combine($(get-location).Path,".sonar")
-$env:SONAR_SCANNER_HOME = "$env:SONAR_DIRECTORY/sonar-scanner-$env:SONAR_SCANNER_VERSION-windows"
+$env:SONAR_SCANNER_HOME = "$env:SONAR_DIRECTORY/sonar-scanner-$env:SONAR_SCANNER_VERSION-windows-x64"
rm $env:SONAR_SCANNER_HOME -Force -Recurse -ErrorAction SilentlyContinue
New-Item -path $env:SONAR_SCANNER_HOME -type directory
-(New-Object System.Net.WebClient).DownloadFile("https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$env:SONAR_SCANNER_VERSION-windows.zip", "$env:SONAR_DIRECTORY/sonar-scanner.zip")
+(New-Object System.Net.WebClient).DownloadFile("https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$env:SONAR_SCANNER_VERSION-windows-x64.zip", "$env:SONAR_DIRECTORY/sonar-scanner.zip")
Add-Type -AssemblyName System.IO.Compression.FileSystem
[System.IO.Compression.ZipFile]::ExtractToDirectory("$env:SONAR_DIRECTORY/sonar-scanner.zip", "$env:SONAR_DIRECTORY")
rm ./.sonar/sonar-scanner.zip -Force -ErrorAction SilentlyContinue
@@ -233,9 +233,9 @@ export PATH=$HOME/.sonar/build-wrapper-linux-aarch64:$PATH
`;
exports[`can choose build tools and copy provided settings: objective-c linux arm64: download scanner 1`] = `
-"export SONAR_SCANNER_VERSION=6.0.0.4432
-export SONAR_SCANNER_HOME=$HOME/.sonar/sonar-scanner-$SONAR_SCANNER_VERSION
-curl --create-dirs -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$SONAR_SCANNER_VERSION.zip
+"export SONAR_SCANNER_VERSION=6.1.0.4477
+export SONAR_SCANNER_HOME=$HOME/.sonar/sonar-scanner-$SONAR_SCANNER_VERSION-linux-aarch64
+curl --create-dirs -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$SONAR_SCANNER_VERSION-linux-aarch64.zip
unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/
export PATH=$SONAR_SCANNER_HOME/bin:$PATH
export SONAR_SCANNER_OPTS="-server"
@@ -260,9 +260,9 @@ export PATH=$HOME/.sonar/build-wrapper-linux-x86:$PATH
`;
exports[`can choose build tools and copy provided settings: objective-c linux: download scanner 1`] = `
-"export SONAR_SCANNER_VERSION=6.0.0.4432
-export SONAR_SCANNER_HOME=$HOME/.sonar/sonar-scanner-$SONAR_SCANNER_VERSION-linux
-curl --create-dirs -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$SONAR_SCANNER_VERSION-linux.zip
+"export SONAR_SCANNER_VERSION=6.1.0.4477
+export SONAR_SCANNER_HOME=$HOME/.sonar/sonar-scanner-$SONAR_SCANNER_VERSION-linux-x64
+curl --create-dirs -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$SONAR_SCANNER_VERSION-linux-x64.zip
unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/
export PATH=$SONAR_SCANNER_HOME/bin:$PATH
export SONAR_SCANNER_OPTS="-server"
@@ -287,9 +287,9 @@ export PATH=$HOME/.sonar/build-wrapper-macosx-x86:$PATH
`;
exports[`can choose build tools and copy provided settings: objective-c macos: download scanner 1`] = `
-"export SONAR_SCANNER_VERSION=6.0.0.4432
-export SONAR_SCANNER_HOME=$HOME/.sonar/sonar-scanner-$SONAR_SCANNER_VERSION-macosx
-curl --create-dirs -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$SONAR_SCANNER_VERSION-macosx.zip
+"export SONAR_SCANNER_VERSION=6.1.0.4477
+export SONAR_SCANNER_HOME=$HOME/.sonar/sonar-scanner-$SONAR_SCANNER_VERSION-macosx-x64
+curl --create-dirs -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$SONAR_SCANNER_VERSION-macosx-x64.zip
unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/
export PATH=$SONAR_SCANNER_HOME/bin:$PATH
export SONAR_SCANNER_OPTS="-server"
@@ -318,12 +318,12 @@ $env:Path += ";$env:SONAR_DIRECTORY/build-wrapper-win-x86"
`;
exports[`can choose build tools and copy provided settings: objective-c windows: download scanner 1`] = `
-"$env:SONAR_SCANNER_VERSION = "6.0.0.4432"
+"$env:SONAR_SCANNER_VERSION = "6.1.0.4477"
$env:SONAR_DIRECTORY = [System.IO.Path]::Combine($(get-location).Path,".sonar")
-$env:SONAR_SCANNER_HOME = "$env:SONAR_DIRECTORY/sonar-scanner-$env:SONAR_SCANNER_VERSION-windows"
+$env:SONAR_SCANNER_HOME = "$env:SONAR_DIRECTORY/sonar-scanner-$env:SONAR_SCANNER_VERSION-windows-x64"
rm $env:SONAR_SCANNER_HOME -Force -Recurse -ErrorAction SilentlyContinue
New-Item -path $env:SONAR_SCANNER_HOME -type directory
-(New-Object System.Net.WebClient).DownloadFile("https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$env:SONAR_SCANNER_VERSION-windows.zip", "$env:SONAR_DIRECTORY/sonar-scanner.zip")
+(New-Object System.Net.WebClient).DownloadFile("https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$env:SONAR_SCANNER_VERSION-windows-x64.zip", "$env:SONAR_DIRECTORY/sonar-scanner.zip")
Add-Type -AssemblyName System.IO.Compression.FileSystem
[System.IO.Compression.ZipFile]::ExtractToDirectory("$env:SONAR_DIRECTORY/sonar-scanner.zip", "$env:SONAR_DIRECTORY")
rm ./.sonar/sonar-scanner.zip -Force -ErrorAction SilentlyContinue
diff --git a/server/sonar-web/src/main/js/components/tutorials/other/commands/DownloadScanner.tsx b/server/sonar-web/src/main/js/components/tutorials/other/commands/DownloadScanner.tsx
index 9e8564d4d8d..5c040f216ab 100644
--- a/server/sonar-web/src/main/js/components/tutorials/other/commands/DownloadScanner.tsx
+++ b/server/sonar-web/src/main/js/components/tutorials/other/commands/DownloadScanner.tsx
@@ -22,7 +22,6 @@ import { Link } from '@sonarsource/echoes-react';
import {
ClipboardIconButton,
CodeSnippet,
- FlagMessage,
NumberedList,
NumberedListItem,
SubHeading,
@@ -47,7 +46,6 @@ export default function DownloadScanner(props: Readonly<DownloadScannerProps>) {
const { arch, os, isLocal, token } = props;
const docUrl = useDocUrl(DocLink.SonarScanner);
- const scannerRequirementsUrl = useDocUrl(DocLink.SonarScannerRequirements);
return (
<div className="sw-mb-4">
@@ -70,23 +68,6 @@ export default function DownloadScanner(props: Readonly<DownloadScannerProps>) {
</p>
) : (
<>
- {os === OSs.Linux && arch === Arch.Arm64 && (
- <FlagMessage className="sw-mt-2 sw-w-abs-600" variant="warning">
- <p className="sw-mb-2">
- <FormattedMessage
- defaultMessage={translate('onboarding.analysis.sq_scanner.jre_required_warning')}
- id="onboarding.analysis.sq_scanner.jre_required_warning"
- values={{
- link: (
- <Link to={scannerRequirementsUrl}>
- {translate('onboarding.analysis.sq_scanner.jre_required_warning.link')}
- </Link>
- ),
- }}
- />
- </p>
- </FlagMessage>
- )}
<CodeSnippet
className="sw-p-4"
wrap
@@ -120,13 +101,14 @@ export default function DownloadScanner(props: Readonly<DownloadScannerProps>) {
}
function getRemoteDownloadSnippet(os: OSs, arch: Arch) {
+ const suffix = getScannerUrlSuffix(os, arch);
if (os === OSs.Windows) {
return `$env:SONAR_SCANNER_VERSION = "${SONAR_SCANNER_CLI_LATEST_VERSION}"
$env:SONAR_DIRECTORY = [System.IO.Path]::Combine($(get-location).Path,".sonar")
-$env:SONAR_SCANNER_HOME = "$env:SONAR_DIRECTORY/sonar-scanner-$env:SONAR_SCANNER_VERSION-windows"
+$env:SONAR_SCANNER_HOME = "$env:SONAR_DIRECTORY/sonar-scanner-$env:SONAR_SCANNER_VERSION${suffix}"
rm $env:SONAR_SCANNER_HOME -Force -Recurse -ErrorAction SilentlyContinue
New-Item -path $env:SONAR_SCANNER_HOME -type directory
-(New-Object System.Net.WebClient).DownloadFile("https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$env:SONAR_SCANNER_VERSION-windows.zip", "$env:SONAR_DIRECTORY/sonar-scanner.zip")
+(New-Object System.Net.WebClient).DownloadFile("https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$env:SONAR_SCANNER_VERSION${suffix}.zip", "$env:SONAR_DIRECTORY/sonar-scanner.zip")
Add-Type -AssemblyName System.IO.Compression.FileSystem
[System.IO.Compression.ZipFile]::ExtractToDirectory("$env:SONAR_DIRECTORY/sonar-scanner.zip", "$env:SONAR_DIRECTORY")
rm ./.sonar/sonar-scanner.zip -Force -ErrorAction SilentlyContinue
@@ -134,7 +116,6 @@ $env:Path += ";$env:SONAR_SCANNER_HOME/bin"
$env:SONAR_SCANNER_OPTS="-server"
`;
}
- const suffix = getScannerUrlSuffix(os, arch);
return `export SONAR_SCANNER_VERSION=${SONAR_SCANNER_CLI_LATEST_VERSION}
export SONAR_SCANNER_HOME=$HOME/.sonar/sonar-scanner-$SONAR_SCANNER_VERSION${suffix}
curl --create-dirs -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$SONAR_SCANNER_VERSION${suffix}.zip
diff --git a/server/sonar-web/src/main/js/components/tutorials/utils.ts b/server/sonar-web/src/main/js/components/tutorials/utils.ts
index 8fb5b323ba7..fa62732d252 100644
--- a/server/sonar-web/src/main/js/components/tutorials/utils.ts
+++ b/server/sonar-web/src/main/js/components/tutorials/utils.ts
@@ -23,7 +23,7 @@ import { AlmSettingsInstance, ProjectAlmBindingResponse } from '../../types/alm-
import { UserToken } from '../../types/token';
import { Arch, AutoConfig, BuildTools, GradleBuildDSL, OSs, TutorialConfig } from './types';
-export const SONAR_SCANNER_CLI_LATEST_VERSION = '6.0.0.4432';
+export const SONAR_SCANNER_CLI_LATEST_VERSION = '6.1.0.4477';
export function quote(os: string): (s: string) => string {
return os === 'win' ? (s: string) => `"${s}"` : (s: string) => s;
@@ -177,23 +177,20 @@ export function getBuildWrapperExecutableLinux(arch?: Arch) {
export function getScannerUrlSuffix(os: OSs, arch?: Arch) {
if (os === OSs.Windows) {
- return '-windows';
+ return '-windows-x64';
}
if (os === OSs.MacOS) {
- return '-macosx';
+ return '-macosx-x64';
}
- if (os === OSs.Linux && arch === Arch.X86_64) {
- return '-linux';
+ if (os === OSs.Linux) {
+ return '-linux-' + (arch === Arch.Arm64 ? 'aarch64' : 'x64');
}
return '';
}
-export function showJreWarning(config: TutorialConfig, arch: Arch) {
- if (!isCFamily(config.buildTool)) {
- return false;
- }
- if (config.autoConfig === AutoConfig.Automatic) {
- return false;
- }
- return arch === Arch.Arm64;
+export function shouldFetchBuildWrapper(buildTool: BuildTools, autoConfig?: AutoConfig) {
+ return (
+ (buildTool === BuildTools.Cpp && autoConfig === AutoConfig.Manual) ||
+ buildTool === BuildTools.ObjectiveC
+ );
}
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 f0b6c46f7cb..05b973f80b9 100644
--- a/sonar-core/src/main/resources/org/sonar/l10n/core.properties
+++ b/sonar-core/src/main/resources/org/sonar/l10n/core.properties
@@ -4647,8 +4647,6 @@ onboarding.analysis.sq_scanner.docs_link=official documentation of the Scanner
onboarding.analysis.sq_scanner.sonar_token_env.header=Configure a SONAR_TOKEN environment variable in your CI settings
onboarding.analysis.sq_scanner.sonar_token_env.var_name=Add an environment variable called
onboarding.analysis.sq_scanner.sonar_token_env.var_value=Give it the following value
-onboarding.analysis.sq_scanner.jre_required_warning=A compatible Java Runtime Environment is required to run the Scanner on this platform, please refer to {link} for more details.
-onboarding.analysis.sq_scanner.jre_required_warning.link=the documentation
onboarding.analysis.sqscanner.docs.gradle.title=official documentation of the Scanner for Gradle
onboarding.analysis.sqscanner.docs.gradle.example_project.title=live Gradle-based example project