source: other-projects/nightly-tasks/crons-and-scripts/macos/create-expeditee.sh@ 32399

Last change on this file since 32399 was 32399, checked in by ak19, 6 years ago

Committing the create-expeditee and run-gs2-diffcol.sh scripts from Mac Mountain Lion to svn. May not be Mountain Lion or even mac specific.

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