|
RE: Subversion - Repository Structure - Web Application(s) |
bamccaig
Member #7,536
July 2006
|
I've been asked to write hook scripts to automatically update Web sites (development, testing, and pre-production) with their corresponding branch of a subversion repository whenever changes are committed. The planned repository structure is... / |---branches/ | |---a.b.c.d/ | |---a.b.c.d/ | |---a.b.c.d/ | |---a.b.c.d/ | |---(etc...) |---tags/ # ??? |---trunk/ # Production/Stable. As you can see, the branches will be given a version number. I can't see any way for my hook script to automatically know which branch goes where (aside from pre-production, which will essentially be the trunk). The idea I've come up with is using a small text file with configuration options to indicate which branches go where, which will be updated when a particular version matures. For example,... development_root=N:\development testing_root=N:\testing preproduction_root=N:\preproduction development_branch=3.0.26.12 testing_branch=3.0.25.11 preproduction_branch=2.5.24.3 Which would then be parsed by the hook script (or a called script), resulting in each branch of the subversion repository being exported to the corresponding directory. I have two questions that I face at this point. Firstly, from a Windows batch file what is the best way to parse such a configuration file? I have only done limited scripting and generally avoid Windows because without the help of UNIX-like tools its largely limited... Would it be better to just store the configuration within variables in the hook script itself? Secondly, how will my hook script be authenticated for svn access? For example, to call svn export will I need to authenticate from within the hook script or will the hook script just automatically be granted access? I'm assuming I will need to authenticate, since the repository has been granted no anonymous access. What is recommended? Storing a username/password for the hook script within itself and then limiting access to that file or is there some better approach? -- acc.js | al4anim - Allegro 4 Animation library | Allegro 5 VS/NuGet Guide | Allegro.cc Mockup | Allegro.cc <code> Tag | Allegro 4 Timer Example (w/ Semaphores) | Allegro 5 "Winpkg" (MSVC readme) | Bambot | Blog | C++ STL Container Flowchart | Castopulence Software | Check Return Values | Derail? | Is This A Discussion? Flow Chart | Filesystem Hierarchy Standard | Clean Code Talks - Global State and Singletons | How To Use Header Files | GNU/Linux (Debian, Fedora, Gentoo) | rot (rot13, rot47, rotN) | Streaming |
MiquelFire
Member #3,110
January 2003
|
I would just have a better script get called from the batch file: This is my post-commit.bat file (well I removed some things to make it easier to understand) How are you accessing the repository? You might have a open hole you can use if the hook script needs to authenticate. --- |
bamccaig
Member #7,536
July 2006
|
Well the server probably won't have any extra scripting environments installed and it would probably be a challenge to convince the higher ups that it is necessary or worthwhile. In theory though, I could use WSH or anything else that would likely be installed already... If I need to. MiquelFire said: How are you accessing the repository? You might have a open hole you can use if the hook script needs to authenticate. The repository is accessed through apache over SSL. What do you mean open hole?! -- acc.js | al4anim - Allegro 4 Animation library | Allegro 5 VS/NuGet Guide | Allegro.cc Mockup | Allegro.cc <code> Tag | Allegro 4 Timer Example (w/ Semaphores) | Allegro 5 "Winpkg" (MSVC readme) | Bambot | Blog | C++ STL Container Flowchart | Castopulence Software | Check Return Values | Derail? | Is This A Discussion? Flow Chart | Filesystem Hierarchy Standard | Clean Code Talks - Global State and Singletons | How To Use Header Files | GNU/Linux (Debian, Fedora, Gentoo) | rot (rot13, rot47, rotN) | Streaming |
BAF
Member #2,981
December 2002
|
You could always waive authentication to provide read-only access to the IPs of the server(s). |
bamccaig
Member #7,536
July 2006
|
BAF said: You could always waive authentication to provide read-only access to the IPs of the server(s). That sounds like it might be an option... How would I do that? -- acc.js | al4anim - Allegro 4 Animation library | Allegro 5 VS/NuGet Guide | Allegro.cc Mockup | Allegro.cc <code> Tag | Allegro 4 Timer Example (w/ Semaphores) | Allegro 5 "Winpkg" (MSVC readme) | Bambot | Blog | C++ STL Container Flowchart | Castopulence Software | Check Return Values | Derail? | Is This A Discussion? Flow Chart | Filesystem Hierarchy Standard | Clean Code Talks - Global State and Singletons | How To Use Header Files | GNU/Linux (Debian, Fedora, Gentoo) | rot (rot13, rot47, rotN) | Streaming |
BAF
Member #2,981
December 2002
|
You should be able to do it with Apache, depending on how your auth is setup, by putting the IPs in Allow From or something. |
Crazy Photon
Member #2,588
July 2002
|
Look it from the other way around, instead of having Subversion do it, this task is better suited to a Continuous Integration server*.
----- |
|