From 68d60d8aaadf17a06c66bf4f8f1f3261a0e93ccb Mon Sep 17 00:00:00 2001 From: Felipe Lalanne Date: Wed, 29 Sep 2021 12:50:48 -0300 Subject: [PATCH] Add supervisor docker-compose This will allow the supervisor service to be correctly named on the API Change-type: patch --- balena.yml | 2 +- circle.yml | 6 +++--- docker-compose.yml | 16 ++++++++++++++++ 3 files changed, 20 insertions(+), 4 deletions(-) create mode 100644 docker-compose.yml diff --git a/balena.yml b/balena.yml index 6b8045f8..416763dc 100644 --- a/balena.yml +++ b/balena.yml @@ -1,5 +1,5 @@ name: balena-supervisor -description: 'Balena Supervisor: balena''s agent on devices.' +description: "Balena Supervisor: balena's agent on devices." joinable: false type: sw.application version: 12.10.14 diff --git a/circle.yml b/circle.yml index b894af09..db8a14bb 100644 --- a/circle.yml +++ b/circle.yml @@ -71,10 +71,10 @@ defaults: &defaults export TAG=$(echo ${CIRCLE_BRANCH} | sed 's/[^a-z0-9A-Z_.-]/-/g') export ARCH=${ARCH} export PROJECT_NAME=${ARCH}-supervisor - export SERVICE_NAME=main + export SERVICE_NAME=balena-supervisor # start the build for this architecture bash automation/build.sh - if [ "${CIRCLE_BRANCH}" = "master" ] && [ "${AUTHOR}" = "balena-ci"] && [ "${COMMITTER}" = "versionbot@balena.io" ] && [ "${DEPLOY_TO_STAGING}" = "true" ]; then + if [ "${CIRCLE_BRANCH}" = "master" ] && [ "${AUTHOR}" = "balena-ci" ] && [ "${COMMITTER}" = "versionbot@balena.io" ] && [ "${DEPLOY_TO_STAGING}" = "true" ]; then echo "Deploying to balena API (staging)" BALENARC_BALENA_URL=$STAGING_API_ENDPOINT balena login --token $STAGING_API_TOKEN # Create a draft release first in case the second step fails @@ -90,7 +90,7 @@ defaults: &defaults # Cleanup credentials just in case rm ~/.balena/token fi - if [ "${CIRCLE_BRANCH}" = "master" ] && [ "${AUTHOR}" = "balena-ci"] && [ "${COMMITTER}" = "versionbot@balena.io" ] && [ "${DEPLOY_TO_PRODUCTION}" = "true" ]; then + if [ "${CIRCLE_BRANCH}" = "master" ] && [ "${AUTHOR}" = "balena-ci" ] && [ "${COMMITTER}" = "versionbot@balena.io" ] && [ "${DEPLOY_TO_PRODUCTION}" = "true" ]; then echo "Deploying to balena API (production)" BALENARC_BALENA_URL=$PRODUCTION_API_ENDPOINT balena login --token $PRODUCTION_API_TOKEN # Create a draft release first in case the second step fails diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000..e89ac741 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,16 @@ +version: '2.1' + +services: + # This service can only be named `main` or `balena-supervisor` as older + # devices will keep relying on the `/v6/supervisor_release` endpoint that + # identifies the supervisor image by that service name. + balena-supervisor: + build: ./ + privileged: true + tty: true + restart: always + network_mode: host + labels: + io.balena.features.balena-api: '1' + io.balena.features.dbus: '1' + io.balena.features.balena-socket: '1'