diff options
author | gjoranv <gv@yahoo-inc.com> | 2017-06-22 14:30:54 +0200 |
---|---|---|
committer | gjoranv <gv@yahoo-inc.com> | 2017-06-22 14:36:38 +0200 |
commit | ac6a4ffecb70daa9d5aca5d1ee04d285a44b7aaf (patch) | |
tree | 2f3af2364f14bd59ef446067f8f4399289edfad2 /docker/ci | |
parent | fd3dff817f19548caef8f1c9e9b0504f6937ee85 (diff) |
Move Dockerfile and internal script for ci to new ci/ folder.
- Avoid artificial file suffix for Dockerfile.
Diffstat (limited to 'docker/ci')
-rw-r--r-- | docker/ci/Dockerfile | 15 | ||||
-rwxr-xr-x | docker/ci/vespa-ci-internal.sh | 35 |
2 files changed, 50 insertions, 0 deletions
diff --git a/docker/ci/Dockerfile b/docker/ci/Dockerfile new file mode 100644 index 00000000000..fc2e3ffe666 --- /dev/null +++ b/docker/ci/Dockerfile @@ -0,0 +1,15 @@ +# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +FROM vespabuild + +COPY tmp/vespa.spec /vespa.spec +RUN yum-builddep -y /vespa.spec + +# Build using non-root user 'vespabuilder' +RUN useradd --create-home -s /bin/bash vespabuilder +WORKDIR /home/vespabuilder +USER vespabuilder + +# Java requires proper locale for unicode +ENV LANG en_US.UTF-8 + +COPY ci/vespa-ci-internal.sh /vespa-ci-internal.sh diff --git a/docker/ci/vespa-ci-internal.sh b/docker/ci/vespa-ci-internal.sh new file mode 100755 index 00000000000..c1102476904 --- /dev/null +++ b/docker/ci/vespa-ci-internal.sh @@ -0,0 +1,35 @@ +#!/bin/bash +# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +set -e +set -x + +if [ $# -ne 1 ]; then + echo "Usage: $0 <git commit>" + echo "This script should not be called manually." + exit 1 +fi + +GIT_COMMIT=$1 +SOURCE_DIR=~/vespa +BUILD_DIR=~/build +NUM_CORES=$(nproc --all) +NUM_THREADS=$((${NUM_CORES} * 2)) + +mkdir "${SOURCE_DIR}" +mkdir "${BUILD_DIR}" +git clone --no-checkout --no-hardlinks file:///vespa "${SOURCE_DIR}" +cd "${SOURCE_DIR}" +git -c advice.detachedHead=false checkout ${GIT_COMMIT} +source /opt/rh/devtoolset-6/enable || true +sh ./bootstrap.sh full +MAVEN_OPTS="-Xms128m -Xmx512m" mvn -T ${NUM_THREADS} install +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 \ + "${SOURCE_DIR}" +make -j ${NUM_THREADS} +ctest3 -j ${NUM_THREADS} |