baseUrl={baseUrl}
component={component}
currentUser={currentUser}
+ mainBranchName={mainBranchName}
projectBinding={projectBinding}
willRefreshAutomatically={willRefreshAutomatically}
/>
export interface AnalysisCommandProps extends WithAvailableFeaturesProps {
buildTool: BuildTools;
+ mainBranchName: string;
component: Component;
}
-const YamlTemplate: Dictionary<(branchesEnabled?: boolean, projectKey?: string) => string> = {
+const YamlTemplate: Dictionary<(
+ branchesEnabled?: boolean,
+ mainBranchName?: string,
+ projectKey?: string
+) => string> = {
[BuildTools.Gradle]: gradleExample,
[BuildTools.Maven]: mavenExample,
[BuildTools.DotNet]: dotNetExample,
};
export function AnalysisCommand(props: AnalysisCommandProps) {
- const { buildTool, component } = props;
+ const { buildTool, mainBranchName, component } = props;
const branchSupportEnabled = props.hasFeature(Feature.BranchSupport);
if (!buildTool) {
return null;
}
- const yamlTemplate = YamlTemplate[buildTool](branchSupportEnabled, component.key);
+ const yamlTemplate = YamlTemplate[buildTool](branchSupportEnabled, mainBranchName, component.key);
return (
<>
baseUrl: string;
component: Component;
currentUser: LoggedInUser;
+ mainBranchName: string;
projectBinding?: ProjectAlmBindingResponse;
willRefreshAutomatically?: boolean;
}
currentUser,
component,
projectBinding,
- willRefreshAutomatically
+ willRefreshAutomatically,
+ mainBranchName
} = props;
const [step, setStep] = React.useState<Steps>(Steps.REPOSITORY_VARIABLES);
ci={TutorialModes.BitbucketPipelines}
/>
)}
- <AnalysisCommand buildTool={buildTool} component={component} />
+ <AnalysisCommand
+ buildTool={buildTool}
+ component={component}
+ mainBranchName={mainBranchName}
+ />
<FinishButton onClick={() => setStep(Steps.ALL_SET)} />
</>
)}
<AnalysisCommand
hasFeature={jest.fn().mockReturnValue(false)}
buildTool={BuildTools.DotNet}
+ mainBranchName="main"
component={mockComponent()}
{...props}
/>
<BitbucketPipelinesTutorial
almBinding={mockAlmSettingsInstance()}
baseUrl="test"
+ mainBranchName="main"
currentUser={mockLoggedInUser()}
component={mockComponent()}
projectBinding={mockProjectBitbucketCloudBindingResponse()}
pipelines:
branches:
- '{master}': # or the name of your main branch
+ '{main}':
- step: *build-step
"
/>
pipelines:
branches:
- '{master}': # or the name of your main branch
+ '{main}':
- step: *build-step
pull-requests:
pipelines:
branches:
- '{master}': # or the name of your main branch
+ '{main}':
- step: *build-step
"
/>
pipelines:
branches:
- '{master}': # or the name of your main branch
+ '{main}':
- step: *build-step
pull-requests:
pipelines:
branches:
- '{master}': # or the name of your main branch
+ '{main}':
- step: *build-step
"
/>
pipelines:
branches:
- '{master}': # or the name of your main branch
+ '{main}':
- step: *build-step
pull-requests:
pipelines:
branches:
- '{master}': # or the name of your main branch
+ '{main}':
- step: *build-step
"
/>
pipelines:
branches:
- '{master}': # or the name of your main branch
+ '{main}':
- step: *build-step
pull-requests:
pipelines:
branches:
- '{master}': # or the name of your main branch
+ '{main}':
- step: *build-step
"
/>
pipelines:
branches:
- '{master}': # or the name of your main branch
+ '{main}':
- step: *build-step
pull-requests:
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-export default function cFamilyExample(branchesEnabled: boolean) {
+export default function cFamilyExample(branchesEnabled: boolean, mainBranchName: string) {
return `image: <image ready for your build toolchain>
definitions:
pipelines:
branches:
- '{master}': # or the name of your main branch
+ '{${mainBranchName}}':
- step: *build-step
${
branchesEnabled
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-export default function dotNetExample(branchesEnabled: boolean, projectKey: string) {
+export default function dotNetExample(
+ branchesEnabled: boolean,
+ mainBranchName: string,
+ projectKey: string
+) {
return `image: mcr.microsoft.com/dotnet/core/sdk:latest
definitions:
pipelines:
branches:
- '{master}': # or the name of your main branch
+ '{${mainBranchName}}':
- step: *build-step
${
branchesEnabled
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-export default function gradleExample(branchesEnabled: boolean) {
+export default function gradleExample(branchesEnabled: boolean, mainBranchName: string) {
return `image: openjdk:8
definitions:
pipelines:
branches:
- '{master}': # or the name of your main branch
+ '{${mainBranchName}}':
- step: *build-step
${
branchesEnabled
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-export default function mavenExample(branchesEnabled: boolean, projectKey: string) {
+export default function mavenExample(
+ branchesEnabled: boolean,
+ mainBranchName: string,
+ projectKey: string
+) {
return `image: maven:3-openjdk-11
definitions:
pipelines:
branches:
- '{master}': # or the name of your main branch
+ '{${mainBranchName}}':
- step: *build-step
${
branchesEnabled
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-export default function othersExample(branchesEnabled: boolean) {
+export default function othersExample(branchesEnabled: boolean, mainBranchName: string) {
return `image: maven:3.3.9
definitions:
pipelines:
branches:
- '{master}': # or the name of your main branch
+ '{${mainBranchName}}':
- step: *build-step
${
branchesEnabled