2020-06-21 15:21:00 +02:00
|
|
|
os: linux
|
2020-06-20 14:41:50 +02:00
|
|
|
dist: bionic
|
2020-06-21 15:21:00 +02:00
|
|
|
language: python
|
2020-06-20 14:41:50 +02:00
|
|
|
|
|
|
|
services:
|
|
|
|
- docker
|
|
|
|
|
|
|
|
before_install:
|
|
|
|
- pip -q install -U docker-compose
|
|
|
|
|
2020-06-21 15:21:00 +02:00
|
|
|
_iot-simulator: &iot-simulator
|
2020-06-20 14:41:50 +02:00
|
|
|
stage: simulator
|
|
|
|
install:
|
|
|
|
- docker-compose -f docker/docker-compose.yml pull
|
|
|
|
- docker-compose -f docker/docker-compose.yml build
|
|
|
|
before_script:
|
|
|
|
- docker-compose -f docker/docker-compose.yml -f docker/edge/docker-compose.edge.yml up -d
|
2020-06-21 15:21:00 +02:00
|
|
|
- DOCKER_HOST='127.0.0.1:22375' docker-compose -f docker/edge/docker-compose.modules.yml pull
|
|
|
|
- DOCKER_HOST='127.0.0.1:22375' docker-compose -f docker/edge/docker-compose.modules.yml build
|
2020-06-20 14:41:50 +02:00
|
|
|
script:
|
|
|
|
- sleep 5 # warm-up
|
|
|
|
- sed -i 's/# IOT_SERIAL/IOT_SERIAL/g' docker/edge/docker-compose.modules.yml
|
|
|
|
- DOCKER_HOST='127.0.0.1:22375' docker-compose -f docker/edge/docker-compose.modules.yml up -d
|
|
|
|
- sleep 30 # collect some telemetry
|
|
|
|
- curl -sf http://localhost/telemetry/${IOT_TL}1234/last/
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
include:
|
|
|
|
- stage: build
|
|
|
|
before_script:
|
|
|
|
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
|
|
|
|
script:
|
|
|
|
- docker-compose -f docker/docker-compose.yml build
|
|
|
|
- docker push daniviga/bite
|
|
|
|
- docker push daniviga/ntpd
|
|
|
|
if: branch = master
|
|
|
|
- stage: django
|
|
|
|
install:
|
|
|
|
- docker-compose -f docker/docker-compose.yml pull
|
|
|
|
- docker-compose -f docker/docker-compose.yml build
|
|
|
|
before_script:
|
|
|
|
- docker-compose -f docker/docker-compose.yml up -d
|
|
|
|
script:
|
|
|
|
- docker-compose -f docker/docker-compose.yml exec bite python manage.py test
|
2020-06-26 19:27:47 +02:00
|
|
|
- stage: django
|
|
|
|
install:
|
|
|
|
- pip3 -q install flake8
|
|
|
|
script:
|
|
|
|
- flake8 bite --exclude migrations,settings.py
|
2020-06-21 15:21:00 +02:00
|
|
|
- <<: *iot-simulator
|
2020-06-20 14:41:50 +02:00
|
|
|
env: IOT_TL=http
|
2020-06-21 15:21:00 +02:00
|
|
|
- <<: *iot-simulator
|
2020-06-20 14:41:50 +02:00
|
|
|
env: IOT_TL=mqtt
|
2020-06-21 15:21:00 +02:00
|
|
|
- <<: *iot-simulator
|
|
|
|
env: IOT_TL=ws
|