Browse Source

SONAR-15105 Add download scripts for Other CI tutorials

tags/9.6.0.59041
Wouter Admiraal 1 year ago
parent
commit
d1b0f4f844
64 changed files with 791 additions and 307 deletions
  1. 15
    6
      server/sonar-web/src/main/js/components/tutorials/TutorialSelectionRenderer.tsx
  2. 2
    2
      server/sonar-web/src/main/js/components/tutorials/__tests__/TutorialSelection-test.tsx
  3. 11
    11
      server/sonar-web/src/main/js/components/tutorials/__tests__/TutorialSelectionRenderer-test.tsx
  4. 18
    16
      server/sonar-web/src/main/js/components/tutorials/__tests__/__snapshots__/TutorialSelectionRenderer-test.tsx.snap
  5. 1
    1
      server/sonar-web/src/main/js/components/tutorials/components/GithubCFamilyExampleRepositories.tsx
  6. 0
    62
      server/sonar-web/src/main/js/components/tutorials/manual/commands/DownloadBuildWrapper.tsx
  7. 0
    54
      server/sonar-web/src/main/js/components/tutorials/manual/commands/DownloadScanner.tsx
  8. 0
    106
      server/sonar-web/src/main/js/components/tutorials/manual/commands/__tests__/__snapshots__/DownloadScanner-test.tsx.snap
  9. 2
    2
      server/sonar-web/src/main/js/components/tutorials/other/BuildToolForm.tsx
  10. 0
    0
      server/sonar-web/src/main/js/components/tutorials/other/DoneNextSteps.tsx
  11. 7
    3
      server/sonar-web/src/main/js/components/tutorials/other/OtherTutorial.tsx
  12. 10
    3
      server/sonar-web/src/main/js/components/tutorials/other/ProjectAnalysisStep.tsx
  13. 4
    4
      server/sonar-web/src/main/js/components/tutorials/other/TokenStep.tsx
  14. 0
    0
      server/sonar-web/src/main/js/components/tutorials/other/__tests__/BuildToolForm-test.tsx
  15. 0
    0
      server/sonar-web/src/main/js/components/tutorials/other/__tests__/DoneNextSteps-test.tsx
  16. 9
    4
      server/sonar-web/src/main/js/components/tutorials/other/__tests__/OtherTutorial-test.tsx
  17. 9
    1
      server/sonar-web/src/main/js/components/tutorials/other/__tests__/ProjectAnalysisStep-test.tsx
  18. 0
    0
      server/sonar-web/src/main/js/components/tutorials/other/__tests__/TokenStep-test.tsx
  19. 0
    0
      server/sonar-web/src/main/js/components/tutorials/other/__tests__/__snapshots__/BuildToolForm-test.tsx.snap
  20. 0
    0
      server/sonar-web/src/main/js/components/tutorials/other/__tests__/__snapshots__/DoneNextSteps-test.tsx.snap
  21. 2
    0
      server/sonar-web/src/main/js/components/tutorials/other/__tests__/__snapshots__/OtherTutorial-test.tsx.snap
  22. 1
    1
      server/sonar-web/src/main/js/components/tutorials/other/__tests__/__snapshots__/ProjectAnalysisStep-test.tsx.snap
  23. 0
    0
      server/sonar-web/src/main/js/components/tutorials/other/__tests__/__snapshots__/TokenStep-test.tsx.snap
  24. 18
    3
      server/sonar-web/src/main/js/components/tutorials/other/commands/AnalysisCommand.tsx
  25. 13
    4
      server/sonar-web/src/main/js/components/tutorials/other/commands/ClangGCCCommand.tsx
  26. 0
    0
      server/sonar-web/src/main/js/components/tutorials/other/commands/DotNet.tsx
  27. 1
    1
      server/sonar-web/src/main/js/components/tutorials/other/commands/DotNetCore.tsx
  28. 0
    0
      server/sonar-web/src/main/js/components/tutorials/other/commands/DotNetExecute.tsx
  29. 0
    0
      server/sonar-web/src/main/js/components/tutorials/other/commands/DotNetFramework.tsx
  30. 88
    0
      server/sonar-web/src/main/js/components/tutorials/other/commands/DownloadBuildWrapper.tsx
  31. 105
    0
      server/sonar-web/src/main/js/components/tutorials/other/commands/DownloadScanner.tsx
  32. 0
    0
      server/sonar-web/src/main/js/components/tutorials/other/commands/ExecBuildWrapper.tsx
  33. 4
    3
      server/sonar-web/src/main/js/components/tutorials/other/commands/ExecScanner.tsx
  34. 0
    0
      server/sonar-web/src/main/js/components/tutorials/other/commands/JavaGradle.tsx
  35. 0
    0
      server/sonar-web/src/main/js/components/tutorials/other/commands/JavaMaven.tsx
  36. 4
    3
      server/sonar-web/src/main/js/components/tutorials/other/commands/Other.tsx
  37. 8
    1
      server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/AnalysisCommand-test.tsx
  38. 2
    0
      server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/CLangGCCCommand-test.tsx
  39. 0
    0
      server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/DotNet-test.tsx
  40. 0
    0
      server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/DotNetExecute-test.tsx
  41. 0
    0
      server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/DotNetFramework-test.tsx
  42. 0
    0
      server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/DotnetCore-test.tsx
  43. 10
    3
      server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/DownloadBuildWrapper-test.tsx
  44. 10
    3
      server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/DownloadScanner-test.tsx
  45. 0
    0
      server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/ExecBuildWrapper-test.tsx
  46. 5
    0
      server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/ExecScanner-test.tsx
  47. 0
    0
      server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/JavaGradle-test.tsx
  48. 0
    0
      server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/JavaMaven-test.tsx
  49. 1
    0
      server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/Other-test.tsx
  50. 3
    0
      server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/__snapshots__/AnalysisCommand-test.tsx.snap
  51. 5
    0
      server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/__snapshots__/CLangGCCCommand-test.tsx.snap
  52. 0
    0
      server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/__snapshots__/DotNet-test.tsx.snap
  53. 0
    0
      server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/__snapshots__/DotNetExecute-test.tsx.snap
  54. 0
    0
      server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/__snapshots__/DotNetFramework-test.tsx.snap
  55. 0
    0
      server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/__snapshots__/DotnetCore-test.tsx.snap
  56. 61
    3
      server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/__snapshots__/DownloadBuildWrapper-test.tsx.snap
  57. 279
    0
      server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/__snapshots__/DownloadScanner-test.tsx.snap
  58. 0
    0
      server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/__snapshots__/ExecBuildWrapper-test.tsx.snap
  59. 74
    4
      server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/__snapshots__/ExecScanner-test.tsx.snap
  60. 0
    0
      server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/__snapshots__/JavaGradle-test.tsx.snap
  61. 0
    0
      server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/__snapshots__/JavaMaven-test.tsx.snap
  62. 3
    0
      server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/__snapshots__/Other-test.tsx.snap
  63. 1
    1
      server/sonar-web/src/main/js/components/tutorials/types.ts
  64. 5
    2
      sonar-core/src/main/resources/org/sonar/l10n/core.properties

+ 15
- 6
server/sonar-web/src/main/js/components/tutorials/TutorialSelectionRenderer.tsx View File

@@ -30,7 +30,7 @@ import BitbucketPipelinesTutorial from './bitbucket-pipelines/BitbucketPipelines
import GitHubActionTutorial from './github-action/GitHubActionTutorial';
import GitLabCITutorial from './gitlabci/GitLabCITutorial';
import JenkinsTutorial from './jenkins/JenkinsTutorial';
import ManualTutorial from './manual/ManualTutorial';
import OtherTutorial from './other/OtherTutorial';
import { TutorialModes } from './types';

