Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cvs script to update production files

Status
Not open for further replies.

jrthor2

Programmer
Feb 21, 2003
10
US
We have a cvs repository for our website files. Our developers develop locally, then commit to CVS for production. We have multiple modules in this repository. What we want to have is a script (perl, shell, whatever) that will check our current files, and if any files have changed, update them on our production servers. The issue here is that the directory structure on our production servers does not match the cvs directory structure. We are using Java, and IBM Websphere, and our files go in the app server directories. So, we were thinking of having a "landing" area that we would check out the modules to and use to compare to cvs, then take the files that have changed and copy them to our app server directories. Can anyone help me with this? I hope this makes sense.

Thanks!!
 
The way you plan to do this - with a landing area - sounds very sensible and very script-able to me.
You'll be able to have the script do a CVS update to get the latest versions into this area and then check them against the working files and copy the changes it recognizes the right locations.
It should be a simple scripting task once you've got your head around the idea.


"I may not have gone where I intended to go, but I think I have ended up where I needed to be." --- Douglas Adams
 
Could you or anyone help with the scripting? It would need to be a shell script, most likely using the bash shell.

Thanks
 
I don't want to be funny but that's not really appropriate for this forum.

However I'm sure if you have a go at something simple (there are loads of good starter tutorials on the web) and then ask questions in (somewhere like) this site's Unix scripting forum then someone, maybe even me, will help you out.

Just as a confidence booster - I've got some similar sounding scripts working on a couple of web servers that I look after - so I'm sure you'll be able to get it working in the end. :)


"I may not have gone where I intended to go, but I think I have ended up where I needed to be." --- Douglas Adams
 
Care to share any of your scripts that you have working already??

Thanks!!
 
They are very specific to the web server directory and repository structures that we use so they'd not be much good to you.

I don't want to teach you to suck eggs but very basically they go something like this:

Code:
#!/bin/bash

cd <the landing area I've already set up as a sandbox - so I don't have to worry about CVSROOT or logging in to CVS or anything>

cvs update -d > <some log file> 2>&1

<now copy the files to their working locations as appropriate>


"I may not have gone where I intended to go, but I think I have ended up where I needed to be." --- Douglas Adams
 
Honestly, the part I wanted to see was the <now copy the files to their working locations as appropriate>. I already have the cvs stuff working.
 
Well that's the bit is really bespoke - dependent on how you need to change stuff about to fit from your sandbox into your working area. It could be as simple as "cp -ru * /working_dir/ " or it could get really complex.


"I may not have gone where I intended to go, but I think I have ended up where I needed to be." --- Douglas Adams
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top