• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Deployment with Ant

 
Author
Posts: 47
5
MySQL Database PHP Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi.

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:

deploy db.properties_stage as db.properties

Hope I am able to convey the idea.

Thanks.
 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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"...
 
Kanika Sud
Author
Posts: 47
5
MySQL Database PHP Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Peter,

In fact I'm totally new to build scripts. I'm still trying to find my way about them. But the requirement is simple:
Two files exist on my local system:

db_stage.properties
db_prd.properties

The names were different because the stage and production servers will take different properties but the same file name: db.properties

Hence the need to rename on the remote server. As long as the renaming happens on the remote server, I don't think it should make a difference before after, right?

Thanks,
Kanika.
 
Peter Johnson
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.)
 
Kanika Sud
Author
Posts: 47
5
MySQL Database PHP Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Peter,

Thank you so much. That was very helpful. I guess I'll have to make that suggestion to my Project Lead here!
 
a wee bit from the empire
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic