source: issm/trunk-jpl/packagers/win10/package64.sh@ 24311

Last change on this file since 24311 was 24311, checked in by Mathieu Morlighem, 5 years ago

merged trunk and trunk-jpl

  • Property svn:executable set to *
File size: 3.0 KB
Line 
1#!/bin/bash
2
3MATLAB_PATH="/cygdrive/c/Programs/MATLAB/R2015a"
4PACKAGE="ISSM" # Name of directory to copy distributable files to
5TARBALL_NAME='ISSM-Win10-64'
6TARBALL=$TARBALL_NAME.tar.gz
7
8# Source Windows environment
9source $ISSM_DIR/externalpackages/windows/windows_environment.sh
10
11# Clean up from previous packaging
12echo "Cleaning up existing assets"
13cd $ISSM_DIR
14rm -rf $PACKAGE
15mkdir $PACKAGE
16
17# Add/modify required binaries
18cd $ISSM_DIR/bin
19
20echo "Making generic_static.m work like generic.m"
21cat generic_static.m | sed -e "s/generic_static/generic/g" > generic.m
22
23echo "Copying scripts from /src to /bin"
24rm $ISSM_DIR/bin/*.m
25find $ISSM_DIR/src/m -name '*.m' | xargs cp -t $ISSM_DIR/bin
26
27echo "Copying gmsh to bin"
28if [ -f ../externalpackages/gmsh/install/gmsh.exe ]; then
29 cp ../externalpackages/gmsh/install/gmsh.exe ./gmsh.exe
30else
31 echo "gmsh not found"
32fi
33
34# Copy gmt to package
35# NOTE: The following assumes the precompiled version of gmt
36echo "Moving gmt to externalpackages"
37if [ -f $ISSM_DIR/externalpackages/gmt/install/bin/gmt ]; then
38 mkdir $ISSM_DIR/$PACKAGE/externalpackages
39 mkdir $ISSM_DIR/$PACKAGE/externalpackages/gmt
40 cp -a $ISSM_DIR/externalpackages/gmt/install $ISSM_DIR/$PACKAGE/externalpackages/gmt/install
41else
42 echo "gmt not found"
43fi
44
45# Check that test 101 runs
46cd $ISSM_DIR/test/NightlyRun
47rm matlab.log
48$MATLAB_PATH/bin/matlab -nodisplay -nosplash -r "try, addpath $ISSM_DIR_WIN/bin $ISSM_DIR_WIN/lib; runme('id',101); exit; catch me,fprintf('%s',getReport(me)); exit; end" -logfile matlab.log
49
50# Wait until MATLAB closes
51sleep 5
52pid=$(ps aux -W | grep MATLAB | awk '{printf("%s\n","MATLAB");}')
53while [ -n "$pid" ]
54do
55 pid=$(ps aux -W | grep MATLAB | awk '{printf("%s\n","MATLAB");}')
56 sleep 1
57done
58
59if [[ $(cat matlab.log | grep -c SUCCESS) -lt 10 ]]; then
60 echo "test101 FAILED"
61 exit 1;
62else
63 echo "test101 passed"
64fi
65
66# Create tarball
67echo "Creating tarball: ${TARBALL_NAME}"
68cd $ISSM_DIR
69rm -f $TARBALL
70cp -rf bin lib test examples scripts $PACKAGE/
71
72# Create link to gmt from bin
73# NOTE: It is important that we are in the destination dir when sym linking so that the path is relative
74if [ -f $ISSM_DIR/$PACKAGE/externalpackages/gmt/bin/gmt ]; then
75 cd $ISSM_DIR/$PACKAGE/bin
76 ln -s ../externalpackages/gmt/bin/gmt.exe ./gmt.exe
77fi
78
79cd $ISSM_DIR
80tar -czf $TARBALL $PACKAGE
81ls -lah $TARBALL
82
83# Ship binaries to website
84echo "Shipping binaries to website"
85
86# We're using public key authentication method to upload the tarball The
87# following lines check to see if the SSH Agent is running. If not, then it is
88# started and relevant information is forwarded to a script.
89pgrep "ssh-agent" > /dev/null
90
91if [ $? -ne 0 ]; then
92 echo "SSH agent is not running. Starting it..."
93 ssh-agent > ~/.ssh/agent.sh
94else
95 echo "SSH agent is running..."
96fi
97
98source ~/.ssh/agent.sh
99ssh-add ~/.ssh/win_bins-geidi_prime_to_ross
100
101scp $TARBALL jenkins@ross.ics.uci.edu:/var/www/html/$TARBALL
102
103if [ $? -ne 0 ]; then
104 echo "The upload failed."
105 echo "Perhaps the SSH agent was started by some other means."
106 echo "Try killing the agent and running again."
107fi
Note: See TracBrowser for help on using the repository browser.