Giter Site home page Giter Site logo

octopusdeploylabs / spacecloner Goto Github PK

View Code? Open in Web Editor NEW
21.0 5.0 18.0 2.09 MB

A tool to clone/sync a space, project, and/or other items between different spaces in the same Octopus Deploy instances or spaces in different instances.

License: Apache License 2.0

PowerShell 100.00%

spacecloner's Issues

Re-running same script is failing

Re-running same script failing.
"ErrorMessage": "A package reference with the ID 'ca503692-1e2e-453c-a1b0-ed7adecf5aeb' already exists"
are we doing any check if things are already available then don't create?

Spaces in filters cause items not to be picked up

If you set you project filter to be "testing, testing 2" the space cloner will not find "testing 2" even if it exists. Humans are used to adding spaces after commas. The space cloner should account for that.

Step templates cannot be cloned when package is deferred with a feedid

In newer versions of Octopus Deploy, a step template a package can be deferred until it is added to a process. Some more recent versions have set a value for feed-id, but include the term NonExisting. The package conversion process is only expecting nulls, so that needs to be accounted for.

API error messages are not super useful

When an error occurs calling the API the space cloner will log the exception to the log, but not write it out on the screen for the user to read through. This requires the user to go through the log and find where the exception occurs.

In addition, the script throws an exception instead of writing a useful error message and stopping.

Join-Path : A positional parameter cannot be found that accepts argument 'Core'.

When trying to execute CloneSpaceProject.ps1, it errors with the below:

Join-Path : A positional parameter cannot be found that accepts argument 'Core'.
At C:\Users\derek\Downloads\SpaceCloner-1.8.2\CloneSpaceProject.ps1:27 char:4

  • . (Join-Path $PSScriptRoot "src" "Core" "Logging.ps1")
+ CategoryInfo          : InvalidArgument: (:) [Join-Path], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.PowerShell.Commands.JoinPathCommand

Command run with values changed

.\CloneSpaceProject.ps1 -SourceOctopusUrl "URLOFSPACE" -SourceOctopusApiKey "SECUREAPIKEY"
-SourceSpaceName "SpaceName -DestinationOctopusUrl "DestinationURL"
-DestinationOctopusApiKey "SECUREAPIKEY" -DestinationSpaceName "Default"
-ProjectsToClone "all"

This issue has been confirmed by additional users.

Invalid Operation when running CloneSpace.ps1

An error with version 3.0.0 when running CloneSpace.ps1

Command line call is

./CloneSpace.ps1 -SourceOctopusUrl "https://octopus.mysite.com/" -SourceOctopusApiKey "API-12345678" -SourceSpaceName "Development" -DestinationOctopusUrl "https://octopus.mysite.com" -DestinationOctopusApiKey "API-12345678" -DestinationSpaceName "NextApp" -WorkerPoolsToClone "Prod Linux Docker Workers"    
InvalidOperation: C:\[...]\SpaceCloner\src\Core\Util.ps1:663                                                                                                             Line |                                                                                                                   663 |      $lowerParameterValue = $parameterValue.ToLower().Trim()                                                          |      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                                          | You cannot call a method on a null-valued expression.                                                                                                                                 

PowerShell arrays simply being added to

PowerShell arrays are finicky at best. When empty they could be null or plain empty. When a single item, they only return that single item. Part of what the space cloner does is it will add item to internal arrays (such as environment lists) when a new item is created. There is a util function Update-OctopusList that makes adding to those lists much easier. Several of the cloners are not using them, but they should be.

What if fails if there is a community step template that needs to be cloned

The what if fails when there is a community step template to clone. This is due to how community step templates are installed into Octopus. Rather than posting an body to the API, the API expects an empty body POST call to the endpoint ommunityactiontemplates/$($communityStepTemplate.Id)/installation/$($destinationData.SpaceId). This caused a problem with the what-if command as it is expected that when doing a POST or a PUT the body will have a value.

Step Template Cloning Fails when Properties.'Octopus.Action.Package.FeedId' parameter exists

When the step template has the following JSON only the Packages[index].FeedId is getting translated. The property Properties.'Octopus.Action.Package.FeedId' is never getting translated.

"Packages":  [
                     {
                         "Name":  "",
                         "Id":  null,
                         "PackageId":  "MyPackage",
                         "FeedId":  "Feeds-1003",
                         "AcquisitionLocation":  "Server",
                         "Properties":  {
                                            "SelectionMode":  "immediate"
                                        }
                     }
                 ],
    "Properties":  {
                       "Octopus.Action.Script.ScriptSource":  "Package",
                       "Octopus.Action.Script.ScriptFileName":  "Octopus.StepTemplate.AWS.ALB.SplashScreenManagement.ps1",
                       "Octopus.Action.Script.ScriptParameters":  "MyParameters",
                       "Octopus.Action.Package.PackageId":  "Octopus.StepTemplate.AWS.ALB.SplashScreenManagement",
                       "Octopus.Action.Package.FeedId":  "feeds-builtin",
                       "Octopus.Action.Package.DownloadOnTentacle":  "False"
                   },

Script Modules Cause Tenant Variable Cloning To Fail

When a tenant is tied to a project with a script module associated with it the variable cloning for that tenant will fail. This is because script modules are stored as library variable sets under the covers. The tenant cloner attempts to convert the variable set id to the destination, it cannot find it and it throws an error and stops the clone.

Project Variable Templates are not getting cloned when updating an existing project

The process to clone project variable templates only runs when a new project is created. Pre-existing projects will never have their project variable template list. This is due to a different code branch getting run when updating an existing project because of release versioning rules. A new project is basically a blind clone, while an existing project has specific properties copied over from the source.

Script Modules Cause Project Cloning Error

If a project has a script module you'll get an error that states something like this:

Critical Message: Unable to find the library variable set (or script module) LibraryVariableSets-241 assigned to project OctoFX - Simple Rollback

Recently a rule was added where all the library variable sets and script modules had to exist, however that rule only checked library variable sets for existence. Library variable sets and script modules are both "variable sets" but are stored in different lists. That project check needs to check both lists before throwing an error.

Cannot call method on null value expression when cloning variables

When cloning variables sometimes a user will run into this error:

InvalidOperation: C:\Users\Administrator\Downloads\SpaceCloner-3.0.4\src\Cloners\VariableSetValuesCloner.ps1:223

Line |

223 | if ($destinationVariable.IsSensitive -eq $false -and $sourceVaria โ€ฆ

 |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 | You cannot call a method on a null-valued expression.

Deploy A Release Steps not translating correctly

If the project is leveraging the Deploy a Release step it needs to translate the project ids currently being stored in the package ids correctly. Right now it is not and a missing resource error is appearing for any cloned project.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.