automation_rs/.drone.yml
Dreaded_X aa8963bd4a
All checks were successful
continuous-integration/drone/push Build is passing
Directly send wol packet instead of using the webhook
2023-01-19 22:19:26 +01:00

50 lines
1.6 KiB
YAML

kind: pipeline
type: docker
name: default
steps:
- name: build
image: docker
volumes:
- name: socket
path: /var/run/docker.sock
commands:
- DOCKER_BUILDKIT=1 docker build -t automation_rs .
- name: deploy
image: docker
volumes:
- name: socket
path: /var/run/docker.sock
environment:
MQTT_PASSWORD:
from_secret: MQTT_PASSWORD
HUE_TOKEN:
from_secret: HUE_TOKEN
NTFY_TOPIC:
from_secret: NTFY_TOPIC
RUST_LOG:
from_secret: RUST_LOG
commands:
- docker stop automation_rs || true
- docker rm automation_rs || true
# Networks need to be setup to to allow broadcasts: https://www.devwithimagination.com/2020/06/15/homebridge-docker-and-wake-on-lan/ https://github.com/dhutchison/container-images/blob/0c2d7d96bab751fb0a008cc91ba2990724bbd11f/homebridge/configure_docker_networks_for_wol.sh
# Needs to be done for ALL networks, because we can't seem to control which interface gets used to send the broadcast
- docker create -e RUST_LOG=$RUST_LOG -e MQTT_PASSWORD=$MQTT_PASSWORD -e HUE_TOKEN=$HUE_TOKEN -e NTFY_TOPIC=$NTFY_TOPIC --network mqtt --restart unless-stopped --name automation_rs automation_rs
- docker network connect web automation_rs
- docker start automation_rs
when:
branch:
- master
event:
exclude:
- pull_request
volumes:
- name: socket
host:
path: /var/run/docker.sock