Releases: OctopusDeployLabs/SpaceCloner
Better Variable Matching
The variable matching with previous releases was too simplistic and resulted in variables not being cloned over. The variable matching logic has been re-written to now match a source variable with a destination variable by comparing.
- Name
- Sensitive vs non-sensitive
- Environment Scoping
- Machine Scoping
- Role Scoping
For projects, additional scoping matching is added
- Process Scoping
- Step Scoping
- Channel Scoping
If you modify the scoping on the source, or change from sensitive to non-sensitive (or vice versa) the cloner will see that as a new value and attempt to copy it over.
Because of this updated logic the parameter AddAdditionalVariableValuesOnExistingVariableSets
has been removed.
57% fewer dummy values for accounts
To make it easier to clone accounts, the account cloner will now clone the following values instead of generating dummy values.
- Azure Accounts
- Subscription Number
- Tenant Id
- Client Id
- AWS Accounts
- Access key
The description will have the following text appended to it (this text is added after any description).
Please note, the account cloner only copies accounts it does not find. Any existing accounts will be left alone. You can remove that extra text in the description. It won't be added again.
Step template package reference bug fix
- Support the certificate variable type (still doesn't clone certs, but supports the variable type now)
- Fixes a bug where step templates packages weren't getting cloned correctly with the built-in feed
- Fixes a bug where the azure cloner attempted to create a GUID object rather than a GUID string
- Will now show 401 unauthorized error instead of unable to read response stream error
- Tested against a
2020.5.x
instance
Variable Set Bug Fix
Fixing a minor bug with variable set cloning. Previously, if the variable already existed in the variable set no new variables would ever be added, even if the parameter AddAdditionalVariableValuesOnExistingVariableSets
was set to $true
.
Copy Library Variable Set in Same Space
There are cases when it makes sense to copy an existing library variable set in the same space. For example, a project group gets its own library variable set. A new script, CloneLibraryVariableSet.ps1
has been added to support that use case.
The script is a cut down version of the CloneSpace.ps1 script, you provide the source variable set name and the destination variable set name. The destination variable set does not need to exist, the script will create it for you. It is also possible to use this script to clone variable sets between instances and spaces.
Z:\Code.git\SpaceCloner_Labs\CloneLibraryVariableSet.ps1 `
-SourceOctopusUrl "https://samples.octopus.app" `
-SourceOctopusApiKey "API KEY" `
-SourceSpaceName "Demo" `
-DestinationOctopusUrl "https://samples.octopus.app" `
-DestinationOctopusApiKey "API KEY" `
-DestinationSpaceName "Demo" `
-SourceVariableSetName "Notification" `
-DestinationVariableSetName "Notification_New" `
-OverwriteExistingVariables $false `
-AddAdditionalVariableValuesOnExistingVariableSets $false `
-IgnoreVersionCheckResult $true `
-SkipPausingWhenIgnoringVersionCheckResult $true
Version check improvements
Added the ability to skip the version check. By default, if the version check is skipped it will pause for 20 seconds to let you cancel the run. You can elect to skip that pause as well.
The two new parameters.
IgnoreVersionCheckResult
- Indicates if the script should ignore version checks rules and proceed with the clone. This should only be used for cloning to test instances of Octopus Deploy. The default isfalse
.SkipPausingWhenIgnoringVersionCheckResult
- WhenIgnoreVersionCheckResult
is set to true the script will pause for 20 seconds when it detects a difference to let you cancel. You can skip that check by setting this totrue
. This should only be used for cloning to test instances of Octopus Deploy. The default isfalse
.
These parameters were added to help the Octopus Advisory Team set up test instances of EAP releases of Octopus Deploy. Typically EAP releases are on a newer minor version, 2020.5.0-rcxxx
while the GA release is 2020.3.6
.
This release fixed two bugs
- Version checker properly checks the minor version, not just the major version
- Explicit default values for all the pass-through parameters in the CloneSpaceProject.ps1 script.
Project Child Syncing Improvements
The project child syncing functionality of the space cloner is now more robust. It now supports the following use cases:
- Sync just the deployment process between a parent project and child project
- Sync just the runbook processes between the parent project and child project
- Select specific runbooks to clone
- Sync the channel version rules
- Sync the release version setting
In addition, a new file ProjectSyncer.ps1
has been created. It is designed to make it easier to sync projects in the same space. Fewer variables to worry about.
In this example, the project syncer will only clone the runbooks "Spin Up Azure SQL Server Database" and "Delete Azure SQL Server Database" from the parent project "DBUp SQL Server" to "DBUp Clone Tester". It won't sync the deployment process.
ProjectSyncer.ps1 `
-SourceOctopusUrl "https://samples.octopus.app" `
-SourceOctopusApiKey "API KEY!" `
-SourceSpaceName "Target - SQL Server" `
-ParentProjectName "DBUp SQL Server" `
-ChildProjectsToSync "DbUp Clone Tester" `
-RunbooksToClone "Spin Up Azure SQL Server Database,Delete Azure SQL Server Database" `
-OverwriteExistingVariables $true `
-AddAdditionalVariableValuesOnExistingVariableSets $true `
-OverwriteExistingCustomStepTemplates $false `
-OverwriteExistingLifecyclesPhases $false `
-CloneProjectChannelRules $true `
-CloneProjectRunbooks $true `
-CloneProjectVersioningReleaseCreationSettings $true `
-CloneProjectDeploymentProcess $false
Package cloning
This release adds:
- The ability to clone the latest packages from the source server to the destination server.
- If a package has build information associated with it, that is also uploaded.
- The CloneSpaceProject script will find the package(s) for each step and add them to the list to get cloned.
Please note: This is using a very simple download mechanism, it isn't the fastest in the world. Bigger packages will slow down runtimes. You can exclude packages by setting PackagesToClone
to $null
or excluding it altogether.
Bugs fixed:
- Downloading files now work when running the script on Linux / MacOS. The code uses
System.IO.Path.Combine
instead of hardcoding the forward or backslash.
Script Module Fixes
This release fixes the following bugs in the space cloner:
- Script modules are now cloned when using the CloneSpaceProject.ps1 script. Previously all script modules were skipped.
- Script modules are now being assigned to the project when cloning. Script modules and library variable sets were stored in the same array. The code was only looking at library variable sets.
- Process Owner clone is now being cloned; before it was skipping it.
- The scope is being overwritten along with the value when the option
OverwriteExistingVariables
is set to$True
. Previously it was just overwriting the value. Sensitive values are still left as-is. - Fixed an issue reported by a user when Octopus was located in a virtual directory.
Support for Runbooks++ and Execution Containers
New Features:
- Support for execution containers
- Support for runbook environment scoping
Bug Fixes:
- Added prefix "Warning" for all warning messages
- Added prefix "Critical Message" for all critical messages
- Fixed issue where azure account id was not found when cloning azure web apps
- Fixed issue where azure account id was not found when cloning K8s with Azure auth
- Will create a unique temporary image to help prevent "file is being used by another process."
- Will attempt to delete the temporary image, if it fails it will gracefully fail and warn the user
- Fixed an issue where the deployment targets weren't getting pulled from the right source