Commit 6ba9d00c authored by Reto Da Forno's avatar Reto Da Forno

runner config updated

parent b5b3da35
......@@ -16,18 +16,19 @@ deploy to devserver:
variables:
DEV_SERVER: 'flocklab@flocklab-dev-server.ethz.ch'
DEV_SERVER2: 'flocklab@flocklab-dev-server2.ethz.ch'
RSYNC_OPTIONS: '-av --no-perms --no-owner --no-group --delete -e "ssh -q -o StrictHostKeyChecking=no"'
SSH_OPTIONS: 'ssh -q -o StrictHostKeyChecking=no'
RSYNC_OPTIONS: '-av --no-perms --no-owner --no-group --delete --exclude=*.ini --exclude=*.conf'
script:
- apk update >/dev/null && apk add rsync openssh-client >/dev/null
- eval $(ssh-agent -s) && echo "$CI_SSH_PRIVATE_KEY" | ssh-add -
- echo "uploading files to ${DEV_SERVER}..."
- 'rsync $RSYNC_OPTIONS --exclude="*.ini" --exclude="*.conf" server/testmanagementserver/ ${DEV_SERVER}:testmanagementserver/'
- 'rsync $RSYNC_OPTIONS --exclude="*.ini" --exclude="*.conf" server/webserver/user/ ${DEV_SERVER}:webserver/'
- 'rsync $RSYNC_OPTIONS --exclude="*.ini" --exclude="*.conf" server/webserver/testmanagement/ ${DEV_SERVER}:testmanagement/'
- echo "uploading files to ${DEV_SERVER2}..."
- 'rsync $RSYNC_OPTIONS --exclude="*.ini" --exclude="*.conf" server/testmanagementserver/ ${DEV_SERVER2}:testmanagementserver/'
- 'rsync $RSYNC_OPTIONS --exclude="*.ini" --exclude="*.conf" server/webserver/user/ ${DEV_SERVER2}:webserver/'
- 'rsync $RSYNC_OPTIONS --exclude="*.ini" --exclude="*.conf" server/webserver/testmanagement/ ${DEV_SERVER2}:testmanagement/'
- 'apk update >/dev/null && apk add rsync openssh-client >/dev/null'
- 'eval $(ssh-agent -s) && echo "$CI_SSH_PRIVATE_KEY" | ssh-add -'
- 'echo "uploading files to ${DEV_SERVER}..."'
- 'rsync ${RSYNC_OPTIONS} -e "${SSH_OPTIONS}" server/testmanagementserver/ ${DEV_SERVER}:testmanagementserver/'
- 'rsync ${RSYNC_OPTIONS} -e "${SSH_OPTIONS}" server/webserver/user/ ${DEV_SERVER}:webserver/'
- 'rsync ${RSYNC_OPTIONS} -e "${SSH_OPTIONS}" server/webserver/testmanagement/ ${DEV_SERVER}:testmanagement/'
- 'echo "uploading files to ${DEV_SERVER2}..."'
- 'rsync ${RSYNC_OPTIONS} -e "${SSH_OPTIONS}" server/testmanagementserver/ ${DEV_SERVER2}:testmanagementserver/'
- 'rsync ${RSYNC_OPTIONS} -e "${SSH_OPTIONS}" server/webserver/user/ ${DEV_SERVER2}:webserver/'
- 'rsync ${RSYNC_OPTIONS} -e "${SSH_OPTIONS}" server/webserver/testmanagement/ ${DEV_SERVER2}:testmanagement/'
only:
refs:
- python3
......@@ -41,14 +42,15 @@ deploy to production:
stage: deploy
variables:
PRODUCTION_SERVER: 'flocklab@whymper.ethz.ch'
RSYNC_OPTIONS: '-av --no-perms --no-owner --no-group --delete -e "ssh -q -o StrictHostKeyChecking=no"'
SSH_OPTIONS: 'ssh -q -o StrictHostKeyChecking=no'
RSYNC_OPTIONS: '-av --no-perms --no-owner --no-group --delete --exclude=*.ini --exclude=*.conf'
script:
- apk update >/dev/null && apk add rsync openssh-client >/dev/null
- eval $(ssh-agent -s) && echo "$CI_SSH_PRIVATE_KEY" | ssh-add -
- echo "uploading files to ${PRODUCTION_SERVER}..."
- 'rsync $RSYNC_OPTIONS --exclude="*.ini" --exclude="*.conf" server/testmanagementserver/ ${PRODUCTION_SERVER}:flocklab_bin/testmanagementserver/'
- 'rsync $RSYNC_OPTIONS --exclude="*.ini" --exclude="*.conf" server/webserver/user/ ${PRODUCTION_SERVER}:public_html/user/'
- 'rsync $RSYNC_OPTIONS --exclude="*.ini" --exclude="*.conf" server/webserver/testmanagement/ ${PRODUCTION_SERVER}:testmanagement/'
- 'apk update >/dev/null && apk add rsync openssh-client >/dev/null'
- 'eval $(ssh-agent -s) && echo "$CI_SSH_PRIVATE_KEY" | ssh-add -'
- 'echo "uploading files to ${PRODUCTION_SERVER}..."'
- 'rsync ${RSYNC_OPTIONS} -e "${SSH_OPTIONS}" server/testmanagementserver/ ${PRODUCTION_SERVER}:flocklab_bin/testmanagementserver/'
- 'rsync ${RSYNC_OPTIONS} -e "${SSH_OPTIONS}" server/webserver/user/ ${PRODUCTION_SERVER}:public_html/user/'
- 'rsync ${RSYNC_OPTIONS} -e "${SSH_OPTIONS}" server/webserver/testmanagement/ ${PRODUCTION_SERVER}:testmanagement/'
only:
refs:
- master
......@@ -66,21 +68,21 @@ run flocklab test:
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 )
- '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
- '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
only:
......
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