travis and docker improvements

This commit is contained in:
Paulchen-Panther 2019-02-17 18:56:04 +01:00
parent 7ff9d7037b
commit 1d0171a5f7
No known key found for this signature in database
GPG Key ID: A4D316C96D183815
5 changed files with 71 additions and 32 deletions

View File

@ -1,3 +1,11 @@
linux: &linux
os: linux
dist: trusty
services:
- docker
osx: &osx
os: osx
cache:
- ccache
- directories:
@ -5,27 +13,46 @@ cache:
notifications:
email: false
language: cpp
services:
- docker
matrix:
include:
- os: linux
dist: trusty
env:
- DOCKER_TAG=ubuntu1604
- DOCKER_NAME="Ubuntu 16.04"
- os: linux
dist: trusty
env:
- DOCKER_TAG=cross-qemu-rpistretch
- DOCKER_NAME="Raspberry Pi"
- os: osx
osx_image: xcode8.3
env:
- HOMEBREW_CACHE=$HOME/brew-cache
before_install:
- ./.travis/travis_install.sh
jobs:
include:
- <<: *linux
name: "AMD64 (x64)"
env:
- DOCKER_TAG=amd64
- DOCKER_NAME="Debian Stretch (AMD64)"
- <<: *linux
name: "i386 (x86)"
env:
- DOCKER_TAG=i386
- DOCKER_NAME="Debian Stretch (i386)"
- <<: *linux
name: "ARMv6hf (Raspberry Pi v1 & ZERO)"
env:
- DOCKER_TAG=armv6hf
- DOCKER_NAME=""Debian Stretch (Raspberry Pi v1 & ZERO)"
- <<: *linux
name: "ARMv7hf (Raspberry Pi 2 & 3)"
env:
- DOCKER_TAG=armv7hf
- DOCKER_NAME="Debian Stretch (Raspberry Pi 2 & 3)"
- <<: *linux
name: "ARMv8 (Generic AARCH64)"
env:
- DOCKER_TAG=aarch64
- DOCKER_NAME="ARMv8 (Generic AARCH64)"
- PLATFORM="amlogic"
- <<: *osx
osx_image: xcode8.3
name: "macOS 10.12 (Xcode 8.3.3)"
env:
- HOMEBREW_CACHE=$HOME/brew-cache
script:
- ./.travis/travis_build.sh
after_success:
- ./.travis/travis_deploy.sh

View File

@ -3,7 +3,9 @@
# for executing in non travis environment
[ -z "$TRAVIS_OS_NAME" ] && TRAVIS_OS_NAME="$(uname -s | tr '[:upper:]' '[:lower:]')"
PLATFORM=x86
if [ -z "${PLATFORM}" ]; then
PLATFORM=x86
fi
BUILD_TYPE=Debug
PACKAGES=""
@ -23,10 +25,11 @@ echo "compile jobs: ${JOBS:=4}"
[ -n "${TRAVIS_TAG:-}" ] && BUILD_TYPE=Release
# Determine package creation; True for cron and tag builds
# Commented because tests are currently broken
[ "${TRAVIS_EVENT_TYPE:-}" == 'cron' ] || [ -n "${TRAVIS_TAG:-}" ] && PACKAGES=package
# Determie -dev appends to platform;
[ "${TRAVIS_EVENT_TYPE:-}" != 'cron' -a -z "${TRAVIS_TAG:-}" ] && PLATFORM=${PLATFORM}-dev
# [ "${TRAVIS_EVENT_TYPE:-}" != 'cron' -a -z "${TRAVIS_TAG:-}" ] && PLATFORM=${PLATFORM}-dev
# Build the package on osx
if [[ "$TRAVIS_OS_NAME" == 'osx' || "$TRAVIS_OS_NAME" == 'darwin' ]]
@ -48,10 +51,10 @@ then
docker run --rm \
-v "${TRAVIS_BUILD_DIR}/deploy:/deploy" \
-v "${TRAVIS_BUILD_DIR}:/source:ro" \
hyperionorg/hyperion-ci:$DOCKER_TAG \
hyperionproject/hyperion-ci:$DOCKER_TAG \
/bin/bash -c "mkdir build && cp -r /source/. /build &&
cd /build && mkdir build && cd build &&
cmake -DCMAKE_BUILD_TYPE=${BUILD_TYPE} .. || exit 2 &&
cmake -DPLATFORM=${PLATFORM} -DCMAKE_BUILD_TYPE=${BUILD_TYPE} .. || exit 2 &&
make -j $(nproc) ${PACKAGES} || exit 3 &&
echo '---> Copy binaries and packages to host folder: ${TRAVIS_BUILD_DIR}/deploy' &&
cp -v /build/build/bin/h* /deploy/ 2>/dev/null || : &&

