Deploying automatically to non-prod and manually to prod
Hello,
I'd like to ask how do you guys deal in Teamcity with deploying to non-prod environments (automatically) and prod envs (manually) using Teamcity features. We have automatic deployment to non-prod environments so every git commit/push triggers build jobs and deployment to non-prod env. But what about prod one ? In Teamcity do I have to define another deployment to production ? Is it the Teamcity Way ? Or can I somehow "diverge" the existing pipeline and point it manually to production (if we decide that hte non-prod is doing well)?
Please sign in to leave a comment.
You can create a base template from existing build configuration and then just exclude the deployment step in the production configuration.
Hmm, the build steps in this case are really simple. The deployment to non-prod should be automatic. And the deployment to prod should be manual.
I've just realized that this should be simple. Don't include the deployment steps in the build steps. Trigger them automatically once the build has finished successfully. And then ... yes, this is the question: can I trigger deployment with some parameter (which is the prod environment) ?
Without knowing what the condition for choosing between production and non-production is, it's a bit harder. If every deployment to production is before in non-production, then it's really easy. Have a separate build configuration for deployment to production which has an artifact dependency on the artifacts needed for deployment. The regular build (with deployment to non-production) has a VCS Trigger, while the deployment to production build does not.
If both deployments are separate, then the idea is to have a build configuration that creates all the artifacts that you need, then two separate builds, NP for non production and P for production, that only perform the deployment through artifact dependency, and the non-production has also a snapshot dependency. Put the VCS Trigger on the NP build, which will automatically trigger the build and deployment to non production, while the deployment to production will simply pick up the artifacts and deploy through a manual trigger.