[18436] | 1 | #!/bin/bash
|
---|
[11575] | 2 |
|
---|
[18436] | 3 | echo "modify generic"
|
---|
| 4 | cd $ISSM_DIR/bin
|
---|
| 5 | cat generic_static.m | sed -e "s/generic_static/generic/g" > generic.m
|
---|
| 6 | echo "move mpiexec to bin"
|
---|
[22893] | 7 | cp ../externalpackages/mpich/install/bin/mpiexec .
|
---|
| 8 | cp ../externalpackages/mpich/install/bin/hydra_pmi_proxy .
|
---|
| 9 | echo "move gmsh to bin"
|
---|
| 10 | if [ -f ../externalpackages/gmsh/install/gmsh ]; then
|
---|
| 11 | cp ../externalpackages/gmsh/install/gmsh .
|
---|
| 12 | else
|
---|
| 13 | echo "gmsh not found"
|
---|
| 14 | fi
|
---|
[11575] | 15 |
|
---|
[18436] | 16 | #Check that test101 runs
|
---|
| 17 | cd $ISSM_DIR/test/NightlyRun
|
---|
| 18 | rm matlab.log
|
---|
[22893] | 19 | /usr/local/MATLAB/R2015a/bin/matlab -nojvm -nosplash -r "try, addpath $ISSM_DIR/bin $ISSM_DIR/lib; runme('id',101);exit; catch me,fprintf('%s',getReport(me)); exit; end" -logfile matlab.log
|
---|
[11575] | 20 |
|
---|
[18436] | 21 | if [[ $(cat matlab.log | grep -c SUCCESS) -lt 10 ]]; then
|
---|
| 22 | echo "test101 FAILED"
|
---|
| 23 | exit 1;
|
---|
| 24 | else
|
---|
| 25 | echo "test101 passed"
|
---|
| 26 | fi
|
---|
| 27 |
|
---|
| 28 | tarball_name='issm-ubuntu-static_build.tar.gz'
|
---|
| 29 |
|
---|
| 30 | echo "Cleanup first"
|
---|
| 31 | cd $ISSM_DIR
|
---|
| 32 | rm $tarball_name
|
---|
| 33 |
|
---|
| 34 | echo "Creating tarball: ${tarball_name}"
|
---|
| 35 | cd $ISSM_DIR
|
---|
[20610] | 36 | rm -rf trunk
|
---|
| 37 | mkdir trunk
|
---|
[22893] | 38 | cp -rf bin lib test examples scripts trunk/
|
---|
[20610] | 39 | tar -czf $tarball_name trunk
|
---|
[18436] | 40 | ls -lah $tarball_name
|
---|
[18445] | 41 |
|
---|
[18525] | 42 | echo "Shipping binaries to website"
|
---|
[20610] | 43 |
|
---|
| 44 | # We're using public key authentication method to upload the tarball The
|
---|
| 45 | # following lines check to see if the SSH Agent is running. If not, then it is
|
---|
| 46 | # started and relevant information is forwarded to a script.
|
---|
| 47 | pgrep "ssh-agent" > /dev/null
|
---|
| 48 | if [ $? -ne 0 ]; then
|
---|
| 49 | echo "SSH Agent is not running. Starting it..."
|
---|
| 50 | ssh-agent > ~/.ssh/agent.sh
|
---|
| 51 | else
|
---|
| 52 | echo "SSH Agent is running..."
|
---|
| 53 | fi
|
---|
| 54 |
|
---|
| 55 | source ~/.ssh/agent.sh
|
---|
| 56 | ssh-add ~/.ssh/ubuntu-bins_jenkins-to-ross
|
---|
| 57 |
|
---|
| 58 | scp $tarball_name ross.ics.uci.edu:/var/www/html/$tarball_name
|
---|
| 59 |
|
---|
| 60 | if [ $? -ne 0 ]; then
|
---|
| 61 | echo "The upload failed."
|
---|
| 62 | echo "Perhaps the SSH Agent was started by some other means."
|
---|
| 63 | echo "Try killing the agent and running again."
|
---|
| 64 | fi
|
---|