Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build GMT on TravisCI #5

Merged
merged 15 commits into from
Aug 13, 2018
Prev Previous commit
Next Next commit
Rename the build script to travis-build.sh
It will work on linux and osx
  • Loading branch information
leouieda committed Aug 13, 2018
commit ed6a5c8519251bfd5126f5d765bd4ed57b1be0bf
6 changes: 1 addition & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,7 @@ before_install:

install:
# Build and install GMT
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then
bash ci/build-linux.sh;
else
echo "OSX not supported yet";
fi
- bash ci/travis-build.sh;

script:
- gmt defaults -Vd
Expand Down
6 changes: 6 additions & 0 deletions ci/build-linux.sh → ci/travis-build.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#!/bin/bash
# Build and install GMT

# To return a failure if any commands inside fail
set -e

mkdir $INSTALLDIR

mkdir build && cd build
Expand All @@ -14,3 +17,6 @@ cmake -D CMAKE_INSTALL_INSTALLDIR=$INSTALLDIR \
make
make check
make install

# Turn off exit on failure.
set +e
6 changes: 6 additions & 0 deletions ci/travis-setup.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#!/bin/bash
# Setup TravisCI to be able to build and test GMT

# To return a failure if any commands inside fail
set -e

# Install dependencies
if [ "$TRAVIS_OS_NAME" == "linux" ]; then
sudo apt-get install build-essential cmake libcurl4-gnutls-dev libnetcdf-dev \
Expand Down Expand Up @@ -34,3 +37,6 @@ echo "==========================================================================
curl "ftp:https://ftp.soest.hawaii.edu/dcw/$DCW.$EXT" > $DCW.$EXT
tar xzf $DCW.$EXT
cp $DCW/* $COASTLINEDIR

# Turn off exit on failure.
set +e