Creating a release for a specific Environment in Team City

Hi, I have an Angular project setup in Team City which has 2 seperate builds: one for QA and one for production. I want QA builds to be deployable to QA environments and production builds to be deployed to the Production environment. This is because the URLS used in each build are specific to our QA/Production environments.

I am currently using the OctopusDeploy: Create and Push packages step (which does deploy the package to Octopus Deploy correctly).

How can I do so?

Hi,

Thanks for getting in touch! What we’d actually recommend is to build a single package which will be deployable to both of your environments. Using features like variable substitution allows you to define environment-specific information (like URL in your case) to be used based on the appropriate environment.

This is done by defining a single variable within your project in Octopus, giving it multiple values (both of your URLS), and scoping each value to its respective environment. Wherever you define the URL in your Angular project, you can specify the variable name using substitution syntax (e.g. something like #{URL}), and Octopus will substitute in the value for the URL variable based on where you’re deploying.

We have some great information on using scoped variables in our documentation.

I hope this helps! Let me know how you go or if you have any further questions moving forward. :slight_smile:

Best regards,

Kenny

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.