Free Web Hosting Forum
Go Back   Free Web Hosting Forum > Website Building > Scripts and Code Snippets
Reload this Page Fully automated deployment script using Windows and SVN...
Reply
 
Thread Tools Display Modes
(#1 (permalink))
Old
Junior Member
Nvrnight is on a distinguished road
 
Posts: 16
Join Date: Aug 2010
Default Fully automated deployment script using Windows and SVN... - 08-27-2010, 07:34 PM

Requirements: CoreFTP Client and a connection setup in your site manager, you'll be using the name of it in the script...

Here's the script I use in a batch file that can be ran...
:::::::::::::::::::::::::::::::::::::::::::::::::: :::::::::
:: DeployDirectory is the directory where you will be
:: exporting your Subversion folder to and will be
:: uploaded to the web server
:: coreftplocation is the location of your coreftp.exe file
:: svnWebDirectory is the location of your web directory that
:: you'll want export, this location is relative to your batch file
:::::::::::::::::::::::::::::::::::::::::::::::::: ::::::::::::::

set deployDirectory=C:\Export
set coreftplocation="C:\Program Files (x86)\CoreFTP\coreftp.exe"
set svnWebDirectory=..\..

:::::::::::::::::::::::::::::::::::::::::::::::::: :::::::::::::::
::This is where we delete the deploy directory if it exists::
:::::::::::::::::::::::::::::::::::::::::::::::::: :::::::::::::::
del "%deployDirectory%\*" /Q
rmdir "%deployDirectory%" /S /Q

:::::::::::::::::::::::::::::::::::::::::::::::::: :::::::::::::::
::Export out the svn web directory to our export folder ::
:::::::::::::::::::::::::::::::::::::::::::::::::: :::::::::::::::
svn export "%svnWebDirectory%" "%deployDirectory%"

:::::::::::::::::::::::::::::::::::::::::::::::::: :::::::::::::::::::::::::::::
::I have two configuration files that holds my database information ::
::I move my production configuration file to overwrite the normal ::
::configuration file to the correct configuration goes up to the server::
:::::::::::::::::::::::::::::::::::::::::::::::::: :::::::::::::::::::::::::::::
move /Y "%deployDirectory%\config\productionconfig.php " "%deployDirectory%\config\config.php"

::::::::::::::::::::::::::::::::::::::::::::::::
::Now I ftp upload the exported directory::
::::::::::::::::::::::::::::::::::::::::::::::::
%coreftplocation% -S -OA -site mysite -u "C:\Export\swgresources" -p /public_html/
Reply With Quote
Sponsored Links
(#2 (permalink))
Old
drums's Avatar
Senior Member
drums is on a distinguished road
 
Posts: 579
Join Date: Aug 2010
Location: Oz
Default 08-28-2010, 10:37 AM

Useful to see some interesting automated scripts (and relatively useful - yet simple!).

I'm not using coreftp, so I've got a few questions:
1) I'm assuming it works with coreftp LE right?
2) How does it handle connection errors (is there a log file?)
3) Are you using it and how's it going?

Thanks for sharing

drums
Reply With Quote
(#3 (permalink))
Old
Junior Member
Nvrnight is on a distinguished road
 
Posts: 16
Join Date: Aug 2010
Default 08-28-2010, 09:33 PM

Quote:
Originally Posted by drums View Post
Useful to see some interesting automated scripts (and relatively useful - yet simple!).

I'm not using coreftp, so I've got a few questions:
1) I'm assuming it works with coreftp LE right?
2) How does it handle connection errors (is there a log file?)
3) Are you using it and how's it going?

Thanks for sharing

drums
I haven't had any connection problems yet, so I don't know what happens with the errors. I use CoreFTP Lite, but probably works with CoreFTP LE. I'm using it now and no problems as of yet.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Forum Jump



Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.5.2
vBulletin Skin developed by: vBStyles.com