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
RevLine 
[23295]1#!/bin/bash
2
[24311]3MATLAB_PATH="/cygdrive/c/Programs/MATLAB/R2015a"
4PACKAGE="ISSM" # Name of directory to copy distributable files to
[23385]5TARBALL_NAME='ISSM-Win10-64'
6TARBALL=$TARBALL_NAME.tar.gz
[23304]7
[23303]8# Source Windows environment
9source $ISSM_DIR/externalpackages/windows/windows_environment.sh
[23298]10
[23385]11# Clean up from previous packaging
12echo "Cleaning up existing assets"
13cd $ISSM_DIR
[24311]14rm -rf $PACKAGE
15mkdir $PACKAGE
[23385]16
17# Add/modify required binaries
18cd $ISSM_DIR/bin
19
[23298]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"
[23295]24rm $ISSM_DIR/bin/*.m
[23298]25find $ISSM_DIR/src/m -name '*.m' | xargs cp -t $ISSM_DIR/bin
[23295]26
[23364]27echo "Copying gmsh to bin"
28if [ -f ../externalpackages/gmsh/install/gmsh.exe ]; then
[24311]29 cp ../externalpackages/gmsh/install/gmsh.exe ./gmsh.exe
[23364]30else
31 echo "gmsh not found"
32fi
33
[24311]34# Copy gmt to package
[23385]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
[24311]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
[23385]41else
42 echo "gmt not found"
43fi
44
[23298]45# Check that test 101 runs
46cd $ISSM_DIR/test/NightlyRun
47rm matlab.log
[23303]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
[23295]49
[23313]50# Wait until MATLAB closes
51sleep 5
52pid=$(ps aux -W | grep MATLAB | awk '{printf("%s\n","MATLAB");}')
53while [ -n "$pid" ]
54do
[23312]55 pid=$(ps aux -W | grep MATLAB | awk '{printf("%s\n","MATLAB");}')
[23313]56 sleep 1
57done
[23312]58
[23298]59if [[ $(cat matlab.log | grep -c SUCCESS) -lt 10 ]]; then
60 echo "test101 FAILED"
61 exit 1;
62else
63 echo "test101 passed"
64fi
[23295]65
[23298]66# Create tarball
[23385]67echo "Creating tarball: ${TARBALL_NAME}"
68cd $ISSM_DIR
69rm -f $TARBALL
[24311]70cp -rf bin lib test examples scripts $PACKAGE/
[23295]71
[23385]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
[24311]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
[23385]77fi
78
[23298]79cd $ISSM_DIR
[24311]80tar -czf $TARBALL $PACKAGE
[23385]81ls -lah $TARBALL
[23295]82
[23326]83# Ship binaries to website
84echo "Shipping binaries to website"
[23298]85
[23326]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
[23385]101scp $TARBALL jenkins@ross.ics.uci.edu:/var/www/html/$TARBALL
[23326]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.