-
Notifications
You must be signed in to change notification settings - Fork 120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add "create-channel" command. #77
Add "create-channel" command. #77
Conversation
Nice. I can see how this will become more and more useful over time also. As part of Octopus 3.4 we are rebuilding the dashboard views so you can pivot on different axes, like showing environment/channel which would show you the latest release in each environment per channel. After you're done with that feature branch it would be nice to easily delete the feature channel, and have all the releases get cleaned up... Food for thought. One comment inline. :) |
{ | ||
if (string.IsNullOrWhiteSpace(projectName)) throw new CommandException("Please specify a project using the parameter: --project=ProjectXYZ"); | ||
if (string.IsNullOrWhiteSpace(channelName)) throw new CommandException("Please specify a channel name using the parameter: --channel=ChannelXYZ"); | ||
if (string.IsNullOrWhiteSpace(lifecycleName)) throw new CommandException("Please specify a lifecycle name using the parameter: --lifecycle=LifecycleXYZ"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A null
lifecycle is allowed, which is interpreted as "Use the project's default lifecycle". I think for consistency octo.exe
should allow the same behaviour as the UI.
I've updated the pull request to make the lifecycle name non-mandatory as per the API. It's also updated to allow for case-insensitive matches of channel and lifecycle names (again, as per the API). |
Not sure if commenting on closed issues is ok, or not, but here goes nothing :) Maybe we're going about this the wrong way, so if you guys have any feedback or suggestions to better solutions to this, I would be extremely grateful :) |
Hi @yngvebn. I think it's better to talk than stay silent! https://octopus.com/support is a really good way to get help too. :) Creating a new Channel complete with package Version Rule(s) would be great, especially now we automatically choose the best Channel for a Release based on the Packages involved... but I can see the syntax becoming tricky. Totally shooting from the hip for this example:
Regardless of the exact syntax, we would need to parse everything after the What syntax would make the most sense to you? @uglybugger would be interested for you to weigh in also. :) Also for context, we do have this suggestion floating around also. |
Rationale
The rationale behind this feature is to allow branch builds from TeamCity or other build servers to have a per-branch channel created for them.
octo.exe create-channel --server=XYZ --apiKey=API-XYZ --channel="My New Channel" --project="My Project" --lifecycle=Default --update-if-exists
Use case
Use case: a team using short-lived feature branches wants to create a different IIS binding for each branch. The current best solution appears to be to parse a release version number or a package name and extract a branch name into an output variable.
This solution would allow a much cleaner creation of a channel for any given branch. I discussed this with @michaelnoonan a while ago and offered to send a pull request if the Octopus team didn't get around to building it first. Here it is :)
Implementation
This is a fairly straight-forward wrapper over the Octopus REST API.
There's one small feature that might be noteworthy: the
--update-if-exists
parameter, which allows "create or update" behaviour.