Different environment support for java gradle project

375 views Asked by At

My java project is using Gradle for build and deployment. Currently we have three environment, dev, test and prod. Each env is hosted on different box. To deploy my project to these box, all I do is changing Host in build.gradle, hibernate.properties and mongo.properties. my build.gradle has below section, which handles hostname for deployment,

cargo {
    containerId = 'tomcat7x'
    port = 8080
    context = 'projectContext'
    remote {
        hostname = '<hostName>'
        username = '<username>'
        password = '<password>'
    }

Problem is everytime I do some change, I have to manually change this and run, 'gradle :cargoRedeployRemote' to deploy my project. I need a more handy way to handle these env for CI/CD integration. Please leave your thoughts.

Thanks in Advance..

0

There are 0 answers