export interface TutorialSelectionRendererProps {
@@ -59,7 +59,7 @@ function renderButton(
className={`button button-huge display-flex-column big-spacer-right big-spacer-bottom tutorial-mode-${mode}`}
// Currently, OtherCI is the same tutorial as Manual. We might update it to its own stand-alone
// tutorial in the future.
onClick={() => onSelectTutorial(mode === TutorialModes.OtherCI ? TutorialModes.Manual : mode)}
onClick={() => onSelectTutorial(mode)}
type="button">
{icon}
<div className="medium big-spacer-top">
@@ -186,11 +186,11 @@ export default function TutorialSelectionRenderer(props: TutorialSelectionRender
</div>

<p className="big-spacer-bottom spacer-top">
{translate('onboarding.tutorial.choose_method.locally.description')}
{translate('onboarding.tutorial.choose_method.local.description')}
</p>
<div>
{renderButton(
TutorialModes.Manual,
TutorialModes.Local,
props.onSelectTutorial,
<img
alt="" // Should be ignored by screen readers
@@ -203,8 +203,17 @@ export default function TutorialSelectionRenderer(props: TutorialSelectionRender
</>
)}

{selectedTutorial === TutorialModes.Manual && (
<ManualTutorial component={component} currentUser={currentUser} />
{selectedTutorial === TutorialModes.Local && (
<OtherTutorial
component={component}
baseUrl={baseUrl}
isLocal={true}
currentUser={currentUser}
/>
)}

{selectedTutorial === TutorialModes.OtherCI && (
<OtherTutorial component={component} baseUrl={baseUrl} currentUser={currentUser} />
)}

{selectedTutorial === TutorialModes.BitbucketPipelines && (

+ 2
- 2
server/sonar-web/src/main/js/components/tutorials/__tests__/TutorialSelection-test.tsx View File

@@ -74,10 +74,10 @@ it('should handle selection', () => {
const wrapper = shallowRender({ router: mockRouter({ push }) });
const instance = wrapper.instance();

instance.handleSelectTutorial(TutorialModes.Manual);
instance.handleSelectTutorial(TutorialModes.Local);
expect(push).toHaveBeenLastCalledWith(
expect.objectContaining({
query: { selectedTutorial: TutorialModes.Manual }
query: { selectedTutorial: TutorialModes.Local }
})
);


+ 11
- 11
server/sonar-web/src/main/js/components/tutorials/__tests__/TutorialSelectionRenderer-test.tsx View File

@@ -47,7 +47,7 @@ it.each([
it('should render correctly', () => {
expect(shallowRender()).toMatchSnapshot('selection');
expect(shallowRender({ loading: true })).toMatchSnapshot('loading');
expect(shallowRender({ selectedTutorial: TutorialModes.Manual })).toMatchSnapshot(
expect(shallowRender({ selectedTutorial: TutorialModes.Local })).toMatchSnapshot(
'manual tutorial'
);
expect(
@@ -89,8 +89,8 @@ it('should allow mode selection for Bitbucket', () => {
click(wrapper.find('button.tutorial-mode-jenkins'));
expect(onSelectTutorial).toHaveBeenLastCalledWith(TutorialModes.Jenkins);

click(wrapper.find('button.tutorial-mode-manual'));
expect(onSelectTutorial).toHaveBeenLastCalledWith(TutorialModes.Manual);
click(wrapper.find('button.tutorial-mode-local'));
expect(onSelectTutorial).toHaveBeenLastCalledWith(TutorialModes.Local);
});

it('should allow mode selection for Github', () => {
@@ -103,8 +103,8 @@ it('should allow mode selection for Github', () => {
click(wrapper.find('button.tutorial-mode-jenkins'));
expect(onSelectTutorial).toHaveBeenLastCalledWith(TutorialModes.Jenkins);

click(wrapper.find('button.tutorial-mode-manual'));
expect(onSelectTutorial).toHaveBeenLastCalledWith(TutorialModes.Manual);
click(wrapper.find('button.tutorial-mode-local'));
expect(onSelectTutorial).toHaveBeenLastCalledWith(TutorialModes.Local);

click(wrapper.find('button.tutorial-mode-github-actions'));
expect(onSelectTutorial).toHaveBeenLastCalledWith(TutorialModes.GitHubActions);
@@ -126,8 +126,8 @@ it('should allow mode selection for GitLab', () => {
click(wrapper.find('button.tutorial-mode-gitlab-ci'));
expect(onSelectTutorial).toHaveBeenLastCalledWith(TutorialModes.GitLabCI);

click(wrapper.find('button.tutorial-mode-manual'));
expect(onSelectTutorial).toHaveBeenLastCalledWith(TutorialModes.Manual);
click(wrapper.find('button.tutorial-mode-local'));
expect(onSelectTutorial).toHaveBeenLastCalledWith(TutorialModes.Local);
});

it('should allow mode selection for Bitbucket pipepline', () => {
@@ -143,8 +143,8 @@ it('should allow mode selection for Bitbucket pipepline', () => {
click(wrapper.find('button.tutorial-mode-bitbucket-pipelines'));
expect(onSelectTutorial).toHaveBeenLastCalledWith(TutorialModes.BitbucketPipelines);

click(wrapper.find('button.tutorial-mode-manual'));
expect(onSelectTutorial).toHaveBeenLastCalledWith(TutorialModes.Manual);
click(wrapper.find('button.tutorial-mode-local'));
expect(onSelectTutorial).toHaveBeenLastCalledWith(TutorialModes.Local);
});

it('should allow mode selection for Azure DevOps', () => {
@@ -157,8 +157,8 @@ it('should allow mode selection for Azure DevOps', () => {
click(wrapper.find('button.tutorial-mode-azure-pipelines'));
expect(onSelectTutorial).toHaveBeenLastCalledWith(TutorialModes.AzurePipelines);

click(wrapper.find('button.tutorial-mode-manual'));
expect(onSelectTutorial).toHaveBeenLastCalledWith(TutorialModes.Manual);
click(wrapper.find('button.tutorial-mode-local'));
expect(onSelectTutorial).toHaveBeenLastCalledWith(TutorialModes.Local);
});

function shallowRender(props: Partial<TutorialSelectionRendererProps> = {}) {

+ 18
- 16
server/sonar-web/src/main/js/components/tutorials/__tests__/__snapshots__/TutorialSelectionRenderer-test.tsx.snap View File

@@ -52,11 +52,11 @@ exports[`should render correctly for azure 1`] = `
<p
className="big-spacer-bottom spacer-top"
>
onboarding.tutorial.choose_method.locally.description
onboarding.tutorial.choose_method.local.description
</p>
<div>
<button
className="button button-huge display-flex-column big-spacer-right big-spacer-bottom tutorial-mode-manual"
className="button button-huge display-flex-column big-spacer-right big-spacer-bottom tutorial-mode-local"
onClick={[Function]}
type="button"
>
@@ -68,7 +68,7 @@ exports[`should render correctly for azure 1`] = `
<div
className="medium big-spacer-top"
>
onboarding.tutorial.choose_method.manual
onboarding.tutorial.choose_method.local
</div>
</button>
</div>
@@ -128,11 +128,11 @@ exports[`should render correctly for bitbucket server 1`] = `
<p
className="big-spacer-bottom spacer-top"
>
onboarding.tutorial.choose_method.locally.description
onboarding.tutorial.choose_method.local.description
</p>
<div>
<button
className="button button-huge display-flex-column big-spacer-right big-spacer-bottom tutorial-mode-manual"
className="button button-huge display-flex-column big-spacer-right big-spacer-bottom tutorial-mode-local"
onClick={[Function]}
type="button"
>
@@ -144,7 +144,7 @@ exports[`should render correctly for bitbucket server 1`] = `
<div
className="medium big-spacer-top"
>
onboarding.tutorial.choose_method.manual
onboarding.tutorial.choose_method.local
</div>
</button>
</div>
@@ -237,11 +237,11 @@ exports[`should render correctly for github 1`] = `
<p
className="big-spacer-bottom spacer-top"
>
onboarding.tutorial.choose_method.locally.description
onboarding.tutorial.choose_method.local.description
</p>
<div>
<button
className="button button-huge display-flex-column big-spacer-right big-spacer-bottom tutorial-mode-manual"
className="button button-huge display-flex-column big-spacer-right big-spacer-bottom tutorial-mode-local"
onClick={[Function]}
type="button"
>
@@ -253,7 +253,7 @@ exports[`should render correctly for github 1`] = `
<div
className="medium big-spacer-top"
>
onboarding.tutorial.choose_method.manual
onboarding.tutorial.choose_method.local
</div>
</button>
</div>
@@ -329,11 +329,11 @@ exports[`should render correctly for gitlab 1`] = `
<p
className="big-spacer-bottom spacer-top"
>
onboarding.tutorial.choose_method.locally.description
onboarding.tutorial.choose_method.local.description
</p>
<div>
<button
className="button button-huge display-flex-column big-spacer-right big-spacer-bottom tutorial-mode-manual"
className="button button-huge display-flex-column big-spacer-right big-spacer-bottom tutorial-mode-local"
onClick={[Function]}
type="button"
>
@@ -345,7 +345,7 @@ exports[`should render correctly for gitlab 1`] = `
<div
className="medium big-spacer-top"
>
onboarding.tutorial.choose_method.manual
onboarding.tutorial.choose_method.local
</div>
</button>
</div>
@@ -547,7 +547,8 @@ exports[`should render correctly: loading 1`] = `

exports[`should render correctly: manual tutorial 1`] = `
<Fragment>
<ManualTutorial
<OtherTutorial
baseUrl="http://localhost:9000"
component={
Object {
"breadcrumbs": Array [],
@@ -582,6 +583,7 @@ exports[`should render correctly: manual tutorial 1`] = `
"scmAccounts": Array [],
}
}
isLocal={true}
/>
</Fragment>
`;
@@ -703,11 +705,11 @@ exports[`should render correctly: selection 1`] = `
<p
className="big-spacer-bottom spacer-top"
>
onboarding.tutorial.choose_method.locally.description
onboarding.tutorial.choose_method.local.description
</p>
<div>
<button
className="button button-huge display-flex-column big-spacer-right big-spacer-bottom tutorial-mode-manual"
className="button button-huge display-flex-column big-spacer-right big-spacer-bottom tutorial-mode-local"
onClick={[Function]}
type="button"
>
@@ -719,7 +721,7 @@ exports[`should render correctly: selection 1`] = `
<div
className="medium big-spacer-top"
>
onboarding.tutorial.choose_method.manual
onboarding.tutorial.choose_method.local
</div>
</button>
</div>

+ 1
- 1
server/sonar-web/src/main/js/components/tutorials/components/GithubCFamilyExampleRepositories.tsx View File

@@ -42,7 +42,7 @@ const CI_SEARCH_MAP = {
[TutorialModes.GitHubActions]: 'gh-actions',
[TutorialModes.GitLabCI]: 'gitlab',
[TutorialModes.BitbucketPipelines]: 'bitbucket',
[TutorialModes.Manual]: 'otherci',
[TutorialModes.Local]: 'otherci',
[TutorialModes.OtherCI]: 'otherci'
};


+ 0
- 62
server/sonar-web/src/main/js/components/tutorials/manual/commands/DownloadBuildWrapper.tsx View File

@@ -1,62 +0,0 @@
/*
* SonarQube
* Copyright (C) 2009-2022 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 { FormattedMessage } from 'react-intl';
import { translate } from '../../../../helpers/l10n';
import { getBaseUrl } from '../../../../helpers/system';
import { OSs } from '../../types';

export interface DownloadBuildWrapperProps {
os: OSs;
}

const filenames: { [x in OSs]: string } = {
win: 'build-wrapper-win-x86.zip',
linux: 'build-wrapper-linux-x86.zip',
mac: 'build-wrapper-macosx-x86.zip'
};

export default function DownloadBuildWrapper(props: DownloadBuildWrapperProps) {
const { os } = props;
return (
<div className="spacer-bottom">
<h4 className="spacer-bottom">{translate('onboarding.analysis.build_wrapper.header', os)}</h4>
<p className="spacer-bottom markdown">
<FormattedMessage
defaultMessage={translate('onboarding.analysis.build_wrapper.text')}
id="onboarding.analysis.build_wrapper.text"
values={{
env_var: <code>{os === 'win' ? '%PATH%' : 'PATH'}</code>
}}
/>
</p>
<p>
<a
className="button"
download={filenames[os]}
href={`${getBaseUrl()}/static/cpp/${filenames[os]}`}
rel="noopener noreferrer"
target="_blank">
{translate('download_verb')}
</a>
</p>
</div>
);
}

+ 0
- 54
server/sonar-web/src/main/js/components/tutorials/manual/commands/DownloadScanner.tsx View File

@@ -1,54 +0,0 @@
/*
* SonarQube
* Copyright (C) 2009-2022 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 { FormattedMessage } from 'react-intl';
import { translate } from '../../../../helpers/l10n';
import { OSs } from '../../types';

interface Props {
os: OSs;
}

export default function DownloadScanner(props: Props) {
const { os } = props;
return (
<div>
<h4 className="spacer-bottom">{translate('onboarding.analysis.sq_scanner.header', os)}</h4>
<p className="spacer-bottom markdown">
<FormattedMessage
defaultMessage={translate('onboarding.analysis.sq_scanner.text')}
id="onboarding.analysis.sq_scanner.text"
values={{
dir: <code>bin</code>,
env_var: <code>{os === OSs.Windows ? '%PATH%' : 'PATH'}</code>,
link: (
<a
href="https://redirect.sonarsource.com/doc/download-scanner.html"
rel="noopener noreferrer"
target="_blank">
{translate('onboarding.analysis.sq_scanner.docs_link')}
</a>
)
}}
/>
</p>
</div>
);
}

+ 0
- 106
server/sonar-web/src/main/js/components/tutorials/manual/commands/__tests__/__snapshots__/DownloadScanner-test.tsx.snap View File

@@ -1,106 +0,0 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Shoud renders for "linux" correctly 1`] = `
<div>
<h4
className="spacer-bottom"
>
onboarding.analysis.sq_scanner.header.linux
</h4>
<p
className="spacer-bottom markdown"
>
<FormattedMessage
defaultMessage="onboarding.analysis.sq_scanner.text"
id="onboarding.analysis.sq_scanner.text"
values={
Object {
"dir": <code>
bin
</code>,
"env_var": <code>
PATH
</code>,
"link": <a
href="https://redirect.sonarsource.com/doc/download-scanner.html"
rel="noopener noreferrer"
target="_blank"
>
onboarding.analysis.sq_scanner.docs_link
</a>,
}
}
/>
</p>
</div>
`;

exports[`Shoud renders for "mac" correctly 1`] = `
<div>
<h4
className="spacer-bottom"
>
onboarding.analysis.sq_scanner.header.mac
</h4>
<p
className="spacer-bottom markdown"
>
<FormattedMessage
defaultMessage="onboarding.analysis.sq_scanner.text"
id="onboarding.analysis.sq_scanner.text"
values={
Object {
"dir": <code>
bin
</code>,
"env_var": <code>
PATH
</code>,
"link": <a
href="https://redirect.sonarsource.com/doc/download-scanner.html"
rel="noopener noreferrer"
target="_blank"
>
onboarding.analysis.sq_scanner.docs_link
</a>,
}
}
/>
</p>
</div>
`;

exports[`Shoud renders for "win" correctly 1`] = `
<div>
<h4
className="spacer-bottom"
>
onboarding.analysis.sq_scanner.header.win
</h4>
<p
className="spacer-bottom markdown"
>
<FormattedMessage
defaultMessage="onboarding.analysis.sq_scanner.text"
id="onboarding.analysis.sq_scanner.text"
values={
Object {
"dir": <code>
bin
</code>,
"env_var": <code>
%PATH%
</code>,
"link": <a
href="https://redirect.sonarsource.com/doc/download-scanner.html"
rel="noopener noreferrer"
target="_blank"
>
onboarding.analysis.sq_scanner.docs_link
</a>,
}
}
/>
</p>
</div>
`;

server/sonar-web/src/main/js/components/tutorials/manual/BuildToolForm.tsx → server/sonar-web/src/main/js/components/tutorials/other/BuildToolForm.tsx View File

@@ -18,8 +18,8 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
import RadioToggle from '../../../components/controls/RadioToggle';
import { translate } from '../../../helpers/l10n';
import RadioToggle from '../../controls/RadioToggle';
import { withCLanguageFeature } from '../../hoc/withCLanguageFeature';
import GithubCFamilyExampleRepositories from '../components/GithubCFamilyExampleRepositories';
import RenderOptions from '../components/RenderOptions';
@@ -97,7 +97,7 @@ export class BuildToolForm extends React.PureComponent<Props, State> {
<GithubCFamilyExampleRepositories
className="big-spacer-top abs-width-600"
os={config.os}
ci={TutorialModes.Manual}
ci={TutorialModes.Local}
/>
)}
</>

server/sonar-web/src/main/js/components/tutorials/manual/DoneNextSteps.tsx → server/sonar-web/src/main/js/components/tutorials/other/DoneNextSteps.tsx View File


server/sonar-web/src/main/js/components/tutorials/manual/ManualTutorial.tsx → server/sonar-web/src/main/js/components/tutorials/other/OtherTutorial.tsx View File

@@ -33,6 +33,8 @@ export enum Steps {
interface Props {
component: Component;
currentUser: LoggedInUser;
baseUrl: string;
isLocal?: boolean;
}

interface State {
@@ -40,7 +42,7 @@ interface State {
token?: string;
}

export default class ManualTutorial extends React.PureComponent<Props, State> {
export default class OtherTutorial extends React.PureComponent<Props, State> {
state: State = { step: Steps.TOKEN };

handleTokenDone = (token: string) => {
@@ -52,7 +54,7 @@ export default class ManualTutorial extends React.PureComponent<Props, State> {
};

render() {
const { component, currentUser } = this.props;
const { component, baseUrl, currentUser, isLocal = false } = this.props;
const { step, token } = this.state;

return (
@@ -77,9 +79,11 @@ export default class ManualTutorial extends React.PureComponent<Props, State> {

<ProjectAnalysisStep
component={component}
baseUrl={baseUrl}
isLocal={isLocal}
open={step === Steps.ANALYSIS}
stepNumber={2}
token={token}
stepNumber={2}
/>
</>
);

server/sonar-web/src/main/js/components/tutorials/manual/ProjectAnalysisStep.tsx → server/sonar-web/src/main/js/components/tutorials/other/ProjectAnalysisStep.tsx View File

@@ -29,7 +29,9 @@ interface Props {
component: Component;
onFinish?: (projectKey?: string) => void;
open: boolean;
baseUrl: string;
stepNumber: number;
isLocal: boolean;
token?: string;
}

@@ -49,6 +51,7 @@ export default class ProjectAnalysisStep extends React.PureComponent<Props, Stat
};

renderForm = () => {
const { component, baseUrl, isLocal, token } = this.props;
return (
<div className="boxed-group-inner">
<div className="display-flex-column">
@@ -57,9 +60,11 @@ export default class ProjectAnalysisStep extends React.PureComponent<Props, Stat
{this.state.config && (
<div className="big-spacer-top">
<AnalysisCommand
component={this.props.component}
component={component}
baseUrl={baseUrl}
isLocal={isLocal}
languageConfig={this.state.config}
token={this.props.token}
token={token}
/>
</div>
)}
@@ -74,7 +79,9 @@ export default class ProjectAnalysisStep extends React.PureComponent<Props, Stat
return (
<Step
finished={false}
onOpen={() => {}}
onOpen={() => {
/* noop */
}}
open={this.props.open}
renderForm={this.renderForm}
renderResult={this.renderResult}

server/sonar-web/src/main/js/components/tutorials/manual/TokenStep.tsx → server/sonar-web/src/main/js/components/tutorials/other/TokenStep.tsx View File

@@ -21,9 +21,6 @@ import * as React from 'react';
import { FormattedMessage } from 'react-intl';
import { Link } from 'react-router-dom';
import { generateToken, getTokens, revokeToken } from '../../../api/user-tokens';
import { Button, DeleteButton, SubmitButton } from '../../../components/controls/buttons';
import Radio from '../../../components/controls/Radio';
import AlertSuccessIcon from '../../../components/icons/AlertSuccessIcon';
import { translate } from '../../../helpers/l10n';
import {
computeTokenExpirationDate,
@@ -33,8 +30,11 @@ import {
import { TokenExpiration, TokenType, UserToken } from '../../../types/token';
import { LoggedInUser } from '../../../types/users';
import DocumentationTooltip from '../../common/DocumentationTooltip';
import { Button, DeleteButton, SubmitButton } from '../../controls/buttons';
import Radio from '../../controls/Radio';
import Select from '../../controls/Select';
import AlertErrorIcon from '../../icons/AlertErrorIcon';
import AlertSuccessIcon from '../../icons/AlertSuccessIcon';
import Step from '../components/Step';
import { getUniqueTokenName } from '../utils';

@@ -43,10 +43,10 @@ interface Props {
projectKey: string;
finished: boolean;
initialTokenName?: string;
stepNumber: number;
open: boolean;
onContinue: (token: string) => void;
onOpen: VoidFunction;
stepNumber: number;
}

interface State {

server/sonar-web/src/main/js/components/tutorials/manual/__tests__/BuildToolForm-test.tsx → server/sonar-web/src/main/js/components/tutorials/other/__tests__/BuildToolForm-test.tsx View File


server/sonar-web/src/main/js/components/tutorials/manual/__tests__/DoneNextSteps-test.tsx → server/sonar-web/src/main/js/components/tutorials/other/__tests__/DoneNextSteps-test.tsx View File


server/sonar-web/src/main/js/components/tutorials/manual/__tests__/ManualTutorial-test.tsx → server/sonar-web/src/main/js/components/tutorials/other/__tests__/OtherTutorial-test.tsx View File

@@ -21,7 +21,7 @@ import { shallow } from 'enzyme';
import * as React from 'react';
import { mockComponent } from '../../../../helpers/mocks/component';
import { mockLoggedInUser } from '../../../../helpers/testMocks';
import ManualTutorial from '../ManualTutorial';
import OtherTutorial from '../OtherTutorial';
import ProjectAnalysisStep from '../ProjectAnalysisStep';
import TokenStep from '../TokenStep';

@@ -44,8 +44,13 @@ it('allows to navigate between steps', () => {
expect(wrapper.find(ProjectAnalysisStep).props().open).toBe(false);
});

function shallowRender(props: Partial<ManualTutorial['props']> = {}) {
return shallow<ManualTutorial>(
<ManualTutorial component={mockComponent()} currentUser={mockLoggedInUser()} {...props} />
function shallowRender(props: Partial<OtherTutorial['props']> = {}) {
return shallow<OtherTutorial>(
<OtherTutorial
component={mockComponent()}
baseUrl="http://example.com"
currentUser={mockLoggedInUser()}
{...props}
/>
);
}

server/sonar-web/src/main/js/components/tutorials/manual/__tests__/ProjectAnalysisStep-test.tsx → server/sonar-web/src/main/js/components/tutorials/other/__tests__/ProjectAnalysisStep-test.tsx View File

@@ -27,5 +27,13 @@ it('should render correctly', () => {
});

function shallowRender() {
return shallow(<ProjectAnalysisStep component={mockComponent()} open={true} stepNumber={1} />);
return shallow(
<ProjectAnalysisStep
component={mockComponent()}
isLocal={true}
baseUrl="http://example.com"
open={true}
stepNumber={2}
/>
);
}

server/sonar-web/src/main/js/components/tutorials/manual/__tests__/TokenStep-test.tsx → server/sonar-web/src/main/js/components/tutorials/other/__tests__/TokenStep-test.tsx View File


server/sonar-web/src/main/js/components/tutorials/manual/__tests__/__snapshots__/BuildToolForm-test.tsx.snap → server/sonar-web/src/main/js/components/tutorials/other/__tests__/__snapshots__/BuildToolForm-test.tsx.snap View File


server/sonar-web/src/main/js/components/tutorials/manual/__tests__/__snapshots__/DoneNextSteps-test.tsx.snap → server/sonar-web/src/main/js/components/tutorials/other/__tests__/__snapshots__/DoneNextSteps-test.tsx.snap View File


server/sonar-web/src/main/js/components/tutorials/manual/__tests__/__snapshots__/ManualTutorial-test.tsx.snap → server/sonar-web/src/main/js/components/tutorials/other/__tests__/__snapshots__/OtherTutorial-test.tsx.snap View File

@@ -40,6 +40,7 @@ exports[`renders correctly: default 1`] = `
stepNumber={1}
/>
<ProjectAnalysisStep
baseUrl="http://example.com"
component={
Object {
"breadcrumbs": Array [],
@@ -62,6 +63,7 @@ exports[`renders correctly: default 1`] = `
"tags": Array [],
}
}
isLocal={false}
open={false}
stepNumber={2}
/>

server/sonar-web/src/main/js/components/tutorials/manual/__tests__/__snapshots__/ProjectAnalysisStep-test.tsx.snap → server/sonar-web/src/main/js/components/tutorials/other/__tests__/__snapshots__/ProjectAnalysisStep-test.tsx.snap View File

@@ -7,7 +7,7 @@ exports[`should render correctly 1`] = `
open={true}
renderForm={[Function]}
renderResult={[Function]}
stepNumber={1}
stepNumber={2}
stepTitle="onboarding.analysis.header"
/>
`;

server/sonar-web/src/main/js/components/tutorials/manual/__tests__/__snapshots__/TokenStep-test.tsx.snap → server/sonar-web/src/main/js/components/tutorials/other/__tests__/__snapshots__/TokenStep-test.tsx.snap View File


server/sonar-web/src/main/js/components/tutorials/manual/commands/AnalysisCommand.tsx → server/sonar-web/src/main/js/components/tutorials/other/commands/AnalysisCommand.tsx View File

@@ -29,12 +29,14 @@ import Other from './Other';

export interface AnalysisCommandProps {
component: Component;
baseUrl: string;
isLocal: boolean;
languageConfig: ManualTutorialConfig;
token?: string;
}

export default function AnalysisCommand(props: AnalysisCommandProps) {
const { component, languageConfig, token } = props;
const { component, baseUrl, isLocal, languageConfig, token } = props;

if (!token) {
return null;
@@ -54,12 +56,25 @@ export default function AnalysisCommand(props: AnalysisCommandProps) {

case BuildTools.CFamily:
return languageConfig.os !== undefined ? (
<ClangGCCCustom os={languageConfig.os} host={host} component={component} token={token} />
<ClangGCCCustom
os={languageConfig.os}
baseUrl={baseUrl}
host={host}
component={component}
isLocal={isLocal}
token={token}
/>
) : null;

case BuildTools.Other:
return languageConfig.os !== undefined ? (
<Other host={host} os={languageConfig.os} component={component} token={token} />
<Other
host={host}
os={languageConfig.os}
component={component}
isLocal={isLocal}
token={token}
/>
) : null;

default:

server/sonar-web/src/main/js/components/tutorials/manual/commands/ClangGCCCommand.tsx → server/sonar-web/src/main/js/components/tutorials/other/commands/ClangGCCCommand.tsx View File

@@ -28,21 +28,30 @@ import ExecScanner from './ExecScanner';

export interface ClangGCCCustomProps {
component: Component;
baseUrl: string;
isLocal: boolean;
host: string;
os: OSs;
token: string;
}

export default function ClangGCCCustom(props: ClangGCCCustomProps) {
const { os, host, component, token } = props;
const { os, baseUrl, host, component, isLocal, token } = props;

return (
<div>
<DownloadBuildWrapper os={os} />
<DownloadScanner os={os} />
<DownloadBuildWrapper isLocal={isLocal} baseUrl={baseUrl} os={os} />
<DownloadScanner isLocal={isLocal} os={os} token={token} />
<ExecBuildWrapper os={os} />
<CompilationInfo />
<ExecScanner host={host} component={component} os={os} token={token} cfamily={true} />
<ExecScanner
host={host}
isLocal={isLocal}
component={component}
os={os}
token={token}
cfamily={true}
/>
</div>
);
}

server/sonar-web/src/main/js/components/tutorials/manual/commands/DotNet.tsx → server/sonar-web/src/main/js/components/tutorials/other/commands/DotNet.tsx View File


server/sonar-web/src/main/js/components/tutorials/manual/commands/DotNetCore.tsx → server/sonar-web/src/main/js/components/tutorials/other/commands/DotNetCore.tsx View File

@@ -18,9 +18,9 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
import { Alert } from '../../../../components/ui/Alert';
import { translate } from '../../../../helpers/l10n';
import CodeSnippet from '../../../common/CodeSnippet';
import { Alert } from '../../../ui/Alert';
import { DotNetProps } from './DotNet';
import DotNetExecute from './DotNetExecute';


server/sonar-web/src/main/js/components/tutorials/manual/commands/DotNetExecute.tsx → server/sonar-web/src/main/js/components/tutorials/other/commands/DotNetExecute.tsx View File


server/sonar-web/src/main/js/components/tutorials/manual/commands/DotNetFramework.tsx → server/sonar-web/src/main/js/components/tutorials/other/commands/DotNetFramework.tsx View File


+ 88
- 0
server/sonar-web/src/main/js/components/tutorials/other/commands/DownloadBuildWrapper.tsx View File

@@ -0,0 +1,88 @@
/*
* SonarQube
* Copyright (C) 2009-2022 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 { FormattedMessage } from 'react-intl';
import { translate } from '../../../../helpers/l10n';
import { getBaseUrl } from '../../../../helpers/system';
import CodeSnippet from '../../../common/CodeSnippet';
import { OSs } from '../../types';

export interface DownloadBuildWrapperProps {
isLocal: boolean;
os: OSs;
baseUrl: string;
}

const FILENAMES: { [x in OSs]: string } = {
win: 'build-wrapper-win-x86',
linux: 'build-wrapper-linux-x86',
mac: 'build-wrapper-macosx-x86'
};

export default function DownloadBuildWrapper(props: DownloadBuildWrapperProps) {
const { os, isLocal, baseUrl } = props;
return (
<div className="spacer-bottom">
<h4 className="spacer-bottom">{translate('onboarding.analysis.build_wrapper.header', os)}</h4>
{isLocal ? (
<>
<p className="spacer-bottom markdown">
<FormattedMessage
defaultMessage={translate('onboarding.analysis.build_wrapper.text')}
id="onboarding.analysis.build_wrapper.text"
values={{
env_var: <code>{os === 'win' ? '%PATH%' : 'PATH'}</code>
}}
/>
</p>
<p>
<a
className="button"
download={`${FILENAMES[os]}.zip`}
href={`${getBaseUrl()}/static/cpp/${FILENAMES[os]}.zip`}
rel="noopener noreferrer"
target="_blank">
{translate('download_verb')}
</a>
</p>
</>
) : (
<CodeSnippet snippet={getRemoteDownloadSnippet(os, baseUrl)} />
)}
</div>
);
}

function getRemoteDownloadSnippet(os: OSs, baseUrl: string) {
if (os === OSs.Windows) {
return `$env:SONAR_DIRECTORY = [System.IO.Path]::Combine($(get-location).Path,".sonar")
rm "$env:SONAR_DIRECTORY/build-wrapper-win-x86" -Force -Recurse -ErrorAction SilentlyContinue
New-Item -path $env:SONAR_DIRECTORY/build-wrapper-win-x86 -type directory
(New-Object System.Net.WebClient).DownloadFile("${baseUrl}/static/cpp/build-wrapper-win-x86.zip", "$env:SONAR_DIRECTORY/build-wrapper-win-x86.zip")
Add-Type -AssemblyName System.IO.Compression.FileSystem
[System.IO.Compression.ZipFile]::ExtractToDirectory("$env:SONAR_DIRECTORY/build-wrapper-win-x86.zip", "$env:SONAR_DIRECTORY")
$env:Path += ";$env:SONAR_DIRECTORY/build-wrapper-win-x86"
`;
}
return `curl --create-dirs -sSLo $HOME/.sonar/${FILENAMES[os]}.zip ${baseUrl}/static/cpp/${FILENAMES[os]}.zip
unzip -o $HOME/.sonar/${FILENAMES[os]}.zip -d $HOME/.sonar/
export PATH=$HOME/.sonar/${FILENAMES[os]}:$PATH
`;
}

+ 105
- 0
server/sonar-web/src/main/js/components/tutorials/other/commands/DownloadScanner.tsx View File

@@ -0,0 +1,105 @@
/*
* SonarQube
* Copyright (C) 2009-2022 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 { FormattedMessage } from 'react-intl';
import { translate } from '../../../../helpers/l10n';
import CodeSnippet from '../../../common/CodeSnippet';
import { ClipboardButton } from '../../../controls/clipboard';
import { OSs } from '../../types';

export interface DownloadScannerProps {
isLocal: boolean;
os: OSs;
token: string;
}

export default function DownloadScanner(props: DownloadScannerProps) {
const { os, isLocal, token } = props;

return (
<div>
<h4 className="spacer-bottom">{translate('onboarding.analysis.sq_scanner.header', os)}</h4>
{isLocal ? (
<p className="spacer-bottom markdown">
<FormattedMessage
defaultMessage={translate('onboarding.analysis.sq_scanner.text')}
id="onboarding.analysis.sq_scanner.text"
values={{
dir: <code>bin</code>,
env_var: <code>{os === OSs.Windows ? '%PATH%' : 'PATH'}</code>,
link: (
<a
href="https://redirect.sonarsource.com/doc/download-scanner.html"
rel="noopener noreferrer"
target="_blank">
{translate('onboarding.analysis.sq_scanner.docs_link')}
</a>
)
}}
/>
</p>
) : (
<>
<CodeSnippet snippet={getRemoteDownloadSnippet(os)} />
<h4 className="spacer-bottom big-spacer-top">
{translate('onboarding.analysis.sq_scanner.sonar_token_env.header')}
</h4>
<ul className="list-styled">
<li className="markdown">
{translate('onboarding.analysis.sq_scanner.sonar_token_env.var_name')}:{' '}
<code>SONAR_TOKEN</code>
<ClipboardButton className="spacer-left" copyValue="SONAR_TOKEN" />
</li>
<li className="markdown">
{translate('onboarding.analysis.sq_scanner.sonar_token_env.var_value')}:{' '}
<code>{token}</code>
<ClipboardButton className="spacer-left" copyValue={token} />
</li>
</ul>
</>
)}
</div>
);
}

function getRemoteDownloadSnippet(os: OSs) {
if (os === OSs.Windows) {
return `$env:SONAR_SCANNER_VERSION = "4.7.0.2747"
$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"
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")
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
$env:Path += ";$env:SONAR_SCANNER_HOME/bin"
$env:SONAR_SCANNER_OPTS="-server"
`;
}
const suffix = os === OSs.MacOS ? 'macosx' : 'linux';
return `export SONAR_SCANNER_VERSION=4.7.0.2747
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
unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/
export PATH=$SONAR_SCANNER_HOME/bin:$PATH
export SONAR_SCANNER_OPTS="-server"
`;
}

server/sonar-web/src/main/js/components/tutorials/manual/commands/ExecBuildWrapper.tsx → server/sonar-web/src/main/js/components/tutorials/other/commands/ExecBuildWrapper.tsx View File


server/sonar-web/src/main/js/components/tutorials/manual/commands/ExecScanner.tsx → server/sonar-web/src/main/js/components/tutorials/other/commands/ExecScanner.tsx View File

@@ -31,13 +31,14 @@ import DoneNextSteps from '../DoneNextSteps';
export interface ExecScannerProps {
component: Component;
host: string;
isLocal: boolean;
os: OSs;
token: string;
cfamily?: boolean;
}

export default function ExecScanner(props: ExecScannerProps) {
const { host, os, component, token, cfamily } = props;
const { host, os, isLocal, component, token, cfamily } = props;

const q = quote(os);
const command = [
@@ -46,12 +47,12 @@ export default function ExecScanner(props: ExecScannerProps) {
'-D' + q('sonar.sources=.'),
cfamily ? '-D' + q('sonar.cfamily.build-wrapper-output=bw-output') : undefined,
'-D' + q(`sonar.host.url=${host}`),
'-D' + q(`sonar.login=${token}`)
isLocal ? '-D' + q(`sonar.login=${token}`) : undefined
];

return (
<div>
<h4 className="huge-spacer-top spacer-bottom">
<h4 className="big-spacer-top spacer-bottom">
{translate('onboarding.analysis.sq_scanner.execute')}
</h4>
<InstanceMessage message={translate('onboarding.analysis.sq_scanner.execute.text')}>

server/sonar-web/src/main/js/components/tutorials/manual/commands/JavaGradle.tsx → server/sonar-web/src/main/js/components/tutorials/other/commands/JavaGradle.tsx View File


server/sonar-web/src/main/js/components/tutorials/manual/commands/JavaMaven.tsx → server/sonar-web/src/main/js/components/tutorials/other/commands/JavaMaven.tsx View File


server/sonar-web/src/main/js/components/tutorials/manual/commands/Other.tsx → server/sonar-web/src/main/js/components/tutorials/other/commands/Other.tsx View File

@@ -25,18 +25,19 @@ import ExecScanner from './ExecScanner';

export interface OtherProps {
component: Component;
isLocal: boolean;
host: string;
os: OSs;
token: string;
}

export default function Other(props: OtherProps) {
const { host, os, component, token } = props;
const { host, os, component, isLocal, token } = props;

return (
<div>
<DownloadScanner os={os} />
<ExecScanner host={host} os={os} component={component} token={token} />
<DownloadScanner isLocal={isLocal} os={os} token={token} />
<ExecScanner host={host} isLocal={isLocal} os={os} component={component} token={token} />
</div>
);
}

server/sonar-web/src/main/js/components/tutorials/manual/commands/__tests__/AnalysisCommand-test.tsx → server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/AnalysisCommand-test.tsx View File

@@ -50,6 +50,13 @@ it('renders correctly', () => {

function shallowRender(props: Partial<AnalysisCommandProps> = {}) {
return shallow<AnalysisCommandProps>(
<AnalysisCommand component={mockComponent()} languageConfig={{}} token="myToken" {...props} />
<AnalysisCommand
component={mockComponent()}
baseUrl="http://example.com"
isLocal={true}
languageConfig={{}}
token="myToken"
{...props}
/>
);
}

server/sonar-web/src/main/js/components/tutorials/manual/commands/__tests__/CLangGCCCommand-test.tsx → server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/CLangGCCCommand-test.tsx View File

@@ -28,6 +28,8 @@ it('should render correctly', () => {
shallow(
<ClangGCCCommand
os={OSs.Linux}
baseUrl="http://example.com"
isLocal={true}
host="host"
component={mockComponent({ key: 'projectKey' })}
token="token"

server/sonar-web/src/main/js/components/tutorials/manual/commands/__tests__/DotNet-test.tsx → server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/DotNet-test.tsx View File


server/sonar-web/src/main/js/components/tutorials/manual/commands/__tests__/DotNetExecute-test.tsx → server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/DotNetExecute-test.tsx View File


server/sonar-web/src/main/js/components/tutorials/manual/commands/__tests__/DotNetFramework-test.tsx → server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/DotNetFramework-test.tsx View File


server/sonar-web/src/main/js/components/tutorials/manual/commands/__tests__/DotnetCore-test.tsx → server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/DotnetCore-test.tsx View File


server/sonar-web/src/main/js/components/tutorials/manual/commands/__tests__/DownloadBuildWrapper-test.tsx → server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/DownloadBuildWrapper-test.tsx View File

@@ -20,8 +20,15 @@
import { shallow } from 'enzyme';
import * as React from 'react';
import { OSs } from '../../../types';
import DownloadBuildWrapper from '../DownloadBuildWrapper';
import DownloadBuildWrapper, { DownloadBuildWrapperProps } from '../DownloadBuildWrapper';

it.each([OSs.Linux, OSs.Windows, OSs.MacOS])('Shoud renders for %p correctly', os => {
expect(shallow(<DownloadBuildWrapper os={os} />)).toMatchSnapshot();
it.each([OSs.Linux, OSs.Windows, OSs.MacOS])('should render correctly for %p', os => {
expect(shallowRender({ os, isLocal: false })).toMatchSnapshot('remote');
expect(shallowRender({ os })).toMatchSnapshot('local');
});

function shallowRender(props: Partial<DownloadBuildWrapperProps> = {}) {
return shallow<DownloadBuildWrapperProps>(
<DownloadBuildWrapper baseUrl="http://example.com" isLocal={true} os={OSs.Linux} {...props} />
);
}

server/sonar-web/src/main/js/components/tutorials/manual/commands/__tests__/DownloadScanner-test.tsx → server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/DownloadScanner-test.tsx View File

@@ -20,8 +20,15 @@
import { shallow } from 'enzyme';
import * as React from 'react';
import { OSs } from '../../../types';
import DownloadScanner from '../DownloadScanner';
import DownloadScanner, { DownloadScannerProps } from '../DownloadScanner';

it.each([OSs.Linux, OSs.Windows, OSs.MacOS])('Shoud renders for %p correctly', os => {
expect(shallow(<DownloadScanner os={os} />)).toMatchSnapshot();
it.each([OSs.Linux, OSs.Windows, OSs.MacOS])('should render correctly for %p', os => {
expect(shallowRender({ isLocal: false, os })).toMatchSnapshot('remote');
expect(shallowRender({ os })).toMatchSnapshot('local');
});

function shallowRender(props: Partial<DownloadScannerProps> = {}) {
return shallow<DownloadScannerProps>(
<DownloadScanner isLocal={true} os={OSs.Linux} token="token" {...props} />
);
}

server/sonar-web/src/main/js/components/tutorials/manual/commands/__tests__/ExecBuildWrapper-test.tsx → server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/ExecBuildWrapper-test.tsx View File


server/sonar-web/src/main/js/components/tutorials/manual/commands/__tests__/ExecScanner-test.tsx → server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/ExecScanner-test.tsx View File

@@ -31,10 +31,15 @@ it('should render correctly for cfamily', () => {
expect(shallowRender({ cfamily: true })).toMatchSnapshot();
});

it('should render correctly for remote execution', () => {
expect(shallowRender({ isLocal: false })).toMatchSnapshot();
});

function shallowRender(props: Partial<ExecScannerProps> = {}) {
return shallow<ExecScannerProps>(
<ExecScanner
host="host"
isLocal={true}
os={OSs.Linux}
component={mockComponent({ key: 'projectKey' })}
token="token"

server/sonar-web/src/main/js/components/tutorials/manual/commands/__tests__/JavaGradle-test.tsx → server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/JavaGradle-test.tsx View File


server/sonar-web/src/main/js/components/tutorials/manual/commands/__tests__/JavaMaven-test.tsx → server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/JavaMaven-test.tsx View File


server/sonar-web/src/main/js/components/tutorials/manual/commands/__tests__/Other-test.tsx → server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/Other-test.tsx View File

@@ -31,6 +31,7 @@ function shallowRender(props: Partial<OtherProps> = {}) {
return shallow<OtherProps>(
<Other
host="host"
isLocal={true}
os={OSs.Linux}
component={mockComponent({ key: 'projectKey' })}
token="token"

server/sonar-web/src/main/js/components/tutorials/manual/commands/__tests__/__snapshots__/AnalysisCommand-test.tsx.snap → server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/__snapshots__/AnalysisCommand-test.tsx.snap View File

@@ -31,6 +31,7 @@ exports[`renders correctly: .NET 1`] = `

exports[`renders correctly: CFamily 1`] = `
<ClangGCCCustom
baseUrl="http://example.com"
component={
Object {
"breadcrumbs": Array [],
@@ -54,6 +55,7 @@ exports[`renders correctly: CFamily 1`] = `
}
}
host="HOST"
isLocal={true}
os="linux"
token="myToken"
/>
@@ -144,6 +146,7 @@ exports[`renders correctly: other 1`] = `
}
}
host="HOST"
isLocal={true}
os="win"
token="myToken"
/>

server/sonar-web/src/main/js/components/tutorials/manual/commands/__tests__/__snapshots__/CLangGCCCommand-test.tsx.snap → server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/__snapshots__/CLangGCCCommand-test.tsx.snap View File

@@ -3,10 +3,14 @@
exports[`should render correctly 1`] = `
<div>
<DownloadBuildWrapper
baseUrl="http://example.com"
isLocal={true}
os="linux"
/>
<DownloadScanner
isLocal={true}
os="linux"
token="token"
/>
<ExecBuildWrapper
os="linux"
@@ -37,6 +41,7 @@ exports[`should render correctly 1`] = `
}
}
host="host"
isLocal={true}
os="linux"
token="token"
/>

server/sonar-web/src/main/js/components/tutorials/manual/commands/__tests__/__snapshots__/DotNet-test.tsx.snap → server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/__snapshots__/DotNet-test.tsx.snap View File


server/sonar-web/src/main/js/components/tutorials/manual/commands/__tests__/__snapshots__/DotNetExecute-test.tsx.snap → server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/__snapshots__/DotNetExecute-test.tsx.snap View File


server/sonar-web/src/main/js/components/tutorials/manual/commands/__tests__/__snapshots__/DotNetFramework-test.tsx.snap → server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/__snapshots__/DotNetFramework-test.tsx.snap View File


server/sonar-web/src/main/js/components/tutorials/manual/commands/__tests__/__snapshots__/DotnetCore-test.tsx.snap → server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/__snapshots__/DotnetCore-test.tsx.snap View File


server/sonar-web/src/main/js/components/tutorials/manual/commands/__tests__/__snapshots__/DownloadBuildWrapper-test.tsx.snap → server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/__snapshots__/DownloadBuildWrapper-test.tsx.snap View File

@@ -1,6 +1,6 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Shoud renders for "linux" correctly 1`] = `
exports[`should render correctly for "linux": local 1`] = `
<div
className="spacer-bottom"
>
@@ -38,7 +38,25 @@ exports[`Shoud renders for "linux" correctly 1`] = `
</div>
`;

exports[`Shoud renders for "mac" correctly 1`] = `
exports[`should render correctly for "linux": remote 1`] = `
<div
className="spacer-bottom"
>
<h4
className="spacer-bottom"
>
onboarding.analysis.build_wrapper.header.linux
</h4>
<CodeSnippet
snippet="curl --create-dirs -sSLo $HOME/.sonar/build-wrapper-linux-x86.zip http://example.com/static/cpp/build-wrapper-linux-x86.zip
unzip -o $HOME/.sonar/build-wrapper-linux-x86.zip -d $HOME/.sonar/
export PATH=$HOME/.sonar/build-wrapper-linux-x86:$PATH
"
/>
</div>
`;

exports[`should render correctly for "mac": local 1`] = `
<div
className="spacer-bottom"
>
@@ -76,7 +94,25 @@ exports[`Shoud renders for "mac" correctly 1`] = `
</div>
`;

exports[`Shoud renders for "win" correctly 1`] = `
exports[`should render correctly for "mac": remote 1`] = `
<div
className="spacer-bottom"
>
<h4
className="spacer-bottom"
>
onboarding.analysis.build_wrapper.header.mac
</h4>
<CodeSnippet
snippet="curl --create-dirs -sSLo $HOME/.sonar/build-wrapper-macosx-x86.zip http://example.com/static/cpp/build-wrapper-macosx-x86.zip
unzip -o $HOME/.sonar/build-wrapper-macosx-x86.zip -d $HOME/.sonar/
export PATH=$HOME/.sonar/build-wrapper-macosx-x86:$PATH
"
/>
</div>
`;

exports[`should render correctly for "win": local 1`] = `
<div
className="spacer-bottom"
>
@@ -113,3 +149,25 @@ exports[`Shoud renders for "win" correctly 1`] = `
</p>
</div>
`;

exports[`should render correctly for "win": remote 1`] = `
<div
className="spacer-bottom"
>
<h4
className="spacer-bottom"
>
onboarding.analysis.build_wrapper.header.win
</h4>
<CodeSnippet
snippet="$env:SONAR_DIRECTORY = [System.IO.Path]::Combine($(get-location).Path,\\".sonar\\")
rm \\"$env:SONAR_DIRECTORY/build-wrapper-win-x86\\" -Force -Recurse -ErrorAction SilentlyContinue
New-Item -path $env:SONAR_DIRECTORY/build-wrapper-win-x86 -type directory
(New-Object System.Net.WebClient).DownloadFile(\\"http://example.com/static/cpp/build-wrapper-win-x86.zip\\", \\"$env:SONAR_DIRECTORY/build-wrapper-win-x86.zip\\")
Add-Type -AssemblyName System.IO.Compression.FileSystem
[System.IO.Compression.ZipFile]::ExtractToDirectory(\\"$env:SONAR_DIRECTORY/build-wrapper-win-x86.zip\\", \\"$env:SONAR_DIRECTORY\\")
$env:Path += \\";$env:SONAR_DIRECTORY/build-wrapper-win-x86\\"
"
/>
</div>
`;

+ 279
- 0
server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/__snapshots__/DownloadScanner-test.tsx.snap View File

@@ -0,0 +1,279 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`should render correctly for "linux": local 1`] = `
<div>
<h4
className="spacer-bottom"
>
onboarding.analysis.sq_scanner.header.linux
</h4>
<p
className="spacer-bottom markdown"
>
<FormattedMessage
defaultMessage="onboarding.analysis.sq_scanner.text"
id="onboarding.analysis.sq_scanner.text"
values={
Object {
"dir": <code>
bin
</code>,
"env_var": <code>
PATH
</code>,
"link": <a
href="https://redirect.sonarsource.com/doc/download-scanner.html"
rel="noopener noreferrer"
target="_blank"
>
onboarding.analysis.sq_scanner.docs_link
</a>,
}
}
/>
</p>
</div>
`;

exports[`should render correctly for "linux": remote 1`] = `
<div>
<h4
className="spacer-bottom"
>
onboarding.analysis.sq_scanner.header.linux
</h4>
<CodeSnippet
snippet="export SONAR_SCANNER_VERSION=4.7.0.2747
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
unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/
export PATH=$SONAR_SCANNER_HOME/bin:$PATH
export SONAR_SCANNER_OPTS=\\"-server\\"
"
/>
<h4
className="spacer-bottom big-spacer-top"
>
onboarding.analysis.sq_scanner.sonar_token_env.header
</h4>
<ul
className="list-styled"
>
<li
className="markdown"
>
onboarding.analysis.sq_scanner.sonar_token_env.var_name
:
<code>
SONAR_TOKEN
</code>
<ClipboardButton
className="spacer-left"
copyValue="SONAR_TOKEN"
/>
</li>
<li
className="markdown"
>
onboarding.analysis.sq_scanner.sonar_token_env.var_value
:
<code>
token
</code>
<ClipboardButton
className="spacer-left"
copyValue="token"
/>
</li>
</ul>
</div>
`;

exports[`should render correctly for "mac": local 1`] = `
<div>
<h4
className="spacer-bottom"
>
onboarding.analysis.sq_scanner.header.mac
</h4>
<p
className="spacer-bottom markdown"
>
<FormattedMessage
defaultMessage="onboarding.analysis.sq_scanner.text"
id="onboarding.analysis.sq_scanner.text"
values={
Object {
"dir": <code>
bin
</code>,
"env_var": <code>
PATH
</code>,
"link": <a
href="https://redirect.sonarsource.com/doc/download-scanner.html"
rel="noopener noreferrer"
target="_blank"
>
onboarding.analysis.sq_scanner.docs_link
</a>,
}
}
/>
</p>
</div>
`;

exports[`should render correctly for "mac": remote 1`] = `
<div>
<h4
className="spacer-bottom"
>
onboarding.analysis.sq_scanner.header.mac
</h4>
<CodeSnippet
snippet="export SONAR_SCANNER_VERSION=4.7.0.2747
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
unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/
export PATH=$SONAR_SCANNER_HOME/bin:$PATH
export SONAR_SCANNER_OPTS=\\"-server\\"
"
/>
<h4
className="spacer-bottom big-spacer-top"
>
onboarding.analysis.sq_scanner.sonar_token_env.header
</h4>
<ul
className="list-styled"
>
<li
className="markdown"
>
onboarding.analysis.sq_scanner.sonar_token_env.var_name
:
<code>
SONAR_TOKEN
</code>
<ClipboardButton
className="spacer-left"
copyValue="SONAR_TOKEN"
/>
</li>
<li
className="markdown"
>
onboarding.analysis.sq_scanner.sonar_token_env.var_value
:
<code>
token
</code>
<ClipboardButton
className="spacer-left"
copyValue="token"
/>
</li>
</ul>
</div>
`;

exports[`should render correctly for "win": local 1`] = `
<div>
<h4
className="spacer-bottom"
>
onboarding.analysis.sq_scanner.header.win
</h4>
<p
className="spacer-bottom markdown"
>
<FormattedMessage
defaultMessage="onboarding.analysis.sq_scanner.text"
id="onboarding.analysis.sq_scanner.text"
values={
Object {
"dir": <code>
bin
</code>,
"env_var": <code>
%PATH%
</code>,
"link": <a
href="https://redirect.sonarsource.com/doc/download-scanner.html"
rel="noopener noreferrer"
target="_blank"
>
onboarding.analysis.sq_scanner.docs_link
</a>,
}
}
/>
</p>
</div>
`;

exports[`should render correctly for "win": remote 1`] = `
<div>
<h4
className="spacer-bottom"
>
onboarding.analysis.sq_scanner.header.win
</h4>
<CodeSnippet
snippet="$env:SONAR_SCANNER_VERSION = \\"4.7.0.2747\\"
$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\\"
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\\")
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
$env:Path += \\";$env:SONAR_SCANNER_HOME/bin\\"
$env:SONAR_SCANNER_OPTS=\\"-server\\"
"
/>
<h4
className="spacer-bottom big-spacer-top"
>
onboarding.analysis.sq_scanner.sonar_token_env.header
</h4>
<ul
className="list-styled"
>
<li
className="markdown"
>
onboarding.analysis.sq_scanner.sonar_token_env.var_name
:
<code>
SONAR_TOKEN
</code>
<ClipboardButton
className="spacer-left"
copyValue="SONAR_TOKEN"
/>
</li>
<li
className="markdown"
>
onboarding.analysis.sq_scanner.sonar_token_env.var_value
:
<code>
token
</code>
<ClipboardButton
className="spacer-left"
copyValue="token"
/>
</li>
</ul>
</div>
`;

server/sonar-web/src/main/js/components/tutorials/manual/commands/__tests__/__snapshots__/ExecBuildWrapper-test.tsx.snap → server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/__snapshots__/ExecBuildWrapper-test.tsx.snap View File


server/sonar-web/src/main/js/components/tutorials/manual/commands/__tests__/__snapshots__/ExecScanner-test.tsx.snap → server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/__snapshots__/ExecScanner-test.tsx.snap View File

@@ -3,7 +3,7 @@
exports[`should render correctly for "linux" 1`] = `
<div>
<h4
className="huge-spacer-top spacer-bottom"
className="big-spacer-top spacer-bottom"
>
onboarding.analysis.sq_scanner.execute
</h4>
@@ -73,7 +73,7 @@ exports[`should render correctly for "linux" 1`] = `
exports[`should render correctly for "mac" 1`] = `
<div>
<h4
className="huge-spacer-top spacer-bottom"
className="big-spacer-top spacer-bottom"
>
onboarding.analysis.sq_scanner.execute
</h4>
@@ -143,7 +143,7 @@ exports[`should render correctly for "mac" 1`] = `
exports[`should render correctly for "win" 1`] = `
<div>
<h4
className="huge-spacer-top spacer-bottom"
className="big-spacer-top spacer-bottom"
>
onboarding.analysis.sq_scanner.execute
</h4>
@@ -213,7 +213,7 @@ exports[`should render correctly for "win" 1`] = `
exports[`should render correctly for cfamily 1`] = `
<div>
<h4
className="huge-spacer-top spacer-bottom"
className="big-spacer-top spacer-bottom"
>
onboarding.analysis.sq_scanner.execute
</h4>
@@ -279,3 +279,73 @@ exports[`should render correctly for cfamily 1`] = `
/>
</div>
`;

exports[`should render correctly for remote execution 1`] = `
<div>
<h4
className="big-spacer-top spacer-bottom"
>
onboarding.analysis.sq_scanner.execute
</h4>
<InstanceMessage
message="onboarding.analysis.sq_scanner.execute.text"
>
<Component />
</InstanceMessage>
<CodeSnippet
isOneLine={false}
snippet={
Array [
"sonar-scanner",
"-Dsonar.projectKey=projectKey",
"-Dsonar.sources=.",
undefined,
"-Dsonar.host.url=host",
undefined,
]
}
/>
<p
className="big-spacer-top markdown"
>
<FormattedMessage
defaultMessage="onboarding.analysis.sq_scanner.docs"
id="onboarding.analysis.sq_scanner.docs"
values={
Object {
"link": <Link
target="_blank"
to="/documentation/analysis/scan/sonarscanner/"
>
onboarding.analysis.sq_scanner.docs_link
</Link>,
}
}
/>
</p>
<DoneNextSteps
component={
Object {
"breadcrumbs": Array [],
"key": "projectKey",
"name": "MyProject",
"qualifier": "TRK",
"qualityGate": Object {
"isDefault": true,
"key": "30",
"name": "Sonar way",
},
"qualityProfiles": Array [
Object {
"deleted": false,
"key": "my-qp",
"language": "ts",
"name": "Sonar way",
},
],
"tags": Array [],
}
}
/>
</div>
`;

server/sonar-web/src/main/js/components/tutorials/manual/commands/__tests__/__snapshots__/JavaGradle-test.tsx.snap → server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/__snapshots__/JavaGradle-test.tsx.snap View File


server/sonar-web/src/main/js/components/tutorials/manual/commands/__tests__/__snapshots__/JavaMaven-test.tsx.snap → server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/__snapshots__/JavaMaven-test.tsx.snap View File


server/sonar-web/src/main/js/components/tutorials/manual/commands/__tests__/__snapshots__/Other-test.tsx.snap → server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/__snapshots__/Other-test.tsx.snap View File

@@ -3,7 +3,9 @@
exports[`renders correctly 1`] = `
<div>
<DownloadScanner
isLocal={true}
os="linux"
token="token"
/>
<ExecScanner
component={
@@ -29,6 +31,7 @@ exports[`renders correctly 1`] = `
}
}
host="host"
isLocal={true}
os="linux"
token="token"
/>

+ 1
- 1
server/sonar-web/src/main/js/components/tutorials/types.ts View File

@@ -18,7 +18,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
export enum TutorialModes {
Manual = 'manual',
Local = 'local',
Jenkins = 'jenkins',
BitbucketPipelines = 'bitbucket-pipelines',
GitLabCI = 'gitlab-ci',

+ 5
- 2
sonar-core/src/main/resources/org/sonar/l10n/core.properties View File

@@ -3563,6 +3563,9 @@ onboarding.analysis.sq_scanner.execute.text.custom=Run the following commands in
onboarding.analysis.sq_scanner.docs=Please visit the {link} for more details.
onboarding.analysis.sq_scanner.docs_use_case=Please visit the {link} for more details, and the {useCaseLink} to know more about this use case.
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.sqscanner.docs.gradle.title=official documentation of the Scanner for Gradle
onboarding.analysis.sqscanner.docs.gradle.example_project.title=live Gradle-based example project

@@ -3593,8 +3596,8 @@ onboarding.tutorial.cfamily.examples_repositories_description=Check out our C an

onboarding.tutorial.choose_method=How do you want to analyze your repository?
onboarding.tutorial.choose_method.devops_platform.description=Do you want to integrate with your favorite CI? Choose one of the following tutorials.
onboarding.tutorial.choose_method.locally.description=Are you just testing or have an advanced use-case? Analyze your project locally.
onboarding.tutorial.choose_method.manual=Locally
onboarding.tutorial.choose_method.local.description=Are you just testing or have an advanced use-case? Analyze your project locally.
onboarding.tutorial.choose_method.local=Locally
onboarding.tutorial.choose_method.other-ci=Other CI
onboarding.tutorial.choose_method.jenkins=With Jenkins
onboarding.tutorial.choose_method.github-actions=With GitHub Actions

Loading…
Cancel
Save