Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .talismanrc
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
fileignoreconfig:
- filename: package-lock.json
checksum: 16a20411514058d2030b6240573078fad7640b745545a0463e9b70985f92425c
checksum: 60cf06e944b51a620589f6785874c0c771e6e12a01cb561ec60fc92bfddf70ee
- filename: pnpm-lock.yaml
checksum: d28afee9b463d66004354b9476b1e39344f903e2db3a15c5f83bd84e688c01d6
checksum: bee7058cd14780ac1a012ca95dccb89e62918f0e1bc9ea0d13d4c58d284e21e0
- filename: packages/contentstack-import-setup/test/unit/backup-handler.test.ts
checksum: 0582d62b88834554cf12951c8690a73ef3ddbb78b82d2804d994cf4148e1ef93
- filename: packages/contentstack-import-setup/test/config.json
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/contentstack-clone/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@contentstack/cli-cm-clone",
"description": "Contentstack stack clone plugin",
"version": "1.15.2",
"version": "1.16.0",
"author": "Contentstack",
"bugs": "https://github.com/rohitmishra209/cli-cm-clone/issues",
"dependencies": {
Expand Down
26 changes: 24 additions & 2 deletions packages/contentstack-clone/src/commands/cm/stacks/clone.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ class StackCloneCommand extends Command {
type: cloneType,
'stack-name': stackName,
'source-branch': sourceStackBranch,
'source-branch-alias': sourceStackBranchAlias,
'target-branch': targetStackBranch,
'target-branch-alias': targetStackBranchAlias,
'source-stack-api-key': sourceStackApiKey,
'destination-stack-api-key': destinationStackApiKey,
'source-management-token-alias': sourceManagementTokenAlias,
Expand Down Expand Up @@ -47,8 +49,14 @@ class StackCloneCommand extends Command {
if (sourceStackBranch) {
config.sourceStackBranch = sourceStackBranch;
}
if (sourceStackBranchAlias) {
config.sourceStackBranchAlias = sourceStackBranchAlias;
}
if (targetStackBranch) {
config.targetStackBranch = targetStackBranch;
}
if (targetStackBranchAlias) {
config.targetStackBranchAlias = targetStackBranchAlias;
}
if (sourceStackApiKey) {
config.source_stack = sourceStackApiKey;
Expand Down Expand Up @@ -202,11 +210,25 @@ StackCloneCommand.flags = {
required: false,
multiple: false,
description: 'Branch of the source stack.',
exclusive: ['source-branch-alias']
}),
'source-branch-alias': flags.string({
required: false,
multiple: false,
description: 'Alias of Branch of the source stack.',
exclusive: ['source-branch']
}),
'target-branch': flags.string({
required: false,
multiple: false,
description: 'Branch of the target stack.',
exclusive: ['target-branch-alias']
}),
'target-branch-alias': flags.string({
required: false,
multiple: false,
description: 'Alias of Branch of the target stack.',
exclusive: ['target-branch']
}),
'source-management-token-alias': flags.string({
required: false,
Expand All @@ -229,8 +251,8 @@ StackCloneCommand.flags = {
multiple: false,
options: ['a', 'b'],
description: ` Type of data to clone. You can select option a or b.
a) Structure (all modules except entries & assets).
b) Structure with content (all modules including entries & assets).
a) Structure (all modules except entries & assets).
b) Structure with content (all modules including entries & assets).
`,
}),
'source-stack-api-key': flags.string({
Expand Down
8 changes: 8 additions & 0 deletions packages/contentstack-clone/src/lib/util/clone-handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -634,6 +634,10 @@ class CloneHandler {
cmd.push('--branch', exportConfig.sourceStackBranch);
}

if (!exportConfig.sourceStackBranch && exportConfig.sourceStackBranchAlias) {
cmd.push('--branch-alias', exportConfig.sourceStackBranchAlias);
}

if (exportConfig.forceStopMarketplaceAppsPrompt) cmd.push('-y');

cmd.push('-c');
Expand Down Expand Up @@ -663,6 +667,10 @@ class CloneHandler {
if (importConfig.targetStackBranch) {
cmd.push('--branch', importConfig.targetStackBranch);
}

if (!importConfig.targetStackBranch && importConfig.targetStackBranchAlias) {
cmd.push('--branch-alias', importConfig.targetStackBranchAlias);
}
if (importConfig.importWebhookStatus) {
cmd.push('--import-webhook-status', importConfig.importWebhookStatus);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"@contentstack/cli-cm-bootstrap": "~1.15.1",
"@contentstack/cli-cm-branches": "~1.5.1",
"@contentstack/cli-cm-bulk-publish": "~1.9.1",
"@contentstack/cli-cm-clone": "~1.15.2",
"@contentstack/cli-cm-clone": "~1.16.0",
"@contentstack/cli-cm-export": "~1.20.0",
"@contentstack/cli-cm-export-to-csv": "~1.9.1",
"@contentstack/cli-cm-import": "~1.26.3",
Expand Down
Loading
Loading