This repository has been archived on 2023-08-29. You can view files and clone it, but cannot push or open issues or pull requests.
automation/.drone.yml
Dreaded_X ad5b8f9d29
All checks were successful
continuous-integration/drone/push Build is passing
Fixed network setup for docker deploy
2022-11-15 01:10:52 +01:00

57 lines
1.5 KiB
YAML

kind: pipeline
type: docker
name: default
steps:
- name: build
image: docker
volumes:
- name: socket
path: /var/run/docker.sock
commands:
- docker build -t automation .
- name: deploy
image: docker
volumes:
- name: socket
path: /var/run/docker.sock
environment:
MQTT_HOST:
from_secret: MQTT_HOST
MQTT_PORT:
from_secret: MQTT_PORT
MQTT_USER:
from_secret: MQTT_USER
MQTT_PASS:
from_secret: MQTT_PASS
HUE_IP:
from_secret: HUE_IP
HUE_BRIDGE:
from_secret: HUE_BRIDGE
NTFY_TOPIC:
from_secret: NTFY_TOPIC
GOOGLE_CREDENTIALS:
from_secret: GOOGLE_CREDENTIALS
commands:
- docker stop automation || true
- docker rm automation || true
- docker create -e MQTT_HOST=$MQTT_HOST -e MQTT_PORT=$MQTT_PORT -e MQTT_USER=$MQTT_USER -e MQTT_PASS=$MQTT_PASS -e MQTT_CLIENT_ID=$MQTT_CLIENT_ID -e HUE_IP=$HUE_IP -e HUE_BRIDGE=$HUE_BRIDGE -e NTFY_TOPIC=$NTFY_TOPIC -e GOOGLE_CREDENTIALS=$GOOGLE_CREDENTIALS --network mqtt --name automation automation
- docker network connect mqtt automation
- docker network connect web automation
- docker start automation
when:
branch:
- master
event:
exclude:
- pull_request
volumes:
- name: socket
host:
path: /var/run/docker.sock