summaryrefslogtreecommitdiffstats
path: root/travis
diff options
context:
space:
mode:
authorBjørn Christian Seime <bjorncs@yahoo-inc.com>2017-08-14 15:15:27 +0200
committerBjørn Christian Seime <bjorncs@yahoo-inc.com>2017-08-14 15:44:09 +0200
commit6186bda755f8e683cf91c560a76fd43870b8b4c1 (patch)
treec28c1ef1a9742ab049c9fe62031a9d2f5b4154db /travis
parent079aa085416f76b4d19fbaaaad1c05e2ea508ba9 (diff)
Add Travis build script
Diffstat (limited to 'travis')
-rwxr-xr-xtravis/travis-build-cpp.sh27
-rwxr-xr-xtravis/travis-build-java.sh12
-rwxr-xr-xtravis/travis.sh9
3 files changed, 48 insertions, 0 deletions
diff --git a/travis/travis-build-cpp.sh b/travis/travis-build-cpp.sh
new file mode 100755
index 00000000000..27d35fa3518
--- /dev/null
+++ b/travis/travis-build-cpp.sh
@@ -0,0 +1,27 @@
+#!/bin/bash
+# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+set -e
+
+SOURCE_DIR=/source
+BUILD_DIR=~/build
+
+mkdir "${BUILD_DIR}"
+
+ccache -M 20G
+NUM_THREADS=4
+source /opt/rh/devtoolset-6/enable || true
+cd "${SOURCE_DIR}"
+sh ./bootstrap.sh full
+cd "${BUILD_DIR}"
+cmake3 \
+ -DCMAKE_INSTALL_PREFIX=/opt/vespa \
+ -DJAVA_HOME=/usr/lib/jvm/java-openjdk \
+ -DEXTRA_LINK_DIRECTORY="/opt/vespa-boost/lib;/opt/vespa-libtorrent/lib;/opt/vespa-zookeeper-c-client/lib;/opt/vespa-cppunit/lib;/usr/lib64/llvm3.9/lib" \
+ -DEXTRA_INCLUDE_DIRECTORY="/opt/vespa-boost/include;/opt/vespa-libtorrent/include;/opt/vespa-zookeeper-c-client/include;/opt/vespa-cppunit/include;/usr/include/llvm3.9" \
+ -DCMAKE_INSTALL_RPATH="/opt/vespa/lib64;/opt/vespa-boost/lib;/opt/vespa-libtorrent/lib;/opt/vespa-zookeeper-c-client/lib;/opt/vespa-cppunit/lib;/usr/lib/jvm/java-1.8.0/jre/lib/amd64/server;/usr/include/llvm3.9" \
+ -DCMAKE_BUILD_RPATH=/opt/vespa/lib64 \
+ -DVALGRIND_UNIT_TESTS=no \
+ "${SOURCE_DIR}"
+make -j ${NUM_THREADS}
+ctest3 -j ${NUM_THREADS}
+
diff --git a/travis/travis-build-java.sh b/travis/travis-build-java.sh
new file mode 100755
index 00000000000..7e0088586a4
--- /dev/null
+++ b/travis/travis-build-java.sh
@@ -0,0 +1,12 @@
+#!/bin/bash
+# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+set -e
+
+SOURCE_DIR=/source
+NUM_THREADS=4
+
+cd "${SOURCE_DIR}"
+source /opt/rh/devtoolset-6/enable || true
+export MAVEN_OPTS="-Xms128m -Xmx512m"
+sh ./bootstrap.sh java
+mvn install -nsu -B -T ${NUM_THREADS} -V # Should ideally split out test phase, but some unit tests fails on 'mvn test'
diff --git a/travis/travis.sh b/travis/travis.sh
new file mode 100755
index 00000000000..f64affbcbb0
--- /dev/null
+++ b/travis/travis.sh
@@ -0,0 +1,9 @@
+#!/bin/bash
+# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+set -e
+
+PLATFORM_LANGUAGE=$1
+DOCKER_IMAGE=vespaengine/vespa-dev:latest
+docker run --rm -v ${HOME}/.m2:/root/.m2 -v ${HOME}/.ccache:/root/.ccache -v $(pwd):/source \
+ --entrypoint /source/travis/travis-build-${PLATFORM_LANGUAGE}.sh ${DOCKER_IMAGE}
+