]> git.donarmstrong.com Git - neurodebian.git/blob - tools/nd_execute
Also for stats report which repo and which job number use our setup
[neurodebian.git] / tools / nd_execute
1 #!/bin/bash
2
3 if [ -z "$1" ]; then
4 cat << EOT
5 Script to log into a particular COW and execute some command.
6
7 Synopsis
8 --------
9
10   nd_execute <family> <codename> <arch> [cowbuilderopts] command
11
12 EOT
13 exit 1
14 fi
15
16 family=$1
17 dist=$2
18 arch=$3
19 bmdir=
20 #$4
21
22 set -e
23
24 if [ -z "$family" ]; then
25   echo "You need to provide a distribution family ('debian', 'ubuntu'); prefix with 'nd+' to enable the NeuroDebian repository."
26   exit 1
27 fi
28
29 if [ -z "$dist" ]; then
30   echo "You need to provide a distribution codename (e.g. 'lenny', 'squeeze')."
31   exit 1
32 fi
33
34 if [ -z "$arch" ]; then
35   echo "You need to provide an architecture (e.g. 'i386', 'amd64')."
36   exit 1
37 fi
38
39 . /etc/neurodebian/cmdsettings.sh
40
41 shift; shift; shift; # get rid of those from future use of $@
42
43 # common options
44 opts="--distribution $dist --aptcache $aptcache --buildplace $buildplace"
45
46
47 #if [ -n "bmdir" ]; then
48 #  options="$opts --bindmounts $bmdir"
49 #else
50   options="$opts"
51 #fi
52
53 cowbuilder --execute \
54              --basepath ${cowbuilderroot}/cow/${family}-${dist}-${arch}.cow \
55              $options \
56              "$@"