and then do the
$varset | update-octopusresource
I'll write more about this tomorrow morning : )
been working on this console project to load all the data needed for the tests to run this week. Like I mentioned earlier, this + a nice doc are the missing pieces to finally share a dev guide of the project so others can contribute to it.
^ That screenshot is the first try of running all the tests with the data generated by the console. I still haven't made the console create channels, deployments or releases, so 100/141 is not a bad first result.
Gonna work the rest of the week on improving those numbers, which will probable lead into refactoring lots of tests and writing brand new ones. Gonna try to tame the scope-creep inside of me as much as I can to ship this fast
Full Cake build:
Took it from 7-8min to 2:50 :tada:
:tada: We have on official first draft of the contributing guide :tada:
Still a WIP of cours
Get-OctopusMachine -ResourceOnly | select -ExpandProperty Name
Get-OctopusVariableSet). Here's a gist of doing it for a variableset object, it's not complete but it will give you the idea: https://gist.github.com/JamesDawson/54a09171911403e4bb68c8bd292031e7 Whilst I could write a bunch of functions to do this, it just struck me that it would be way more efficient to write all the instantiation code in C#... unless I'm missing something and there is already an easier way?
This snippet should work
In your code I can see you are creating some objects from the
Octoposh namespace. You should never do that, as the
Octoposh objects are just translations of the actual
Octopus objects for the human eyes.
If you want to create/update/delete anything in Octopus, you need to use Octopus objects.
-resourceOnly? That tells the cmdlet to return the actual Octopus resource, instead of the
Octoposhobject. Later on I add the variable (again an Octopus object, this time of the type
Octopus.client.model.variableResource) to the Octopus resource, and finally I pass the variable set Octopus object ($variableSet) to
-resourceOnlyparameter is super importante and a bit obscure atm. I've been trying to write documentation about it for ages but I always forget. I'll try to get it done this week.
Get-OctopusResourceModelcmdlet which will simplify creating my mock objects if I change my script to use
-ResourceOnlythroughout. Many thanks for the pointer.
Get-OctopusResourceModelthat made life easier when using it to create the test data objects I was talking about above... see what you think.