| 6914 |
dpurdie |
1 |
#!/bin/bash
|
|
|
2 |
#
|
|
|
3 |
# This script is a part of the 'buildtool' - the JATS automated build system
|
|
|
4 |
#
|
|
|
5 |
# Installation locatation
|
|
|
6 |
# This script must be installed into:
|
|
|
7 |
# /home/releasem/sbin/jatsTool on the dpkg_archive server
|
|
|
8 |
#
|
|
|
9 |
# Sudo Configuration
|
|
|
10 |
# Correct operation relies on the use of Sudo. sudo must be configured with:
|
|
|
11 |
# releasem ALL=(buildadm) NOPASSWD: /home/releasem/sbin/jatsTool
|
|
|
12 |
#
|
|
|
13 |
# Operation:
|
|
|
14 |
# A master deamon withint the buildtool will invoke the command
|
|
|
15 |
# sudo -n -u buildadm /home/releasem/sbin/jatsTool assemble_dpkg ...
|
|
|
16 |
# after conecting to the dpkg_archive server as the 'releasem' user
|
|
|
17 |
#
|
|
|
18 |
# The script will:
|
|
|
19 |
# * Ensure that the user is running as 'buildadm'
|
|
|
20 |
# * Setup the execution environment to ensure that JATS can run
|
|
|
21 |
# * Run jats an invove he maned tool with provided arguments
|
|
|
22 |
#
|
|
|
23 |
#
|
|
|
24 |
if [ $USER != "buildadm" ] ; then
|
|
|
25 |
echo "This script MUST be run as buildadm, not as $USER"
|
|
|
26 |
exit 1
|
|
|
27 |
fi
|
|
|
28 |
source /etc/profile
|
|
|
29 |
jats etool "$@"
|
|
|
30 |
|