Fix drone and improve timeout
All checks were successful
continuous-integration/drone/push Build is passing

try fix deploy

Check

check2

test

Test 2

Fix drone

test

test2

test3

test4

test5

test6

test7

test8

test9

Handle poor ampli
This commit is contained in:
Nicolas Duhamel 2021-10-31 07:43:10 +01:00
parent 522cc7f1f9
commit e43f4befda
2 changed files with 16 additions and 6 deletions

View File

@ -6,19 +6,27 @@ steps:
- name: Build - name: Build
image: python image: python
commands: commands:
- echo $PASSWORD
- echo PASSWORD
- echo ${PASSWORD}
- apt-get update - apt-get update
- apt-get -y install python-systemd python3-systemd libsystemd-dev - apt-get -y install python3-systemd libsystemd-dev
- pip install pex - pip install pex
- pip install . - pip install .
- pex ./ -m yamaha2mqtt -o yamaha2mqtt.pex - pex ./ -m yamaha2mqtt -o yamaha2mqtt.pex
environment:
PASSWORD:
from_secret: ssh_key
- name: Deploy - name: Deploy
image: appleboy/drone-scp image: appleboy/drone-scp
settings: settings:
host: host:
- gavarni.jombi.fr - gavarni.jombi.fr
user: citadel user: citadel
key: # ssh-key:
from_secret: ssh_key # from_secret: ssh_key
password:
from_secret: ssh_password
port: 22 port: 22
command_timeout: 2m command_timeout: 2m
target: /home/citadel target: /home/citadel
@ -31,8 +39,10 @@ steps:
host: gavarni.jombi.fr host: gavarni.jombi.fr
username: citadel username: citadel
port: 22 port: 22
key: # key:
from_secret: ssh_key # from_secret: ssh_key
password:
from_secret: ssh_password
script: script:
- mv yamaha2mqtt.pex ./services/bin/yamaha2mqtt - mv yamaha2mqtt.pex ./services/bin/yamaha2mqtt
- systemctl --user restart citadel@yamaha2mqtt - systemctl --user restart citadel@yamaha2mqtt

View File

@ -41,7 +41,7 @@ class Yamaha:
for action in senario.deactivate: for action in senario.deactivate:
self.request(action) self.request(action)
@retry(stop=stop_after_attempt(3), wait=wait_fixed(1), reraise=True) @retry(stop=stop_after_attempt(3), wait=wait_fixed(2), reraise=True)
def request(self, request): def request(self, request):
try: try:
r = self._device.request(request) r = self._device.request(request)