Presently, the project I am working on is in exploded archive form. I want to use the build script method of deployment. I want to know if its possible to rename a file after deploying to remote server as in:
The answer is "maybe". Are you renaming the file by hand? That is, via a command line using the mv or rename command (depending on your OS). Or are you wantting to do this on Ant? And if in Ant, as part of the deploy step or after the deploy step? And exactly how does your "deploy" step work? Are you using a specific Ant task for that? (I won't go into asking whether the app can handle the new name I assume that it can).
Perhaps you should post the target that does the "deploy"...
As long as the rename happens before you start up the server it should not matter. You can manually rename it. Or you can have a script rename it. It doesn't matter.
I face the same situation in my projects. When we release our product, it requires a specific set of properties to work with the rest of the application suite. But for development, I need a different set of properties that match my development environment. We use Maven for builds. We have only a single source properties file whose contents contain property references. Our Maven pom.xml file defines the properties for the production environment. I have a settings.xml file with a profile that overrides the property references for my dev/test environment. When Jenkins builds my project, it is all set for production, with the correct properties file with the correct values. When I build the project on my PC, it is all configured for my dev.test environment. Thus we never have to edit or rename anything. (Before I got hold of the projects and converted the team used both a dual properties file scheme like you are using, and a properties.template scheme, both of which required manual intervention before doing any build, and both of which required additional work to prevent the developer-specific modifications from ending up in source control. Maven profiles eliminated all of that manual work and make the builds more repeatable and consistent.)
Joined: May 09, 2011
Thank you so much. That was very helpful. I guess I'll have to make that suggestion to my Project Lead here!