Commit 4a99a433 authored by Rob Connolly's avatar Rob Connolly

Separate out HASS restart into it's own CI job.

parent 22c57735
......@@ -3,6 +3,8 @@ stages:
- preflight
- homeassistant
- deploy
- docker-deploy
- postflight
variables:
GIT_SUBMODULE_STRATEGY: recursive
......@@ -130,12 +132,11 @@ deploy:
environment:
name: home-assistant
before_script:
- apk --no-cache add curl openssh-client
- apk --no-cache add openssh-client
- echo "$DEPLOYMENT_SSH_KEY" > id_rsa
- chmod 600 id_rsa
script:
- ssh -i id_rsa -o "StrictHostKeyChecking=no" $DEPLOYMENT_SSH_LOGIN "cd /mnt/docker-data/home-assistant && git fetch && git checkout $CI_COMMIT_SHA && git submodule sync --recursive && git submodule update --init --recursive"
- "curl -X POST -H \"Authorization: Bearer $DEPLOYMENT_HASS_TOKEN\" -H \"Content-Type: application/json\" $DEPLOYMENT_HASS_URL/api/services/homeassistant/restart"
after_script:
- rm id_rsa
only:
......@@ -143,3 +144,20 @@ deploy:
- master
tags:
- hass
restart-hass:
stage: postflight
image:
name: alpine:latest
entrypoint: [""]
environment:
name: home-assistant
before_script:
- apk --no-cache add curl
script:
- "curl -X POST -H \"Authorization: Bearer $DEPLOYMENT_HASS_TOKEN\" -H \"Content-Type: application/json\" $DEPLOYMENT_HASS_URL/api/services/homeassistant/restart"
only:
refs:
- master
tags:
- hass
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment