Skip to content

Commit

Permalink
debug release asset
Browse files Browse the repository at this point in the history
  • Loading branch information
ab77 committed May 27, 2024
1 parent c24f2b4 commit c8cba45
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
1 change: 0 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,6 @@ services:
DOCKER_HOST: docker:2376
DOCKER_TLS_VERIFY: 'true'
GUEST_IMAGE: /balena/balena.img
RELEASE_ASSETS_TEST: "true"
volumes:
- builder-certs-client:/docker-pki/client
- certs-data:/certs
Expand Down
11 changes: 5 additions & 6 deletions src/balena-tests/balena.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# shellcheck disable=SC2154,SC2034,SC1090
set -ae

curl_opts="--retry ${ATTEMPTS} --fail"
curl_opts="--retry 3 --fail"
if [[ $VERBOSE =~ on|On|Yes|yes|true|True ]]; then
set -x
curl_opts="${curl_opts} -v"
Expand Down Expand Up @@ -264,13 +264,12 @@ function upload_release_asset() {
local release_id
release_id=${1:-1}

response="$(curl ${curl_opts} "https://api.${DNS_TLD}/resin/release_asset" \
curl ${curl_opts} "https://api.${DNS_TLD}/resin/release_asset" \
--header "Authorization: Bearer $(cat <~/.balena/token)" \
--form 'asset=@logo.png' \
--form "release=${release_id}" \
--form "asset_key=logo-$((RANDOM)).png")" && echo "${response}" | jq -re

echo "${response}" | jq -re .asset.href \
--form "asset_key=logo-$((RANDOM)).png" \
| jq -re .asset.href \
| xargs -sfivo "/tmp/logo-$((RANDOM)).png"
fi
}
Expand All @@ -287,7 +286,6 @@ else
TLD="${DNS_TLD}"
fi

ATTEMPTS=${ATTEMPTS:-3}
BALENA_API_URL=${BALENA_API_URL:-https://api.balena-cloud.com}
BALENARC_BALENA_URL="${DNS_TLD}"
CERTS=${CERTS:-/certs}
Expand All @@ -297,6 +295,7 @@ GUEST_DISK_SIZE=${GUEST_DISK_SIZE:-8}
GUEST_IMAGE=${GUEST_IMAGE:-/balena/balena.img}
OS_VERSION="$(get_os_version)"
TEST_FLEET=${TEST_FLEET:-test-fleet}
RELEASE_ASSETS_TEST=${RELEASE_ASSETS_TEST:-true}

[[ -f "$CONF" ]] && source "${CONF}"

Expand Down

0 comments on commit c8cba45

Please sign in to comment.