It is easy to clone a project in Octopus Deploy. However, once that is done, keeping the child project's process in sync with the parent project is very painful. You have to go into each child project and update it manually. The space cloner script was designed with this use case in mind.
Please refer to the how it works page to get a full list of items cloned and not cloned.
This example is syncing the parent project in the same space.
Please refer to the Parameter reference page for more details on the parameters.
Options:
OverwriteExistingVariables
- set tofalse
to keep the differences preserved. Any new variable found will be added.OverwriteExistingCustomStepTemplates
- Set totrue
as you'll want to make sure you have the latest step templates.OverwriteExistingLifecyclesPhases
- Set tofalse
because you've most likely have a unique lifecycle.CloneProjectChannelRules
- set tofalse
as the project already exists with its own rules.CloneProjectVersioningReleaseCreationSettings
- set tofalse
as you'll want to exclude the release creation settings.CloneProjectDeploymentProcess
- set totrue
as you'll want to include the project deployment process.CloneProjectRunbooks
- set totrue
as you'll want to include the project runbooks.
CloneSpace.ps1 -SourceOctopusUrl "https://instance1.yoursite.com" `
-SourceOctopusApiKey "SOME KEY" `
-SourceSpaceName "My Space Name" `
-DestinationOctopusUrl "https://instance1.yoursite.com" `
-DestinationOctopusApiKey "My Key" `
-DestinationSpaceName "New Space Name" `
-ParentProjectName "Redgate - Feature Branch Example" `
-ChildProjectsToSync "Redgate - Child*" `
-OverwriteExistingVariables "false" `
-OverwriteExistingCustomStepTemplates "true" `
-OverwriteExistingLifecyclesPhases "false" `
-CloneProjectChannelRules "false" `
-CloneProjectVersioningReleaseCreationSettings "false" `
-CloneProjectRunbooks "true" `
-CloneProjectDeploymentProcess "true"
This example is syncing the parent project in the same space.
Please refer to the Parameter reference page for more details on the parameters.
Options:
OverwriteExistingVariables
- set tofalse
to keep the differences preserved. Any new variable found will be added still.CloneProjectChannelRules
- set tofalse
as its the same space in the same instance, and this makes no sense to rune.CloneProjectVersioningReleaseCreationSettings
- set tofalse
as you'll want to exclude the release creation settings.CloneProjectDeploymentProcess
- set totrue
as you'll want to include the project deployment process.CloneProjectRunbooks
- set totrue
as you'll want to include the project runbooks.
CloneSpace.ps1 -SourceOctopusUrl "https://instance1.yoursite.com" `
-SourceOctopusApiKey "SOME KEY" `
-SourceSpaceName "My Space Name" `
-ParentProjectName "Redgate - Feature Branch Example" `
-ChildProjectsToSync "Redgate - Child*" `
-OverwriteExistingVariables "false" `
-CloneProjectChannelRules "false" `
-CloneProjectVersioningReleaseCreationSettings "false" `
-CloneProjectRunbooks "true" `
-CloneProjectDeploymentProcess "true"
This example is syncing the parent project in the same space.
Please refer to the Parameter reference page for more details on the parameters.
Options:
OverwriteExistingVariables
- set tofalse
to keep the differences preserved. Any new variable found will be added.CloneProjectChannelRules
- set tofalse
as you are not cloning the deployment process.CloneProjectVersioningReleaseCreationSettings
- set tofalse
as you are not cloning the deployment process.CloneProjectDeploymentProcess
- set tofalse
as you are not cloning the deployment process.CloneProjectLogos
- set tofalse
as you only want the runbook(s).CloneProjectRunbooks
- set totrue
as you want to clone runbooks.ProcessCloningOption
- set toKeepAdditionalDestinationSteps
in the event you are cloning to an existing runbookProcessEnvironmentScopingMatch
- set toSkipUnlessPartialMatch
as you are cloning in the same space.ProcessChannelScopingMatch
- set toSkipUnlessPartialMatch
as you are cloning in the same space.ProcessTenantTagsScopingMatch
- set toSkipUnlessPartialMatch
as you are cloning in the same space.VariableChannelScopingMatch
- set toSkipUnlessPartialMatch
as you are cloning in the same space.VariableEnvironmentScopingMatch
- set toSkipUnlessPartialMatch
as you are cloning in the same space.VariableProcessOwnerScopingMatch
- set toSkipUnlessPartialMatch
as you are cloning in the same space.VariableActionScopingMatch
- set toSkipUnlessPartialMatch
as you are cloning in the same space.VariableMachineScopingMatch
- set toSkipUnlessPartialMatch
as you are cloning in the same space.VariableTenantTagsScopingMatch
- set toSkipUnlessPartialMatch
as you are cloning in the same space.VariableAccountScopingMatch
- set toSkipUnlessPartialMatch
as you are cloning in the same space.VariableCertificateScopingMatch
- set toSkipUnlessPartialMatch
as you are cloning in the same space.
CloneSpace.ps1 -SourceOctopusUrl "https://instance1.yoursite.com" `
-SourceOctopusApiKey "SOME KEY" `
-SourceSpaceName "My Space Name" `
-DestinationOctopusUrl "https://instance1.yoursite.com" `
-DestinationOctopusApiKey "My Key" `
-DestinationSpaceName "New Space Name" `
-ParentProjectName "Redgate - Feature Branch Example" `
-ChildProjectsToSync "Redgate - Child*" `
-RunbooksToClone "YOUR RUNBOOK NAME" `
-OverwriteExistingVariables "false" `
-CloneProjectChannelRules "false" `
-CloneProjectVersioningReleaseCreationSettings "false" `
-CloneProjectDeploymentProcess "false" `
-CloneProjectLogos "false" `
-CloneProjectRunbooks "true" `
-ProcessCloningOption "KeepAdditionalDestinationSteps" `
-ProcessEnvironmentScopingMatch "SkipUnlessPartialMatch" `
-ProcessChannelScopingMatch "SkipUnlessPartialMatch" `
-ProcessTenantTagsScopingMatch "SkipUnlessPartialMatch" `
-VariableChannelScopingMatch "SkipUnlessPartialMatch" `
-VariableEnvironmentScopingMatch "SkipUnlessPartialMatch" `
-VariableProcessOwnerScopingMatch "SkipUnlessPartialMatch" `
-VariableActionScopingMatch "SkipUnlessPartialMatch" `
-VariableMachineScopingMatch "SkipUnlessPartialMatch" `
-VariableTenantTagsScopingMatch "SkipUnlessPartialMatch" `
-VariableAccountScopingMatch "SkipUnlessPartialMatch" `
-VariableCertificateScopingMatch "SkipUnlessPartialMatch"