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