Search code examples
continuous-integrationteamcitycontinuous-deployment

How can I use TeamCity to do Production releases safely?


We currently use TeamCity to build a deployment artifact, then a further TeamCity task takes that artifact and deploys it to our development and testing servers on demand.

We can store the passwords and other secret data in properties files that we can check into source control, as these are all internal servers and the developers have full access to them.

However for release to Production (and our final test layer) there are secret passwords and configuration that we don't want checked into the normal source control, or to have development be able to discover the passwords. So to do 'real' deployments we have to hand the artifact over to another team and they maintain a properties file with the production values.

What methods exist to store these secrets and allow TeamCity to run a deploy without ever leaking the secrets out?

(note I am one of the devs and it is not a trust issue... I don't want to have the ability to find out prod passwords so I can never accidently know them and do some horrific damage!)


Solution

  • Probably what you need here, is to create a separate project with narrower scope of permissions (for example, allow only certain people to edit build configurations). In this project create a build configuration, responsible for deployment. In this configuration, you can define a Typed Parameter of type 'password' to store the password to the production environment.

    Another option is to use Deployer Plugin, especially its ability to deploy over ssh with private key authentication