Skip to content
This repository was archived by the owner on Oct 10, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions scripts/travis/before_install
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ if [ "${TRAVIS_OS_NAME}" == "linux" ]; then
fi
if [ "${TRAVIS_OS_NAME}" == "osx" ]; then
bash support/osx/install-deps
brew install ninja
fi
echo "export GIT_COMMIT_DATE=\"$(git show -s --format='%cd' --date=short | tr -d '-')\"" > ${TRAVIS_BUILD_DIR}/git_commit_date.sh
cat ${TRAVIS_BUILD_DIR}/git_commit_date.sh
Expand Down
6 changes: 3 additions & 3 deletions scripts/travis/ci-build
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ fi

if [ "${TRAVIS_OS_NAME}" == "linux" ]; then
docker run --privileged -v $TRAVIS_BUILD_DIR:/code -v $TRAVIS_BUILD_DIR/build:/build --entrypoint ${CMAKE_BINARY} --name "planetary_imager_cmake" ${DOCKER_IMAGE} \
-DPACKAGE_VERSION_SUFFIX="_${GIT_COMMIT_DATE}_ci${TRAVIS_BUILD_NUMBER}" -DCMAKE_BUILD_TYPE=Debug -DENABLE_PLANETARYIMAGER_TESTING=${ENABLE_PLANETARYIMAGER_TESTING} /code
-G Ninja -DPACKAGE_VERSION_SUFFIX="_${GIT_COMMIT_DATE}_ci${TRAVIS_BUILD_NUMBER}" -DCMAKE_BUILD_TYPE=Debug -DENABLE_PLANETARYIMAGER_TESTING=${ENABLE_PLANETARYIMAGER_TESTING} /code
fi

if [ "${TRAVIS_OS_NAME}" == "osx" ]; then
mkdir "$TRAVIS_BUILD_DIR/build"
cd "$TRAVIS_BUILD_DIR/build"
bash "$TRAVIS_BUILD_DIR/support/osx/cmake" -DCPACK_GENERATOR=DragNDrop -DPACKAGE_SYSTEM_NAME=MacOSX \
-DPACKAGE_VERSION_SUFFIX="_${GIT_COMMIT_DATE}_ci${TRAVIS_BUILD_NUMBER}" -DCMAKE_BUILD_TYPE=RelWithDebInfo -DENABLE_PLANETARYIMAGER_TESTING=${ENABLE_PLANETARYIMAGER_TESTING} \
-G Ninja -DPACKAGE_VERSION_SUFFIX="_${GIT_COMMIT_DATE}_ci${TRAVIS_BUILD_NUMBER}" -DCMAKE_BUILD_TYPE=RelWithDebInfo -DENABLE_PLANETARYIMAGER_TESTING=${ENABLE_PLANETARYIMAGER_TESTING} \
"$TRAVIS_BUILD_DIR"
make -j4
ninja
fi

4 changes: 2 additions & 2 deletions scripts/travis/package
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ mkdir -p "$TRAVIS_BUILD_DIR/packages"
if [ "${TRAVIS_OS_NAME}" == "linux" ]; then
source ~/virtualenv/python3.6/bin/activate
pip install pyaml
./support/docker/docker.py package -j 4 -d "${TRAVIS_BUILD_DIR}/packages" --stderr -D PACKAGE_VERSION_SUFFIX="_${GIT_COMMIT_DATE}_ci${TRAVIS_BUILD_NUMBER}" --privileged -i ${DOCKER_IMAGE}
./support/docker/docker.py package -d "${TRAVIS_BUILD_DIR}/packages" --stderr -D PACKAGE_VERSION_SUFFIX="_${GIT_COMMIT_DATE}_ci${TRAVIS_BUILD_NUMBER}" --privileged -i ${DOCKER_IMAGE}
fi

if [ "${TRAVIS_OS_NAME}" == "osx" ]; then
cd "$TRAVIS_BUILD_DIR/build"
make package -j4
ninja package
cp -av *.dmg "$TRAVIS_BUILD_DIR/packages"
fi
8 changes: 4 additions & 4 deletions scripts/travis/tests
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ set -e

