Private
Public Access
2
0
Files
mraa/docker-compose.yaml
Alex Tereschenko fc00fa20d2 static code analysis: introduce automated scans via SonarCloud
This adds Travis and Docker configurations for automated scans,
both for master branch and internal PRs.

External PRs won't be checked due to security concerns
(and Travis limitation related to that) - GH and SonarCloud tokens
are not propagated to those.

An organization and project must be created in SonarCloud for reporting,
as well as a technical GH user with mraa repo commit permission, to set
PR statuses in the "checks" section.

Signed-off-by: Alex Tereschenko <alext.mkrs@gmail.com>
2017-07-03 20:23:10 +02:00

107 lines
2.5 KiB
YAML

version: '2.1'
services:
main:
build:
context: .
dockerfile: Dockerfile
args:
- http_proxy
- https_proxy
- no_proxy
- BUILDDOC=${BUILDDOC:-OFF}
- BUILDSWIG=${BUILDSWIG:-OFF}
- BUILDSWIGPYTHON=${BUILDSWIGPYTHON:-OFF}
- BUILDSWIGJAVA=${BUILDSWIGJAVA:-OFF}
- BUILDSWIGNODE=${BUILDSWIGNODE:-OFF}
- USBPLAT=${USBPLAT:-OFF}
- FIRMATA=${FIRMATA:-OFF}
- ONEWIRE=${ONEWIRE:-OFF}
- JSONPLAT=${JSONPLAT:-OFF}
- IMRAA=${IMRAA:-OFF}
- FTDI4222=${FTDI4222:-OFF}
- IPK=${IPK:-OFF}
- RPM=${RPM:-OFF}
- ENABLEEXAMPLES=${ENABLEEXAMPLES:-ON}
- INSTALLGPIOTOOL=${INSTALLGPIOTOOL:-OFF}
- INSTALLTOOLS=${INSTALLTOOLS:-OFF}
- BUILDTESTS=${BUILDTESTS:-ON}
- CC=${CC:-clang-3.8}
- CXX=${CXX:-clang++-3.8}
- NODE_VERSION=${NODE_VERSION:-v4.4.7}
- BUILDARCH=${BUILDARCH}
- MRAA_SRC_DIR=${MRAA_SRC_DIR:-/usr/src/app}
environment:
- http_proxy
- https_proxy
- no_proxy
- MRAA_SRC_DIR=/usr/src/app
- SONAR_TOKEN
- SONAR_ORG
- SONAR_PROJ_KEY
- TRAVIS_BRANCH
- TRAVIS_PULL_REQUEST
- TRAVIS_REPO_SLUG
- TRAVIS_PULL_REQUEST_SLUG
- GITHUB_TOKEN
doc:
extends: main
build:
args:
- BUILDDOC=ON
command: bash -c "make doc"
python2:
extends: main
build:
args:
- BUILDSWIG=ON
- BUILDSWIGPYTHON=ON
command: bash -c "make _python2-mraa && ctest --output-on-failure"
python3:
extends: python2
build:
args:
- USEPYTHON3TESTS=ON
command: bash -c "make _python3-mraa && ctest --output-on-failure"
java:
extends: main
build:
args:
- BUILDSWIG=ON
- BUILDSWIGJAVA=ON
- CC=gcc-4.8
- CXX=g++-4.8
command: bash -c "make mraajava && ctest --output-on-failure"
node4:
extends: main
build:
args:
- BUILDSWIG=ON
- BUILDSWIGNODE=ON
- NODE_VERSION=v4.4.7
command: bash -c "source /root/.nvm/nvm.sh && make npmpkg && cd .. && node-gyp configure && node-gyp build && npm test"
node5:
extends: node4
build:
args:
- NODE_VERSION=v5.12.0
sonar-scan:
extends: main
build:
args:
- BUILDSWIG=ON
- BUILDSWIGPYTHON=ON
- BUILDSWIGNODE=ON
- BUILDSWIGJAVA=ON
- ONEWIRE=ON
- JSONPLAT=ON
command: bash -c "$${MRAA_SRC_DIR}/sonar-scan.sh"