Add deployment to GitLab CI

This commit is contained in:
Correl Roush 2018-06-08 17:35:13 -04:00
parent 8459873d42
commit 5d28404620
2 changed files with 18 additions and 8 deletions

View File

@ -1,12 +1,22 @@
image: alpine:latest
stages:
- test
- deploy
before_script:
- apk update
- apk add python3
- pip3 install homeassistant==$(cat .HA_VERSION)
test:config:
test:
stage: test
image: alpine:latest
before_script:
- apk update
- apk add python3
- pip3 install homeassistant==$(cat .HA_VERSION)
script:
- cp secrets.example.yaml secrets.yaml
- touch zones.yaml
- hass -c . --script check_config --files
deploy:
stage: deploy
tags:
- home
- shell
script:
- make upgrade

View File

@ -25,5 +25,5 @@ destroy:
docker rm -f $(CONTAINER)
pull:
docker pull $(IMAGE):$(HA_VERSION)
deploy: test destroy run
deploy: destroy run
upgrade: pull deploy