DGEDeploy Is A Subversion Merging And Release Control Script
Why?
I wrote DGEDeploy to:
- Make tedious ‘svn merge’ commands easier to use.
- Reduce the number of typos when running ‘svn merge’ commands.
- Be extremely simple, its not meant to replace Capistrano, CruiseControl, ...
- To improve my Ruby scripting skills
There are a lot of similar scripts out there, but if you find this one useful please let me know :-).
How does it work?
The script uses two configuration files to keep track of vital settings. The first, ‘dgedeploy.conf’, stores settings for the script itself (ie: subversion credentials). The second, ‘dgedeploy-projects.conf’ stores information about your codebase and projects.
All settings are stored in the YAML format.
Example: /etc/dgedeploy/dgedeploy-projects.conf
# YAML 1.1 # Settings for example-project deployment example-project: # The workflow field is required, the order of the parameters specify which # branch merges with which branch. eg: # development --> staging --> live workflow: - development - staging - live development: # The order of the urls parameter is important. The first in the list will # be used as the default choice whenever necessary. Each url should be, # a directory inside a Subversion repository, of course. All urls should # be in the SAME Subversion repository. urls: - http://example.com/svn/example-project/trunk staging: urls: - http://example.com/svn/example-project/tags/staging live: urls: - http://example.com/svn/example-project/tags/live
So, as shown in the configuration example above, the script is based on workflows. Merges always happen forward and must hit every level in the chain. This ensures your development code doesn’t go straight to live without being merged into staging first.
Make a merge
The syntax for the script is fairly straightforward. Once you have everything installed (see README.txt for details) you initialize your working copies like so …
dgedeploy example-project initialize
After the working copy caches are setup a merge can be performed using the same script. This example merges all of trunk into staging.
dgedeploy example-project \ http://example.com/svn/example-project/trunk # # Translates to ... # svn merge \ # http://example.com/svn/example-project/tags/staging \ # http://example.com/svn/example-project/trunk \ # /var/cache/dgedeploy/example-project/tags/staging #
DGEDeploy will also merge just specific subdirectories. To send only a certain subdirectory from staging to live run a command like this …
dgedeploy example-project \ http://example.com/svn/example-project/tags/staging/sub-dir # # Translates to ... # svn merge \ # http://example.com/svn/example-project/tags/live/sub-dir \ # http://example.com/svn/example-project/tags/staging/sub-dir \ # /var/cache/dgedeploy/example-project/tags/live/sub-dir #
Enjoy!
James.
Download DGEDeploy.tar.gz
