1

I'm new to Jenkins (and Continuous Integration).

I have created a schedule job for dev environment which package .war and deploy in Tomcat through Tomcat's manager console.

Each build has to get through QA and UAT cycle and when get certified it move to PROD. Each environment has different configuration (database, ldap, brands, etc.) which are maintained in properties files.

The build tool is Ant.

One of the easiest way is to create three separate Ant task, have each environment configuration in repository with a environment suffix and use environment specific file to prepare the war for specific environment. But we cannot have configuration of QA, UAT and PROD as this cannot be share because of policies. We will prepare jobs for QA, UAT and PROD environments and NOC Team will be the owner/manager for the jobs.

How can we dynamically create properties file and inject them during ant task (packaging/preparing war)?

Ramiz Uddin
  • 4,249
  • 4
  • 40
  • 72

1 Answers1

0

We inject the properties files (stored in source control with environment prefix) at deployment time.

The build process (Ant, Maven, doesn't matter) generates the release candidate, which is then stored. From there, with use of promotions, we move the same build file from DEV to QA and all the way to PROD.

When the file is deployed (also through Jenkins), the deployment script picks up the configuration file from the source control and extracts it to the correct location on the server. Read below for more information on how to use Jenkins with promotions:

How to promote a specific build number from another job in Jenkins?

Community
  • 1
  • 1
Slav
  • 27,057
  • 11
  • 80
  • 104