View File

@ -237,6 +237,7 @@ CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
if (CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-psabi")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-psabi")
endif()
if(COMPILER_SUPPORTS_CXX11)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")

View File

@ -1,13 +1,21 @@
# With Docker
If you are using [Docker](https://www.docker.com/), you can compile Hyperion inside a docker container. This keeps your system clean and with a simple script it's easy to use. Supported is also cross compilation for Raspberry Pi (Raspbian stretch)
If you are using [Docker](https://www.docker.com/), you can compile Hyperion inside a docker container. This keeps your system clean and with a simple script it's easy to use. Supported is also cross compilation for Raspberry Pi (Debian Stretch)
To compile Hyperion for Ubuntu 16.04 (x64) or higher just execute the following command
To compile Hyperion for Debain Stretch (x64 architecture) or higher just execute the following command
```
wget -qN https://raw.github.com/hyperion-project/hyperion.ng/master/bin/scripts/docker-compile.sh && chmod +x *.sh && ./docker-compile.sh
```
To compile Hyperion for Raspberry Pi
To compile Hyperion for i386 architecture
```
wget -qN https://raw.github.com/hyperion-project/hyperion.ng/master/bin/scripts/docker-compile.sh && chmod +x *.sh && ./docker-compile.sh -t cross-qemu-rpistretch
wget -qN https://raw.github.com/hyperion-project/hyperion.ng/master/bin/scripts/docker-compile.sh && chmod +x *.sh && ./docker-compile.sh -t i386
```
To compile Hyperion for Raspberry Pi v1 & ZERO
```
wget -qN https://raw.github.com/hyperion-project/hyperion.ng/master/bin/scripts/docker-compile.sh && chmod +x *.sh && ./docker-compile.sh -t armv6hf
```
To compile Hyperion for Raspberry Pi 2 & 3
```
wget -qN https://raw.github.com/hyperion-project/hyperion.ng/master/bin/scripts/docker-compile.sh && chmod +x *.sh && ./docker-compile.sh -t armv7hf
```
The compiled binaries and packages will be available at the deploy folder next to the script
Note: call the script with `./docker-compile.sh -h` for more options

View File

@ -5,8 +5,8 @@ DOCKER="docker"
GIT_REPO_URL="https://github.com/hyperion-project/hyperion.ng.git"
# cmake build type
BUILD_TYPE="Release"
# the image tag at hyperionorg/hyperion-ci
BUILD_TARGET="ubuntu1604"
# the image tag at hyperionproject/hyperion-ci
BUILD_TARGET="amd64"
# build packages (.deb .zip ...)
BUILD_PACKAGES=true
# packages string inserted to cmake cmd
@ -42,8 +42,8 @@ function printHelp {
echo "########################################################
## A script to compile Hyperion inside a docker container
## Requires installed Docker: https://www.docker.com/
## Without arguments it will compile Hyperion for Ubuntu 16.04 (x64) or higher.
## Supports Raspberry Pi (armv6) cross compilation (Raspbian Stretch)
## Without arguments it will compile Hyperion for Debain Stretch (x64) or higher.
## Supports Raspberry Pi (armv6hf, armv7hf) cross compilation (Debian Stretch)
##
## Homepage: https://www.hyperion-project.org
## Forum: https://forum.hyperion-project.org
@ -51,10 +51,10 @@ echo "########################################################
# These are possible arguments to modify the script behaviour with their default values
#
# docker-compile.sh -h # Show this help message
# docker-compile.sh -t ubuntu1604 # The docker tag, one of ubuntu1604 | cross-qemu-rpistretch
# docker-compile.sh -t amd64 # The docker tag, one of amd64 | i386 | armv6hf | armv7hf
# docker-compile.sh -b Release # cmake Release or Debug build
# docker-compile.sh -p true # If true build packages with CPack
# More informations to docker tags at: https://hub.docker.com/r/hyperionorg/hyperion-ci/"
# More informations to docker tags at: https://hub.docker.com/r/hyperionproject/hyperion-ci/"
}
while getopts t:b:p:h option