From 7229840bed39351fbb9fad188484629db4faaca1 Mon Sep 17 00:00:00 2001 From: Anton Belodedenko <2033996+ab77@users.noreply.github.com> Date: Thu, 23 May 2024 12:36:26 -0700 Subject: [PATCH] add release asset test --- .github/workflows/tests.yml | 13 +++++ docker-compose.yml | 3 +- docs/getting-started.md | 7 +-- src/balena-tests/Dockerfile | 2 +- src/balena-tests/balena.sh | 105 ++++++++++++++++++++---------------- 5 files changed, 79 insertions(+), 51 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 94981aaaae..667efa473b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -242,6 +242,9 @@ jobs: with_backoff balena env add REGISTRY2_S3_REGION_ENDPOINT 's3.${{ env.SUBDOMAIN }}.${{ inputs.dns_tld }}' \ --device '${{ steps.register-test-device.outputs.balena_device_uuid }}' + with_backoff balena env add WEBRESOURCES_S3_HOST 's3.${{ env.SUBDOMAIN }}.${{ inputs.dns_tld }}' \ + --device '${{ steps.register-test-device.outputs.balena_device_uuid }}' + # https://github.com/balena-io/cert-manager/blob/master/entry.sh#L255-L278 # cert-manager will restore the last wildcard certificate from AWS/S3 to avoid # being rate limited by LetsEncrypt/ACME @@ -259,6 +262,16 @@ jobs: with_backoff balena env add ORG_UNIT openBalena \ --device '${{ steps.register-test-device.outputs.balena_device_uuid }}' + + # unstable/unsupported functionality + with_backoff balena env add HIDE_UNVERSIONED_ENDPOINT 'false' \ + --service api \ + --device '${{ steps.register-test-device.outputs.balena_device_uuid }}' + + with_backoff balena env add RELEASE_ASSETS_TEST 'true' \ + --service sut \ + --device '${{ steps.register-test-device.outputs.balena_device_uuid }}' + - name: configure test device secrets if: ${{ github.event_name == 'pull_request' && github.event.action != 'closed'}} run: | diff --git a/docker-compose.yml b/docker-compose.yml index 0071389906..b7396896d6 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -79,7 +79,7 @@ services: *with-default-privileges, *with-default-volumes, ] - image: balena/open-balena-api:v22.2.0 + image: balena/open-balena-api:v22.2.2 depends_on: - db - redis @@ -111,7 +111,6 @@ services: VPN_PORT: 443 WEBRESOURCES_S3_BUCKET: web-resources WEBRESOURCES_S3_REGION: "us-east-1" # this is required for minio - HIDE_UNVERSIONED_ENDPOINT: "false" # https://github.com/balena-io/open-balena-registry registry: diff --git a/docs/getting-started.md b/docs/getting-started.md index 4d5e68fd08..9cbf94f93a 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -186,8 +186,8 @@ Start-Service -Name Docker ### SSL Configuration -opeBalena server supports automatic SSL configuration via ACME protocol using **one** of -the following DNS providers: +opeBalena server now uses automatic SSL configuration via ACME [DNS-01] challenge. Support +for the following DNS providers is currently implemented: * Cloudflare * Gandi @@ -221,7 +221,7 @@ make verify openBalena server also supports custom/manual TLS configuration. You must supply your own SSL certificate, private key and a full certificate signing chain. A wildcard SSL -certificate covering the while domain is recommended. +certificate covering the whole domain is recommended. 1. After obtaining your certificate, run the following commands on openBalena server: @@ -476,3 +476,4 @@ Enjoy Balenafying All the Things! [Docker Engine]: https://docs.docker.com/engine/install [Change cgroup version]: https://docs.docker.com/config/containers/runmetrics/#changing-cgroup-version [composition]: https://github.com/balena-io/open-balena/blob/master/docker-compose.yml +[DNS-01]: https://letsencrypt.org/docs/challenge-types/#dns-01-challenge diff --git a/src/balena-tests/Dockerfile b/src/balena-tests/Dockerfile index 84bf60e2da..c1308ac082 100644 --- a/src/balena-tests/Dockerfile +++ b/src/balena-tests/Dockerfile @@ -1,7 +1,7 @@ FROM ubuntu:22.04 # renovate: datasource=github-releases depName=balena-io/balena-cli -ARG BALENA_CLI_VERSION=v18.2.0 +ARG BALENA_CLI_VERSION=v18.2.2 RUN apt-get update && apt-get install -y --no-install-recommends \ bash \ diff --git a/src/balena-tests/balena.sh b/src/balena-tests/balena.sh index 29feffefaf..815a4c06ed 100755 --- a/src/balena-tests/balena.sh +++ b/src/balena-tests/balena.sh @@ -3,7 +3,13 @@ # shellcheck disable=SC2154,SC2034,SC1090 set -ae -[[ $VERBOSE =~ on|On|Yes|yes|true|True ]] && set -x +curl_opts="--retry 3 --fail" +if [[ $VERBOSE =~ on|On|Yes|yes|true|True ]]; then + set -x + curl_opts="${curl_opts} --verbose" +else + curl_opts="${curl_opts} --silent" +fi source /usr/sbin/functions @@ -20,6 +26,7 @@ function remove_update_lock() { } function cleanup() { + shutdown_dut remove_test_assets remove_update_lock @@ -28,14 +35,22 @@ function cleanup() { } trap 'cleanup' EXIT +function shutdown_dut() { + local balena_device_uuid + balena_device_uuid="$(cat