diff --git a/.drone.yml b/.drone.yml index 26ef5b3..ebc605f 100644 --- a/.drone.yml +++ b/.drone.yml @@ -2,15 +2,21 @@ kind: pipeline name: default steps: - - name: test - image: serguzim/emgauwa-builder - pull: always - commands: - - mkdir build - - cd build - - cmake .. - - make test +- name: download + image: plugins/download + settings: + source: http://vmi366681.contaboserver.net:6423/archive/emgauwa-controller-testing/6/controller + destination: /drone/controller +- name: test + image: serguzim/emgauwa-builder + pull: always + commands: + - mkdir build + - cd build + - cmake .. + - export EMGAUWA_CONTROLLER_EXE=/drone/controller + - make test trigger: branch: - - dev + - dev diff --git a/tests/run_tests.sh b/tests/run_tests.sh index 3be3ea7..9d73549 100755 --- a/tests/run_tests.sh +++ b/tests/run_tests.sh @@ -15,25 +15,28 @@ cd $working_dir target_branch=$(git rev-parse --abbrev-ref HEAD) -git clone --quiet ssh://git@git.serguzim.me:3022/emgauwa/controller.git controller || exit -pushd ./controller > /dev/null +if [ -z "$EMGAUWA_CONTROLLER_EXE" ] +then + git clone --quiet ssh://git@git.serguzim.me:3022/emgauwa/controller.git controller || exit + cd ./controller -git checkout dev >/dev/null 2>&1 -git checkout $target_branch >/dev/null 2>&1 -git checkout $2 >/dev/null 2>&1 + git checkout dev >/dev/null 2>&1 + git checkout $target_branch >/dev/null 2>&1 + git checkout $2 >/dev/null 2>&1 -echo "Building controller on branch $(git rev-parse --abbrev-ref HEAD)" -mkdir build -cd build + echo "Building controller on branch $(git rev-parse --abbrev-ref HEAD)" + mkdir build + cd build -cmake -DWIRING_PI_DEBUG=on .. >/dev/null -cp $source_dir/controller.testing.ini ./controller.ini -make >/dev/null + cmake -DWIRING_PI_DEBUG=on .. >/dev/null + make >/dev/null + EMGAUWA_CONTROLLER_EXE=./controller +fi -./controller start >$working_dir/controller.log 2>&1 & +$EMGAUWA_CONTROLLER_EXE start -c $source_dir/controller.testing.ini >$working_dir/controller.log 2>&1 & controller_id=$! -popd > /dev/null +cd $working_dir cp $1 $working_dir/core cp $source_dir/core.testing.ini $working_dir/core.ini