Commit 3f8a8355 authored by Reto Da Forno's avatar Reto Da Forno

runner config updated

parent 7bf82f1d
......@@ -7,14 +7,24 @@
#
# note: do not use the following keywords for job names: image, services, stages, types, before_script, after_script, variables, cache
deploy to devserver2:
stages:
- deploy
- test
deploy to devserver:
stage: deploy
variables:
DEV_SERVER: "flocklab@flocklab-dev-server.ethz.ch"
DEV_SERVER2: "flocklab@flocklab-dev-server2.ethz.ch"
script:
- apk update >/dev/null && apk add rsync openssh-client >/dev/null
- eval $(ssh-agent -s) && echo "$CI_SSH_PRIVATE_KEY" | ssh-add -
- 'rsync -av --no-perms --no-owner --no-group --delete -e "ssh -o StrictHostKeyChecking=no" --exclude="*.ini" --exclude="*.conf" server/testmanagementserver/ flocklab@flocklab-dev-server2.ethz.ch:testmanagementserver/'
- 'rsync -av --no-perms --no-owner --no-group --delete -e "ssh -o StrictHostKeyChecking=no" --exclude="*.ini" --exclude="*.conf" server/webserver/user/ flocklab@flocklab-dev-server2.ethz.ch:webserver/'
- 'rsync -av --no-perms --no-owner --no-group --delete -e "ssh -o StrictHostKeyChecking=no" --exclude="*.ini" --exclude="*.conf" server/webserver/testmanagement/ flocklab@flocklab-dev-server2.ethz.ch:testmanagement/'
- 'rsync -av --no-perms --no-owner --no-group --delete -e "ssh -o StrictHostKeyChecking=no" --exclude="*.ini" --exclude="*.conf" server/testmanagementserver/ ${DEV_SERVER}:testmanagementserver/'
- 'rsync -av --no-perms --no-owner --no-group --delete -e "ssh -o StrictHostKeyChecking=no" --exclude="*.ini" --exclude="*.conf" server/webserver/user/ ${DEV_SERVER}:webserver/'
- 'rsync -av --no-perms --no-owner --no-group --delete -e "ssh -o StrictHostKeyChecking=no" --exclude="*.ini" --exclude="*.conf" server/webserver/testmanagement/ ${DEV_SERVER}:testmanagement/'
- 'rsync -av --no-perms --no-owner --no-group --delete -e "ssh -o StrictHostKeyChecking=no" --exclude="*.ini" --exclude="*.conf" server/testmanagementserver/ ${DEV_SERVER2}:testmanagementserver/'
- 'rsync -av --no-perms --no-owner --no-group --delete -e "ssh -o StrictHostKeyChecking=no" --exclude="*.ini" --exclude="*.conf" server/webserver/user/ ${DEV_SERVER2}:webserver/'
- 'rsync -av --no-perms --no-owner --no-group --delete -e "ssh -o StrictHostKeyChecking=no" --exclude="*.ini" --exclude="*.conf" server/webserver/testmanagement/ ${DEV_SERVER2}:testmanagement/'
only:
refs:
- python3
......@@ -22,3 +32,51 @@ deploy to devserver2:
- server/testmanagementserver/**/*
- server/webserver/testmanagement/**/*
- server/webserver/user/**/*
deploy to production:
stage: deploy
variables:
PRODUCTION_SERVER: "flocklab@whymper.ethz.ch"
script:
- apk update >/dev/null && apk add rsync openssh-client >/dev/null
- eval $(ssh-agent -s) && echo "$CI_SSH_PRIVATE_KEY" | ssh-add -
- 'rsync -av --no-perms --no-owner --no-group --delete -e "ssh -o StrictHostKeyChecking=no" --exclude="*.ini" --exclude="*.conf" server/testmanagementserver/ ${PRODUCTION_SERVER}:testmanagementserver/'
- 'rsync -av --no-perms --no-owner --no-group --delete -e "ssh -o StrictHostKeyChecking=no" --exclude="*.ini" --exclude="*.conf" server/webserver/user/ ${PRODUCTION_SERVER}:webserver/'
- 'rsync -av --no-perms --no-owner --no-group --delete -e "ssh -o StrictHostKeyChecking=no" --exclude="*.ini" --exclude="*.conf" server/webserver/testmanagement/ ${PRODUCTION_SERVER}:testmanagement/'
only:
refs:
- master
changes:
- server/testmanagementserver/**/*
- server/webserver/testmanagement/**/*
- server/webserver/user/**/*
when: manual
run flocklab test:
stage: test
variables:
FLOCKLAB_TOOL: "tools/flocklab"
TEST_RUNTIME: 120
TEST_CLEANUP: 180
script:
- apk update >/dev/null && apk add bash curl tar sed
- export USER=$CI_FLOCKLAB_USER
- export PASSWORD=$CI_FLOCKLAB_PW
- RES=$( $FLOCKLAB_TOOL -c flocklab-dpp.xml )
- 'TESTID=$( echo $RES | sed -n "s/.*Test ID: \([0-9][0-9]*\).*/\1/p" )'
- 'STARTTIME=$( echo $RES | sed -n "s/.*(\([0-9][0-9]*\))/\1/p" )'
- NOW=$( date +%s )
- DIFF=$((STARTTIME + TEST_RUNTIME + TEST_CLEANUP - NOW))
- if [ $DIFF -lt 0 ]; then exit 1; fi
- echo "wait ${DIFF}s until test has finished..."
- sleep $DIFF
- echo "fetching data for test ${TESTID}..."
- $FLOCKLAB_TOOL -g $TESTID
- FILESIZE=$( stat -c "%s" /tmp/$TESTID/serial.csv )
- if [ $FILESIZE -lt 100 ]; then exit 1; fi
dependencies:
- deploy to production
when: manual
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment