REPOSITORIES
Documentation for the fmethods group courses repositories.
In which you will learn:
- How the system repository-webpage is structured
- How to update the system from one academic year to the other.
You need to be part of the fmethods group. Either ask Wolfgang Ahrendt (ahrendt@chalmers.se) or the IT service.
From now on let's assume we deal with the TDV repository. Analogous concepts hold for SEFM.
THE MAIN ENTITIES
In the scenario there are three actors:
- The remote repository (the server).
The repositories for SEFM and TDV reside in the repository
<chalmers-remote>/chalmers/groups/fmethods/home/svnwhere <chalmers_remote> is any of the servers you have access to Chalmers. It is actually a single repository, which has at its root the directory "courses" which differentiates between TDV and SEFM. If you do not remember this address after pulling the repo, you can find it in.svn/entriesfile at the top level of the local repository.
- The local repository (you with your computer).
Pull down the repository issuing the command (assuming you have svn installed)
svn co svn+ssh://<chalmers-remote>/chalmers/groups/fmethods/home/svn/courses/TDV/(or alternatively SEFM instead of TDV)
- The proxied repository.
A checked-out portion of the remote repository which resides in the webserver (thus exposed to the public -- it is where the published page resides).
It is in the addresses
/chalmers/groups/edu2009/www/www.cse.chalmers.se/year/${current_year-1}/course/TDA566_Testing_debugging_and_verification/chalmers/groups/edu2009/www/www.cse.chalmers.se/year/${current_year-1}/course/TDA566The latter one is a symbolic link to the former. Note that the above is for TDA, for SEFM it is valid mutatis mutandis.
OUTLINE OF THE WORKFLOW
The repository for each course contains a "Web" directory. This directory contains what is published on the Chalmers course page. Every time you commit a change to any versioned object in that directory:
- you commit via the local repository;
- the repository accepts the commit
- the repository executes the script
post-commitwhich calls in turn update<X>web (<X> being TDV or SEFM)
- ... which issues an update command in the proxied repository.
MIGRATION FROM PREVIOUS TO CURRENT ACADEMIC YEAR
So a new academic year is starting and you panic because you have to update the site. No problemo! The next subsections describe how to do it.
CREATE CORRESPONDING DIRECTORIES IN ${current_year}:
- log on to the remote server via ssh: from a shell of your pc issue
- Issue the following commands:
CREATE A SVN REPOSITORY ON (or better AS) THE WEBPAGE
In the directory of the previous point issue
This creates the proxied repository. Make sure you permissions are ok: issue
in the same directory.
UPDATE THE HOOKS IN SVN
Change to directory
- Edit the bash script updateTDVweb by replacing all occurrences of ${current_year-1} to ${current_year} (e.g. if you are doing this in 2014, you should replace all 2013 with 2014).
- Edit the bash script post-commit by uncommenting as it is explained in the documentation therein.
In this way any time you push a commit from your local repository, the remote issues the update command in the proxied repository (because the SVN remote executes post-commit when it receives a commit)
Final remarks:
LOOK OUT! NEVER, EVER INTERACT WITH THE proxied repository unless there is no alternative. It is supposed to be just a repository that reads. If you want to do changes to the webpage, do it from your local repository!
IMPORTANT! Remember to do SOMETHING if you want to prevent students from accessing the old year's website!
DESIGN DECISIONS. The SEFM and TDV logical repositories are in the same physical repository. This means that if you commit on TDV, also the proxied repository of SEFM will be updated (hopefully with no changes.) In the
script this is avoided by manually commenting in/out the calls to the update scripts for the SEFM and TDV websites. The idea is that since the two courses take place in different time periods one can manually do this. If things seem not to update, take a look at it as you might have forgot to uncomment the right line.
PERSONAL NOTES
- Some of the design decisions are not clear to me, surely they were to he who built all this. Some of the reasons behind them might not hold anymore, so feel free to subvert the status quo.
- The above algorithm can be coded smartly with a bash script, and made so that manteinance will be almost null. It should be an easy task, and I strongly recommend to do this.
- The websites rely on Server-side includes (SSI). If this sounds new to you make sure you understand what it is and how it is used in the website or ask somebody else in the group for help.
- This page should disappear shortly once the above process is automated, of course if somebody or something deletes it because it will be obsolete. If you are reading this in 2035, then surely something went wrong.