From edb4a7e20a854e3f12554c62a39b649559943faf Mon Sep 17 00:00:00 2001 From: David Piggott Date: Sun, 11 Aug 2024 17:53:49 +0100 Subject: [PATCH] Run one container per bridge --- .github/workflows/cd.yml | 20 ++++++++++++++------ .github/workflows/ci.yml | 6 ++++-- docker-compose.yml | 19 ++++++++++++++----- 3 files changed, 32 insertions(+), 13 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 51fc3df..b7bb98d 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -25,11 +25,17 @@ on: SSH_USER: description: "SSH user" required: true - BRIDGE_API_KEY: - description: "Bridge API key" + BRIDGE_A_API_KEY: + description: "Bridge A API key" required: true - BRIDGE_IP_ADDRESS: - description: "Bridge IP address" + BRIDGE_A_IP_ADDRESS: + description: "Bridge A IP address" + required: true + BRIDGE_B_API_KEY: + description: "Bridge B API key" + required: true + BRIDGE_B_IP_ADDRESS: + description: "Bridge B IP address" required: true HOME_LATITUDE: description: "Latitude (for sunrise/sunset calculations)" @@ -81,8 +87,10 @@ jobs: - name: Bring up containers env: VERSION: ${{ inputs.version }} - BRIDGE_API_KEY: ${{ secrets.BRIDGE_API_KEY }} - BRIDGE_IP_ADDRESS: ${{ secrets.BRIDGE_IP_ADDRESS }} + BRIDGE_A_API_KEY: ${{ secrets.BRIDGE_A_API_KEY }} + BRIDGE_A_IP_ADDRESS: ${{ secrets.BRIDGE_A_IP_ADDRESS }} + BRIDGE_B_API_KEY: ${{ secrets.BRIDGE_B_API_KEY }} + BRIDGE_B_IP_ADDRESS: ${{ secrets.BRIDGE_B_IP_ADDRESS }} HOME_LATITUDE: ${{ secrets.HOME_LATITUDE }} HOME_LONGITUDE: ${{ secrets.HOME_LONGITUDE }} WAKE_TIME: ${{ secrets.WAKE_TIME }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 21b7e63..53ad5f8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -87,8 +87,10 @@ jobs: SSH_KNOWN_HOSTS: ${{ secrets.SSH_KNOWN_HOSTS }} HOST: ${{ secrets.HOST }} SSH_USER: ${{ secrets.SSH_USER }} - BRIDGE_API_KEY: ${{ secrets.BRIDGE_API_KEY }} - BRIDGE_IP_ADDRESS: ${{ secrets.BRIDGE_IP_ADDRESS }} + BRIDGE_A_API_KEY: ${{ secrets.BRIDGE_A_API_KEY }} + BRIDGE_A_IP_ADDRESS: ${{ secrets.BRIDGE_A_IP_ADDRESS }} + BRIDGE_B_API_KEY: ${{ secrets.BRIDGE_B_API_KEY }} + BRIDGE_B_IP_ADDRESS: ${{ secrets.BRIDGE_B_IP_ADDRESS }} HOME_LATITUDE: ${{ secrets.HOME_LATITUDE }} HOME_LONGITUDE: ${{ secrets.HOME_LONGITUDE }} WAKE_TIME: ${{ secrets.WAKE_TIME }} diff --git a/docker-compose.yml b/docker-compose.yml index 887c2e8..bcc2e4b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,12 +1,21 @@ -version: "3" - services: - helios: + helios-a: image: ghcr.io/dhpiggott/helios:${VERSION} restart: always environment: - - BRIDGE_API_KEY - - BRIDGE_IP_ADDRESS + - BRIDGE_A_API_KEY + - BRIDGE_A_IP_ADDRESS + - HOME_LATITUDE + - HOME_LONGITUDE + - WAKE_TIME + - SLEEP_TIME + - TIME_ZONE + helios-b: + image: ghcr.io/dhpiggott/helios:${VERSION} + restart: always + environment: + - BRIDGE_B_API_KEY + - BRIDGE_B_IP_ADDRESS - HOME_LATITUDE - HOME_LONGITUDE - WAKE_TIME