Skip to content
Snippets Groups Projects
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
.gitlab-ci.yml 2.11 KiB
# Gitlab waits until all jobs for a stage are completed before moving to next
# stage, so using stages for Windows/Linux builds would wait until the other is
# finished before continuing.
#
# Perhaps relevant in future https://gitlab.com/gitlab-org/gitlab-ce/issues/47063

stages:
 - all
# - build
# - test
 - deploy

#cache:
#  paths:
#    - build/

linux:
  stage: all
  tags:
    - linux
#  before_script:
#    - export DEBIAN_FRONTEND=noninteractive
#    - apt-get update -qq && apt-get install -y -qq g++ cmake git
#    - apt-get install -y -qq libopencv-dev libgoogle-glog-dev liburiparser-dev libreadline-dev libmsgpack-dev uuid-dev libpcl-dev
  script:
    - mkdir build
    - cd build
    - cmake .. -DWITH_OPTFLOW=TRUE -DBUILD_CALIBRATION=TRUE -DCMAKE_BUILD_TYPE=Release
    - make
    - ctest --output-on-failure

webserver-deploy:
  only:
    - master
  stage: deploy
  tags:
    - linux
  variables:
    NODE_SERVER: '10.0.0.9'
  script:
    - npm install web-service/server
    - browserify web-service/public/js/index.js -o web-service/public/js/bundle.js
    - rsync -vr --delete web-service/ nodejs@${NODE_SERVER}:/srv/nodejs/web-service
    - ssh nodejs@${NODE_SERVER} -- "npm install web-service/server && pm2 restart web-service"

windows:
  stage: all
  variables:
    CMAKE_ARGS: '-DWITH_OPTFLOW=TRUE -DWITH_PCL=FALSE -DCMAKE_GENERATOR_PLATFORM=x64 -DNVPIPE_DIR="D:/Build/NvPipe" -DEigen3_DIR="C:/Program Files (x86)/Eigen3/share/eigen3/cmake" -DOpenCV_DIR="D:/Build/opencv-4.1.1" -DCUDA_TOOLKIT_ROOT_DIR="C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.1"'
    DEPLOY_DIR: 'D:/Shared/AutoDeploy'
  tags:
    - win
  script:
    - 'call "C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Auxiliary/Build/vcvars64.bat"'
    - mkdir build
    - cd build
    - cmake %CMAKE_ARGS% ..
    - devenv ftl.utu.fi.sln /build Release
    - rmdir /q /s "%DEPLOY_DIR%/%CI_COMMIT_REF_SLUG%"
    - mkdir "%DEPLOY_DIR%/%CI_COMMIT_REF_SLUG%"
    - 'copy "applications\vision\Release\ftl-vision.exe" "%DEPLOY_DIR%\%CI_COMMIT_REF_SLUG%"'
    - 'copy "applications\calibration\Release\ftl-calibrate.exe" "%DEPLOY_DIR%\%CI_COMMIT_REF_SLUG%"'