We are using Octopus with TeamCity for CICD.
I have observed that in a particular deployment project/target, it is taking only a single package for all steps in the project.
For example Database deployment project has database extract,reports etc.,it is taking the same package for all, whereas i want it to take different packages for each of the step.
It is possible manually by selecting the packages, is there a way i can implement this in CICD with TeamCity.
Thanks for reaching out. Each “Package Deploy” step in your deployment process in Octopus has a field called “Package ID” (see attached screenshot). That’s the field where you declare the ID of the package that that step will use.
It shouldn’t use the same package by default for all steps, so someone must have set it up that way.
If this doesn’t ring a bell, please follow the below instructions to send us a full deployment log so we can check what is going on.
1) Add these 2 variables to your project http://docs.octopusdeploy.com/display/OD/Debug+problems+with+Octopus+variables
2) Create a new release (so the new variables take effect) and deploy it. If possible skip as many steps as you can and only leave step we are troubleshooting in order to avoid the noise in the log.
3) Send us the raw log of that deployment http://docs.octopusdeploy.com/display/OD/Get+the+raw+output+from+a+task
I think i have to put my question in more clearly.
Hope this will be more clear.
We have got the steps right. My issue is with creating release(please refer the screenshot:Capture).
When i try to deploy this project from teamcity(please refer screenshot:capture1), it is collecting the package id of both websites and modules, but when deploying, it is unable to set that for websites specific ones and module specific ones.
We have other CICD jobs with teamcity and octopus but we set all of them package specific.
This is a special case where we need to integrate.
The error says that you are trying to use a package with a version that does not match with the versioning rule set for the channel
When I went to check which version of your packages you were trying to use, I noticed that you passed the string
1.5.128-ARTeam,1.5.117-ARTeam to the
--defaultpackageversion parameter in the “Create Release” step. That means Octopus will try to find packages with version
1.5.128-ARTeam,1.5.117-ARTeam (the whole string!), which is definitely not a valid semver version.
Were you trying to pass multiple package versions to that parameter by any chance? Cause if that is the case, you need to use the
--package parameter for that. More info about this: http://docs.octopusdeploy.com/display/OD/Creating+releases
Let me know how that goes,
Yes i am trying to pass multiple package versions, so they have to be comma(,) seperated or semicoln( seperated?
--defaultpackageversion defines the default version to be used by all the packages used in the release. Since its aimed to set a “default” version, it only accepts 1 value. For that reason Octopus is thinking that you are telling him to look for a package with the version
1.5.128-ARTeam,1.5.117-ARTeam as a single version string, and not as a comma separated one.
If you want to define different versions of packages, you need to use the
--package parameter in the format
--package=[stepname]:[packageversion]. For example if you want to use version
1.0.0 of your package Zen.Websites.Root which is being used in the step Provision Root Website, you’ll need to use
--package="Provision root website":1.0.0.
A few gotchas:
--defaultpackageversion will set the default version for all the packages used in the release. But if you use
--package at the same time, this one will override the default version value for that specific package. The rest of the packages that do not have their own
--package will use the value defined in
--defaultpackageversion. And if you dont declare a default version (by not using the
--defaultpackageversion), they will always use the latest.
You need to add a
--package for each package that you want to use a specific version of. So you might end up using this parameter many times in the same call.
Hope that helps,
Sorry for that short reply. I got your point.
I got rid of the default package version.
Now i have:
The build numbers are fetched.
Can we pass these 2 packages?
I need to pass these 2 package parameters, so that it takes the corresponding ones. I tried comma seperating it did not work.
Just to add more:
When i tried comma separating, it did not pick the second one and resolved it on its own by picking latest packages.
Check the example I gave you on my last reply:
For example if you want to use version 1.0.0 of your package Zen.Websites.Root which is being used in the step Provision Root Website, you’ll need to use --package=“Provision root website”:1.0.0.
--package=%dep.Modules.build.number% you are only passing the package version, when you should be passing the name of the step + the pacakge version as explained above.
Think about it this way: How is Octopus supposed to know that the first
--package refers to package A and the second
--package refers to package B? You need to tell Octopus for which step to use which version number.
Its not taking multhiple arguments.
Can you please tell me How do i pass multiple commands with Octo.exe Command Line.
This will solve my problem.
[Octopus Deploy] The version portion of the package constraint ‘Websites.Root:1.5.142-ARTeam,–package=Modules.Enrollment.Api:1.5.154-ARTeam’ is not a valid semantic version number.
It is not able to take these as separate arguments.
Thanks for answering so far, this probably will be the last thing.
I feel we are very close too yeah
You don’t need to separate the parameters with a comma. To pass multiple parameters just add them like this: `
‘–package=Websites.Root:1.5.142-ARTeam --package=Modules.Enrollment.Api:1.5.154-ARTeam --package=YetAnotherStepName:1.0.0’
Superb man, worked!!! Thank you so much. This is why we love Octopus, great in support.
Thanks for the compliments! I’ve passed your words to the rest of the support team
Have a great weekend