16 | | This script requires a configuration file to be present, `/etc/quattor-deploy.conf`. The configuration file must contain only shell variable definition (`sh` syntax). The '''required''' variables are : |
| 23 | ''Note: an obsolete version of this script was called `post-commit` (and is a shell script). All the information here doesn't apply to this obsolete version whose configuration file had a different format, despite the same name. When migrating from the obsolete version to the new one, the configuration file must be replaced.'' |
| 24 | |
| 25 | This script requires a configuration file, `/etc/quattor-deploy.conf` (common with the [#DeploymentScript deployment script] when running on the same machine). All the configuration options supported and their default values are defined at the beginning of the script. The configuration file has several sections. One of them, `[scdb]`, is common to the hook script and the deployment script. The main options available and their default values are: |
18 | | # Quattor server name |
19 | | QUATTORSRV="quattorsrv.lal.in2p3.fr" |
| 27 | [post-commit] |
| 28 | # Script launched by the script to actually do the deployment |
| 29 | deploy_script : /root/quattor/scripts/build-tag.py |
| 30 | # Name of the deployment server where to run the deploy_script. Used only with ssh. |
| 31 | # This can be a space-separated list (not yet implemented, see https://trac.lal.in2p3.fr/LCGQWG/ticket/46). |
| 32 | #deploy_server : quattorsrv.example.org |
| 33 | # Userid to use to run deploy_script |
| 34 | deploy_user : root |
| 35 | # notify_xxx are used to configure email notification in case of errors. |
| 36 | # If notif_from or notif_to is undefined, email notification is disabled |
| 37 | notif_mailer : localhost |
| 38 | #notif_from=Quattor Deployment <noreply@lal.in2p3.fr> |
| 39 | #notif_to=jouvin@lal.in2p3.fr |
| 40 | notif_subject_prefix : [Quattor-Deploy] |
| 41 | notif_subject : Failed to deploy revision %s of SCDB configuration |
| 42 | # Default should be appropriate. Set to false if your client doesn't handle properly returned output. |
| 43 | # When set to false, no message is printed on stdout, except if verbose is > 0. |
| 44 | report_error_to_svn: yes |
| 45 | # When false, ssh is used instead. This requires deploy_server to be defined too. |
| 46 | use_sudo : yes |
| 47 | # Log operations in /tmp/quattor-post-commit.log |
| 48 | verbose: 0 |
26 | | Other supported variables are : |
27 | | {{{ |
28 | | # Script on Quattor server to deploy new configuration |
29 | | # Default : DEPLOYSCRIPT=/root/quattor/scripts/build-tag.pl |
30 | | |
31 | | # User to run the deployment script |
32 | | # Default : DEPLOYUSER=root |
33 | | |
34 | | # Full paths to commands. |
35 | | # Defaults are appropriate for RHEL/SL Linux. |
36 | | # MAILER="/bin/mail" |
37 | | # SVNLOOK="/usr/bin/svnlook" |
38 | | # SSH="/usr/bin/ssh" |
39 | | |
40 | | # Use sudo rather than ssh between SVN server and quattor deployment server |
41 | | # Default: SSH |
42 | | # USE_SUDO=1 |
43 | | |
44 | | # Default prefix for mail subject in case of error |
45 | | # Default : ERROR_PREFIX='[Quattor-Deploy]' |
46 | | }}} |
47 | | |
48 | | ''Note : if you support several SCDB repositories on the same Subversion server, you can place configuration file for hook script in the `hooks` directory of each repository. If the configuration file is present both in `hooks` directory and in `/etc`, `hooks` directory takes precedence.'' |
| 69 | The only required options for which no default value is provided is `repository_url` in `[scdb]` section. It must match the root URL of your SVN repository (as returned by `svn info`). |
56 | | It needs to be installed on the Quattor server and will be called through SSH by hook script (you need to configure a SSH key without password between your Subversion server and your Quattor server). The defaut location to install the script is `/root/quattor/scripts' but you can put it wherever you want as soon as you update the hook script accordingly. This script, [source:SCDB/tags/pro/src/hooks/build-tag.pl build-tag.pl], is provided as part of SCDB tools inside [source:SCDB/tags/pro/src/hooks src/hooks] directory. |
| 77 | It needs to be installed on the Quattor server and will be called through sudo or ssh by the hook script (you need to configure a SSH key without password between your Subversion server and your Quattor server to use ssh). The default location to install the script is `/root/quattor/scripts` but you can put it wherever you want as soon as you update the hook script configuration (`[post-commit]` section) accordingly. The source of this script is [source:SCDB/trunk/src/hooks/build-tag.py build-tag.py]. |
| 78 | |
| 79 | ''Note: an obsolete version of this script was called `build-tag.pl` (written in Perl). All the information here doesn't apply to this obsolete version whose configuration file had a different format. When migrating from the obsolete version to the new one, the configuration file must be replaced.'' |
| 80 | |
| 81 | This script requires a configuration file, `/etc/quattor-deploy.conf` (common with the [#SubversionHookScript hook script] when running on the same machine). All the configuration options supported and their default values are defined at the beginning of the script. The configuration file has several sections. One of them, `[scdb]`, is common to the hook script and the deployment script. The main options available and their default values are: |
60 | | `/etc/build-tag.conf` allows to customize [source:SCDB/tags/pro/src/hooks/build-tag.pl build-tag.pl] according to local needs. '''It must be present'''. This file must contain key/value pairs (with '=' between key and value, keys are not case sensitive). Supported configuration options are : |
61 | | |
62 | | * `debug` : display additional information if non zero. |
63 | | * `java_home` : path of Java virtual machine. |
64 | | * `java_version` : alternative to `java_home`. Must match a directory under `/usr/java`. Default : $JAVA_HOME if defined. |
65 | | * `svn_cache` : location to use for SCDB repository local cache. Default : `svncache` at same level as the directory where the script is installed. |
66 | | * `use_svn` : if non zero, force the use of `svn` command even if `jsvn` exists. Default : use `jsvn` from `svn_cache` if it is present. ''Note : using `jsvn` may affect performances.'' |
67 | | * `tags_svn_url` ('''required''') : SVN URL for SCDB repository `tags` branch |
68 | | |
69 | | An `/etc/build-tag.conf` example is : |
70 | | {{{ |
71 | | use_svn = 1 |
72 | | java_version = jdk1.6.0 |
73 | | tags_svn_url = http://grid280.lal.in2p3.fr/svn/quattor/tags |
74 | | }}} |
| 131 | |
| 132 | |
| 133 | == Archived Documentation == |
| 134 | |
| 135 | The information in this section is kept here for reference. It documents the configuration file format of the obsolete hook script and deployment script. |
| 136 | |
| 137 | === Hook script (obsolete) === |
| 138 | |
| 139 | This script requires a configuration file to be present, `/etc/quattor-deploy.conf`. The configuration file must contain only shell variable definition (`sh` syntax). The '''required''' variables are : |
| 140 | {{{ |
| 141 | # Quattor server name |
| 142 | QUATTORSRV="quattorsrv.lal.in2p3.fr" |
| 143 | |
| 144 | # Recipients of status mail and location for checkout. |
| 145 | NOTIFY="quattor-mgrs@lal.in2p3.fr" |
| 146 | |
| 147 | }}} |
| 148 | |
| 149 | Other supported variables are : |
| 150 | {{{ |
| 151 | # Script on Quattor server to deploy new configuration |
| 152 | # Default : DEPLOYSCRIPT=/root/quattor/scripts/build-tag.pl |
| 153 | |
| 154 | # User to run the deployment script |
| 155 | # Default : DEPLOYUSER=root |
| 156 | |
| 157 | # Full paths to commands. |
| 158 | # Defaults are appropriate for RHEL/SL Linux. |
| 159 | # MAILER="/bin/mail" |
| 160 | # SVNLOOK="/usr/bin/svnlook" |
| 161 | # SSH="/usr/bin/ssh" |
| 162 | |
| 163 | # Use sudo rather than ssh between SVN server and quattor deployment server |
| 164 | # Default: SSH |
| 165 | # USE_SUDO=1 |
| 166 | |
| 167 | # Default prefix for mail subject in case of error |
| 168 | # Default : ERROR_PREFIX='[Quattor-Deploy]' |
| 169 | }}} |
| 170 | |
| 171 | === Deployment Script (obsolete) === |
| 172 | |
| 173 | `/etc/build-tag.conf` allows to customize [source:SCDB/tags/pro/src/hooks/build-tag.pl build-tag.pl] according to local needs. '''It must be present'''. This file must contain key/value pairs (with '=' between key and value, keys are not case sensitive). Supported configuration options are : |
| 174 | |
| 175 | * `debug` : display additional information if non zero. |
| 176 | * `java_home` : path of Java virtual machine. |
| 177 | * `java_version` : alternative to `java_home`. Must match a directory under `/usr/java`. Default : $JAVA_HOME if defined. |
| 178 | * `svn_cache` : location to use for SCDB repository local cache. Default : `svncache` at same level as the directory where the script is installed. |
| 179 | * `use_svn` : if non zero, force the use of `svn` command even if `jsvn` exists. Default : use `jsvn` from `svn_cache` if it is present. ''Note : using `jsvn` may affect performances.'' |
| 180 | * `tags_svn_url` ('''required''') : SVN URL for SCDB repository `tags` branch |
| 181 | |
| 182 | An `/etc/build-tag.conf` example is : |
| 183 | {{{ |
| 184 | use_svn = 1 |
| 185 | java_version = jdk1.6.0 |
| 186 | tags_svn_url = http://grid280.lal.in2p3.fr/svn/quattor/tags |
| 187 | }}} |