I have a test and a prod environment build plan. The Prod works while the Test, although is configured exactly the same, doesn't.
They both pull from the same master branch, have a Maven set-up, and normally, connect through the databases (there is one for each one) specified in the pom.xml file.
I want to make sure that each build plan hits the same database. How do I do this? Maybe it's something that it's overriding the pom.xml file ?
What else could work two build plans with identical configuration to behave differently ? One runs while the other doesn't.
Hi,
If I were to define a setup like this I would use system properties in my Maven goal for the Maven 3.x task.
For this task you must set the Maven goal where it is possible to define system properties as well.
You can have a Maven goal like this for PROD:
clean install -U -Ddb.user=prod_user -Ddb.password=prod_password -Ddb.url=jdbc:postgresql://localhost/prod
You can have a Maven goal like this for TEST:
clean install -U -Ddb.user=test_user -Ddb.password=test_password -Ddb.url=jdbc:postgresql://localhost/test
You can also define Bamboo variables in your build scripts: Passing Bamboo variables to a build script
Then in your Maven project you can use these system properties with property substitution for example in your app.properties file
database.user=${db.user}
database.password=${db.password}
database.url=${db.url}
Hope this will give you an idea on what can be done.
Regards
Lasse Langhorn
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.