1 | #!/bin/bash
|
---|
2 |
|
---|
3 |
|
---|
4 | # http://stackoverflow.com/questions/4774054/reliable-way-for-a-bash-script-to-get-the-full-path-to-itself
|
---|
5 | #currentdir=$( cd "$(dirname "$0")" ; pwd -P )
|
---|
6 | currentdir=/home/sjm84
|
---|
7 | # On the linux VM machines that produce nightlies:
|
---|
8 | # set currentdir to /home/sjm84 (after chroot on /opt/lsb)
|
---|
9 | # or set currentdir to home/sjm84 if lsb is only mounted but
|
---|
10 | # the chroot to /opt/lsb step has not been done yet.
|
---|
11 |
|
---|
12 | if ! test -f "$currentdir/expeditee-release-kits/rke-setup.sh"; then
|
---|
13 | echo ""
|
---|
14 | echo "********************"
|
---|
15 | echo "First edit $currentdir/expeditee-release-kits/rke-setup.sh.in"
|
---|
16 | echo "to generate $currentdir/expeditee-release-kits/rke-setup.sh"
|
---|
17 | echo ""
|
---|
18 | echo "********************"
|
---|
19 | echo ""
|
---|
20 | exit -1
|
---|
21 | else
|
---|
22 | # rke-setup uses local paths, so cd into expeditee-release-kits first
|
---|
23 | # then call rke-setup.sh to source the environment vars it sets
|
---|
24 | pushd "$currentdir/expeditee-release-kits"
|
---|
25 | source "rke-setup.sh"
|
---|
26 | returnval=$?
|
---|
27 | if [ "$returnval" != "0" ]; then
|
---|
28 | echo "Error running rke-setup.sh, return value: $returnval"
|
---|
29 | popd
|
---|
30 | exit -2
|
---|
31 | else
|
---|
32 | popd
|
---|
33 |
|
---|
34 | # Make sure the expeditee folder and its rke-build.properties file exist
|
---|
35 | # then run the 'rke' command from snapshots\expeditee
|
---|
36 | pushd "$currentdir/snapshots"
|
---|
37 | if test -d expeditee; then
|
---|
38 | echo "Deleting $currentdir/snapshots/expeditee...."
|
---|
39 | rm -rf $currentdir/snapshots/expeditee
|
---|
40 | fi
|
---|
41 | if ! test -d expeditee; then
|
---|
42 | mkdir expeditee
|
---|
43 | fi
|
---|
44 | if ! test -f expeditee/rke-build.properties; then
|
---|
45 | cp $currentdir/expeditee-release-kits/rke-build.properties.in expeditee/rke-build.properties
|
---|
46 | fi
|
---|
47 | pushd expeditee
|
---|
48 | rke
|
---|
49 |
|
---|
50 | # http://stackoverflow.com/questions/1401482/yyyy-mm-dd-format-date-in-shell-script
|
---|
51 | DATE=`date +%Y-%m-%d`
|
---|
52 |
|
---|
53 | # Uploading
|
---|
54 | mkdir uploads
|
---|
55 | cp products/Expeditee-1${products_suffix} uploads/Expeditee-1-${DATE}${uploads_suffix}
|
---|
56 | cp rke.out uploads/rke-${DATE}${out_suffix}.out
|
---|
57 | cd uploads && tar -c * | ssh -T -i "${identity_file}" [email protected]
|
---|
58 |
|
---|
59 | exit 0
|
---|
60 | fi
|
---|
61 | fi
|
---|