Subversion Repositories SvarDOS

Rev

Rev 636 | Rev 839 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 636 Rev 837
Line 21... Line 21...
21
=== SVN SERVICE ===============================================================
21
=== SVN SERVICE ===============================================================
22
 
22
 
23
The server must have a subversion service installed with the SvarDOS repository
23
The server must have a subversion service installed with the SvarDOS repository
24
imported.
24
imported.
25
 
25
 
26
The only specific configuration concerns a post-commit hook that should be set
26
The only specific configuration concerns a post-commit hook that creates a flag
27
up to create a /tmp/svados_repo_changed.flag file whenever a commit is made to
27
file at /tmp/svados_repo_changed.flag whenever a commit is made to the repo and
-
 
28
another flag in /tmp/svardos_rebuilt_please.flag if the commit might impact the
-
 
29
content of installation images. Here below is the necessary post-commit hook,
28
the repo. Such hook script can be as simple as this:
30
it should be placed in the hooks/ directory of the svn server and made
-
 
31
executable (chmod +x):
-
 
32
 
-
 
33
#!/bin/sh
-
 
34
 
-
 
35
SVNLOOK=/usr/bin/svnlook
-
 
36
REPOS="$1"
-
 
37
TXN="$2"
29
 
38
 
-
 
39
# first of all, make sure to set a flag that says "svn content changed" so a
-
 
40
# cron job can update its local copy later
30
  echo date > /tmp/svardos_repo_changed.flag
41
echo date > /tmp/svardos_repo_changed.flag
-
 
42
 
-
 
43
# check if any of the following locations have been updated during the commit:
-
 
44
#  - files
-
 
45
#  - packages/core/
-
 
46
#  - build.sh
-
 
47
#
-
 
48
# any change to one of these locations means that the content of the
-
 
49
# installation images may have been impacted, hence a rebuild may be necessary.
-
 
50
#
-
 
51
$SVNLOOK changed ./ | grep -e ' files' -e ' build.sh' -e ' packages/core/'
-
 
52
 
-
 
53
# if a location matched, then set a flag so a cron job rebuilds the images
-
 
54
# and send an information message back to the committer.
-
 
55
if [ $? -eq 0 ] ; then
-
 
56
  echo date > /tmp/svardos_rebuild_please.flag
-
 
57
  echo "NOTICE: a build-impacting location has been updated." >&2
-
 
58
  echo "        install images have been scheduled for a rebuilt." >&2
31
  exit 0
59
  exit 1
-
 
60
fi
32
 
61
 
33
 
62
 
34
=== SVN CLIENT ================================================================
63
=== SVN CLIENT ================================================================
35
 
64
 
36
The SvarDOS repository should be checked out in /srv/svardos/:
65
The SvarDOS repository should be checked out in /srv/svardos/: