Subversion Repositories SvarDOS

Rev

Rev 851 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 851 Rev 873
1
 
1
 
2
 
2
 
3
                             BUILD SERVER SETUP
3
                             BUILD SERVER SETUP
4
 
4
 
5
 
5
 
6
 
6
 
7
=== INTRO =====================================================================
7
=== INTRO =====================================================================
8
 
8
 
9
The SvarDOS build system is entirely stored in the project's svn repository.
9
The SvarDOS build system is entirely stored in the project's svn repository.
10
This includes many components:
10
This includes many components:
11
 
11
 
12
 - SvarDOS-specific tools (install, pkg, pkgnet, localcfg, svarcom, help, ...)
12
 - SvarDOS-specific tools (install, pkg, pkgnet, localcfg, svarcom, help, ...)
13
 - SvarDOS packages
13
 - SvarDOS packages
14
 - SvarDOS website
14
 - SvarDOS website
15
 - build scripts and tools
15
 - build scripts and tools
16
 
16
 
17
This means that the project's svn tree contains everything that is required
17
This means that the project's svn tree contains everything that is required
18
to build SvarDOS.
18
to build SvarDOS.
19
 
19
 
20
 
20
 
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 creates a flag
26
The only specific configuration concerns a post-commit hook that creates a flag
27
file at /tmp/svados_repo_changed.flag whenever a commit is made to the repo and
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
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,
29
content of installation images. Here below is the necessary post-commit hook,
30
it should be placed in the hooks/ directory of the svn server and made
30
it should be placed in the hooks/ directory of the svn server and made
31
executable (chmod +x):
31
executable (chmod +x):
32
 
32
 
33
#!/bin/sh
33
#!/bin/sh
34
 
34
 
35
SVNLOOK=/usr/bin/svnlook
35
SVNLOOK=/usr/bin/svnlook
36
REPOS="$1"
36
REPOS="$1"
37
REV="$2"
37
REV="$2"
38
 
38
 
39
# first of all, make sure to set a flag that says "svn content changed" so a
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
40
# cron job can update its local copy later
41
echo `date` > /tmp/svardos_repo_changed.flag
41
echo `date` > /tmp/svardos_repo_changed.flag
42
 
42
 
43
# check if any of the following locations have been updated during the commit:
43
# check if any of the following locations have been updated during the commit:
44
#  - files
44
#  - files
45
#  - packages/core/
45
#  - packages/core/
46
#  - build.sh
46
#  - build.sh
47
#
47
#
48
# any change to one of these locations means that the content of the
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.
49
# installation images may have been impacted, hence a rebuild may be necessary.
50
#
50
#
51
$SVNLOOK changed -r "$REV" "$REPOS" | grep -e ' files' -e ' build.sh' -e ' packages/core/' > /dev/null
51
$SVNLOOK changed -r "$REV" "$REPOS" | grep -e ' files' -e ' build.sh' -e ' packages/core/' > /dev/null
52
 
52
 
53
# if a location matched, then set a flag so a cron job rebuilds the images
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.
54
# and send an information message back to the committer.
55
if [ $? -eq 0 ] ; then
55
if [ $? -eq 0 ] ; then
56
  echo `date` > /tmp/svardos_rebuild_please.flag
56
  echo `date` > /tmp/svardos_rebuild_please.flag
-
 
57
  echo "" >&2
-
 
58
  echo "---------------------------------------------------------" >&2
57
  echo "NOTICE: a build-impacting location has been updated." >&2
59
  echo "NOTICE: a build-impacting location has been updated." >&2
58
  echo "        install images have been scheduled for a rebuild." >&2
60
  echo "        install images have been scheduled for a rebuild." >&2
-
 
61
  echo "---------------------------------------------------------" >&2
59
  exit 1
62
  exit 1
60
fi
63
fi
61
 
64
 
62
exit 0
65
exit 0
63
 
66
 
64
 
67
 
65
=== SVN CLIENT ================================================================
68
=== SVN CLIENT ================================================================
66
 
69
 
67
The SvarDOS repository should be checked out in /srv/svardos/:
70
The SvarDOS repository should be checked out in /srv/svardos/:
68
 
71
 
69
$ svn co svn://127.0.0.1/svardos /srv/svardos
72
$ svn co svn://127.0.0.1/svardos /srv/svardos
70
 
73
 
71
 
74
 
72
=== WEB SERVICE ===============================================================
75
=== WEB SERVICE ===============================================================
73
 
76
 
74
A web server with PHP must be running (typically Apache). The PHP installation
77
A web server with PHP must be running (typically Apache). The PHP installation
75
needs the php-zip extension (required by buildidx), and the Apache web root
78
needs the php-zip extension (required by buildidx), and the Apache web root
76
should point at /srv/svardos/website.
79
should point at /srv/svardos/website.
77
 
80
 
78
 
81
 
79
=== CRON ACTIONS ==============================================================
82
=== CRON ACTIONS ==============================================================
80
 
83
 
81
A cron job should be configured to run frequently (like every minute) and
84
A cron job should be configured to run frequently (like every minute) and
82
execute the /srv/svardos/cron.sh script. This script is responsible for
85
execute the /srv/svardos/cron.sh script. This script is responsible for
83
checking out the local svardos repo whenever a new commit is being made, and
86
checking out the local svardos repo whenever a new commit is being made, and
84
rebuilds the index of the packages repository, and potentially (re)builds the
87
rebuilds the index of the packages repository, and potentially (re)builds the
85
installation floppy images as well. To do so, it requires a few dependencies to
88
installation floppy images as well. To do so, it requires a few dependencies to
86
be present on the server:
89
be present on the server:
87
 - zip
90
 - zip
88
 - unzip
91
 - unzip
89
 - mtools (mformat, mcopy, etc)
92
 - mtools (mformat, mcopy, etc)
90
 - unix2dos (usually part of a dos2unix package)
93
 - unix2dos (usually part of a dos2unix package)
91
 - mkisofs or genisoimage
94
 - mkisofs or genisoimage
92
 
95
 
93
 
96
 
94
=== MIRRORING THE PROJECT'S SVN ===============================================
97
=== MIRRORING THE PROJECT'S SVN ===============================================
95
 
98
 
96
Mirroring the project's svn tree (containing all build scripts, packages, etc)
99
Mirroring the project's svn tree (containing all build scripts, packages, etc)
97
is the best way to make a backup copy of the entire SvarDOS build system along
100
is the best way to make a backup copy of the entire SvarDOS build system along
98
with all its history. To achieve such mirror, one needs to create an empty
101
with all its history. To achieve such mirror, one needs to create an empty
99
svn repository and populate it using svnsync:
102
svn repository and populate it using svnsync:
100
 
103
 
101
$ svnadmin create /srv/svardos-mirror
104
$ svnadmin create /srv/svardos-mirror
102
$ svnsync init file:///srv/svardos-mirror svn://svn.svardos.org/svardos
105
$ svnsync init file:///srv/svardos-mirror svn://svn.svardos.org/svardos
103
$ svn up /srv/svardos-mirror
106
$ svn up /srv/svardos-mirror
104
 
107
 
105
The same procedure can be used to migrate the SvarDOS build system from one
108
The same procedure can be used to migrate the SvarDOS build system from one
106
server to another.
109
server to another.
107
 
110
 
108
NOTE: The target svn server must allow modification of revision properties.
111
NOTE: The target svn server must allow modification of revision properties.
109
      This is achieved with a svn "pre-revprop-change" hook of two lines:
112
      This is achieved with a svn "pre-revprop-change" hook of two lines:
110
        #!/bin/sh
113
        #!/bin/sh
111
        exit 0
114
        exit 0
112
 
115
 
113
 
116
 
114
======================================================================= EOF ===
117
======================================================================= EOF ===
115
 
118