Link to home
Start Free TrialLog in
Avatar of WestCoast_BC
WestCoast_BCFlag for Canada

asked on

How to update many website with new code - each website gets the same copy of the code

I manage a bunch of websites that mostly use Coldfusion. Each website is located in its own directory on the server and they all use the same version of the code and they each have their own database. I am trying to figure out what is the best way to update all of the sites when I make a change to the code. Right now I have created a directory on the server that contains the changed files and then I use directoryCopy to copy over the new files. My code looks something like the following:
<cfset temp = directoryCopy("_UpgradeCode","website_to_update_directory/",true,"*.*")>

Open in new window


One issue that I have is that I don't know if there were any problems copying over the code.

Can anyone suggest a better way to update websites? I am hoping that this can be done in an automated way so that I can just call a function or something and then it automatically updates all of the sites. I have created a list of sites to update that can be passed to the function.

Thank you for any help that you can provide about this.
Avatar of Raja Jegan R
Raja Jegan R
Flag of India image

You can setup git or any other deployment tool to deploy code directly to the websites.
here is a sample script for deploying code from git to Server..
https://github.com/acnot/cf-git
Another way is to define the virtual directory for the site(s). The virtual directory can point to one directory location.
You deploy code to one directory.
Avatar of WestCoast_BC

ASKER

Pravin Asar - a virtual directory suggestion is very interesting but I have never done that. Can you provide instructions on how to do that or point me to somewhere that shows me what to do?
This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.