×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

cvs script to update production files

cvs script to update production files

cvs script to update production files

(OP)
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!!

RE: cvs script to update production files

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

RE: cvs script to update production files

(OP)
Could you or anyone help with the scripting?  It would need to be a shell script, most likely using the bash shell.

Thanks

RE: cvs script to update production files

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. smile


"I may not have gone where I intended to go, but I think I have ended up where I needed to be." --- Douglas Adams

RE: cvs script to update production files

(OP)
Care to share any of your scripts that you have working already??

Thanks!!

RE: cvs script to update production files

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

RE: cvs script to update production files

(OP)
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.

RE: cvs script to update production files

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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close