Parameters & Package Paths
Hi, I'm trying to configure a simple build configuration for a website detailed below:
Step 1: NuGet Installer: To restore the NuGet Packages.
Step 2: MSBuild: To build the website, run OctoPack and create a website package for use in Octopus.
Step 3: OctopusDeploy: Push Packages: To add the website package to Octopus and copy the .nupkg file to the Octopus packages folder.
Below is an example of the Package Path I'm using. NOTE: I've replaced the actual project and solution names.
%teamcity.build.workingDir%\[TFS Project Name]\[TFS Solution Name]\bin\[TFS Solution Name].1.0.0.0.nupkg => D:\Octopus\Packages\%env.TEAMCITY_BUILDCONF_NAME%\%env.TEAMCITY_BUILDCONF_NAME%.nupkg
I have 2 issues with this path that I need assistance with:
- How do I automatically get the TFS Project Name & TFS Solution Name from the TFS Project? The values I need are not listed as Parameters on the agent. I would prefer to use existing values than to create User Defined Parameters.
- I want to force rename the package that is sent to Octopus to follow our new naming convention. For example, if my website is "projectwebsite.com" I will name the TeamCity Build Configuration as "projectwebsite.com". I can then use the env.TEAMCITY_BUILDCONF_NAME parameter to reference this name. However in the above example the .nupkg file that is sent to the Octopus packages folder retains the [TFS Solution Name]. How do I rename it in Package Paths?
Any assistance is greatly appreciated.
Please sign in to leave a comment.
TeamCity does not provide project/solution names as parameters. However, since you typically would want to checkout only one project from the repository and not it's siblings, that usually needs to be part of the VCS root or checkout rules, so should typically already be defined in the configuration on it's creation (e.g. via parameters).
If your case is different and you do need to publish artifacts from a directory structure, you can add a build step which will figure out the due names/paths and then publish artifacts using a service message.
The build step will also be a good place to rename the files as you need them.
Hi @webdev2018,
I got a notification that you had sent another message but it seems that it's gone now. I don't know whether you deleted it from here or that it wasn't properly registered. could you please confirm?