if [ "${TRAVIS_OS_NAME}" == "${BUILD_OS_FAMILY}" ] && [ "${SKIP_TESTS}" == "0" ]; then
if [ "$TRAVIS_OS_NAME" == 'linux' ]; then
docker run --privileged -v $TRAVIS_BUILD_DIR:/code -v $TRAVIS_BUILD_DIR/build:/build --entrypoint make --name "planetary_imager_build" ${DOCKER_IMAGE} build_tests -j4
docker run --privileged -v $TRAVIS_BUILD_DIR:/code -v $TRAVIS_BUILD_DIR/build:/build --entrypoint make --name "planetary_imager_tests" ${DOCKER_IMAGE} test CTEST_OUTPUT_ON_FAILURE=1 GTEST_OUTPUT=xml:/build/tests_result/
docker run --privileged -v $TRAVIS_BUILD_DIR:/code -v $TRAVIS_BUILD_DIR/build:/build --entrypoint ninja --name "planetary_imager_build" ${DOCKER_IMAGE} build_tests
docker run --privileged -v $TRAVIS_BUILD_DIR:/code -v $TRAVIS_BUILD_DIR/build:/build --entrypoint ninja --name "planetary_imager_tests" -e GTEST_OUTPUT=xml:/build/tests_result -e CTEST_OUTPUT_ON_FAILURE=1 ${DOCKER_IMAGE} test
fi

if [ "$TRAVIS_OS_NAME" == 'osx' ]; then
cd "$TRAVIS_BUILD_DIR/build"
make build_tests -j4
make test GTEST_OUTPUT=xml:$TRAVIS_BUILD_DIR/build/tests_result/ CTEST_OUTPUT_ON_FAILURE=1
ninja build_tests
GTEST_OUTPUT=xml:$TRAVIS_BUILD_DIR/build/tests_result/ CTEST_OUTPUT_ON_FAILURE=1 ninja test
fi
fi

2 changes: 1 addition & 1 deletion support/docker/docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def generate_travis(args):
parser_package.add_argument('-d', '--dest', required=True, help='Destination directory (i.e. where to put packages). Use `none` if you want to skip exporting packages.')
parser_package.add_argument('-b', '--build-directory', required=False, help='Bind build directory on docker')
parser_package.add_argument('--cmake-build-type', default='RelWithDebInfo', help='CMAKE_BUILD_TYPE')
parser_package.add_argument('-j', '--make-jobs', default=1, help='Make parallel jobs')
parser_package.add_argument('-j', '--make-jobs', help='Make parallel jobs')
parser_package.add_argument('-D', '--cmake-define', action='append', default=[], help='CMake definitions to be passed to docker container (use multiple times if necessary)')
parser_package.add_argument('-i', '--images-filter', action='append', default=[], help='Filter images by name (use multiple times if necessary)')
parser_package.add_argument('-c', '--clean-logs', action='store_true', default=False, help='Clean logs directory')
Expand Down
10 changes: 4 additions & 6 deletions support/docker/dockerfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,12 @@ def package(self, code_path, destination_path, make_jobs, cmake_defines, stderr=
'--rm',
'-v',
'{}:/code'.format(os.path.abspath(code_path)),
'-e',
'MAKE_OPTS=-j{}'.format(make_jobs),
]
if make_jobs:
cmdline.extend(['-e', 'MAKE_OPTS=-j{}'.format(make_jobs)])

if destination_path:
cmdline.extend([
'-v',
'{}:/dest'.format(os.path.abspath(destination_path)),
])
cmdline.extend(['-v', '{}:/dest'.format(os.path.abspath(destination_path))])
if privileged:
cmdline.append('--privileged')
if build_directory:
Expand Down
5 changes: 3 additions & 2 deletions support/docker/files/entrypoint
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
#!/bin/bash

CMAKE_BIN="${CMAKE_BIN:-cmake}"
PACKAGE_COMMAND="${PACKAGE_COMMAND:-make package}"
PACKAGE_COMMAND="${PACKAGE_COMMAND:-ninja package}"

set -e
${CMAKE_BIN} \
-G Ninja \
-DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} \
"$@" \
/code
make ${MAKE_OPTS} && $PACKAGE_COMMAND
ninja ${MAKE_OPTS} && $PACKAGE_COMMAND

if [ -r package_name.cfg ]; then
. package_name.cfg
Expand Down
1 change: 1 addition & 0 deletions support/docker/snippets/debian.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ COPY qemu-arm-static /usr/bin
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y \
autoconf \
ninja-build \
qtbase5-dev \
qtdeclarative5-dev \
build-essential \
Expand Down
1 change: 1 addition & 0 deletions support/docker/snippets/fedora.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ RUN yum install -y \
autoconf \
automake \
make \
ninja-build \
qt5-qtbase-devel \
qt5-qtdeclarative-devel \
gcc-c++ \
Expand Down
1 change: 1 addition & 0 deletions support/docker/snippets/windows.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ RUN apt-get update && apt-get install -y \
cmake \
git \
wget \
ninja-build \
autopoint autoconf automake bash bison bzip2 flex \
libgdk-pixbuf2.0-dev gettext git gperf intltool make \
sed libffi-dev libtool p7zip-full patch lzip \
Expand Down