Browse Source

update-deploy

pull/21/head
fedy95 4 years ago
parent
commit
93c16c4c37
  1. 6
      .drone.yml
  2. 19
      LICENSE
  3. 12
      Makefile
  4. 7
      README.md
  5. 42
      docker-compose.yml

6
.drone.yml

@ -45,12 +45,16 @@ server:
from_secret: password
steps:
- name: release
- name: deploy
commands:
- cd /mnt/md0/infra/homeassistant
- git pull
- make restart
- make check
- name: cleanup
commands:
- cd /mnt/md0/infra/homeassistant
- make cleanup
trigger:
branch:

19
LICENSE

@ -0,0 +1,19 @@
MIT License Copyright (c) 2021 fedy95
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:
The above copyright notice and this permission notice (including the next
paragraph) shall be included in all copies or substantial portions of the
Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

12
Makefile

@ -26,13 +26,15 @@ lint-json:
docker pull ${REGISTRY}/${JSONLINT_TAG}
$(LINT-JSON-CMD) -qc etc/config/custom_components/circadian_lighting/manifest.json
restart: down start
start:
docker-compose -f docker-compose.yml up -d
down:
docker-compose -f docker-compose.yml down
restart:
docker-compose -f docker-compose.yml pull
docker-compose -f docker-compose.yml restart
check:
docker exec homeassistant_instance python -m homeassistant --script check_config --config /config
cleanup:
docker system prune --all --force
docker system prune --volumes --force
.DEFAULT_GOAL := lint

7
README.md

@ -1,9 +1,10 @@
### homeassistant
[![Build Status](https://drone.fedy95.com/api/badges/infra/homeassistant/status.svg)](https://drone.fedy95.com/infra/homeassistant)
### homeassistant [![Build Status](https://drone.fedy95.com/api/badges/infra/homeassistant/status.svg)](https://drone.fedy95.com/infra/homeassistant)
---
## services
- [docker hub](https://hub.docker.com/r/homeassistant/home-assistant)
- [docs](https://www.home-assistant.io/)
## example
## example
- https://github.com/arsaboo/homeassistant-config

42
docker-compose.yml

@ -2,30 +2,30 @@
version: "3"
services:
homeassistant_instance:
image: homeassistant/home-assistant:2021.2.3
container_name: homeassistant_instance
hostname: homeassistant_instance
restart: always
depends_on:
- homeassistant_db
homeassistant_instance:
image: homeassistant/home-assistant:2021.2.3
container_name: homeassistant_instance
hostname: homeassistant_instance
restart: always
depends_on:
- homeassistant_db
volumes:
- /etc/localtime:/etc/localtime:ro
- ./etc/config:/config
volumes:
- /etc/localtime:/etc/localtime:ro
- ./etc/config:/config
ports:
- "8123:8123"
homeassistant_db:
image: mariadb:10.5
container_name: homeassistant_db
ports:
- "8123:8123"
homeassistant_db:
image: mariadb:10.5
container_name: homeassistant_db
hostname: homeassistant_db
restart: unless-stopped
hostname: homeassistant_db
restart: unless-stopped
env_file:
- ./.env-homeassistant_db
env_file:
- ./.env-homeassistant_db
volumes:
- ./etc/homeassistant_db/data:/var/lib/mysql
volumes:
- ./etc/homeassistant_db/data:/var/lib/mysql
...