Skip to content

Commit b0da193

Browse files
committed
SQ
1 parent 6874547 commit b0da193

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

automation/include/balena-docker.inc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,8 @@ balena_docker_create_compose_file() {
271271
fi
272272
if [ -n "${_local_image}" ]; then
273273
_image_id=$(balena_docker_image_retrieve "${_local_image}")
274-
_block_image="${_image_id}"
274+
docker tag "${_image_id}" "${_block}:${_version}"
275+
_block_image="${_block}:${_version}"
275276
else
276277
_block_image=$(balena_api_fetch_image_from_app "${_block}" "${_version}" "${_apiEnv}")
277278
if [ -z "${_block_image}" ] || [ "${_block_image}" = "" ]; then

automation/include/balena-lib.inc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -465,13 +465,14 @@ balena_lib_release() {
465465
local _releaseID=""
466466
local _status=""
467467
local _debug=""
468+
local _version
468469

469470
[ -z "${_appName}" ] && >&2 echo "balena_lib_release: Application name is required" && exit 1
470471
_apiEnv=${_apiEnv:-"$(balena_lib_environment)"}
471472
_path=${_path:-"$(pwd)"}
473+
_version=$(balena_lib_get_os_version)
472474
if [ -f "${_path}/balena.yml" ]; then
473475
_contract_version=$(awk '/version:/ {print $2}' "${_path}/balena.yml")
474-
_version=$(balena_lib_get_os_version)
475476
if [ "${_contract_version}" != "${_version}" ]; then
476477
>&2 echo "balena_lib_release: Version mismatch, contract ${_contract_version} os ${_version}"
477478
return 1
@@ -489,7 +490,7 @@ balena_lib_release() {
489490
if [ -n "${_image_id}" ]; then
490491
_releaseID=$(BALENARC_BALENA_URL="${_apiEnv}" balena deploy "${_appName}" "${_image_id}" --source "${_path}" ${_status} ${_debug} | sed -n 's/.*Release: //p')
491492
else
492-
_releaseID=$(BALENARC_BALENA_URL="${_apiEnv}" balena deploy "${_appName}" --build --source "${_path}" ${_status} ${_debug} | sed -n 's/.*Release: //p')
493+
_releaseID=$(BALENARC_BALENA_URL="${_apiEnv}" balena deploy "${_appName}" --build --source "${_path}" --cache-from ${_appName#*/}:${_version} ${_status} ${_debug} | sed -n 's/.*Release: //p')
493494
fi
494495
[ -n "${_releaseID}" ] && >&2 echo "Deployed ${_image_id} to ${_appName} as ${_status##--} at ${_releaseID}"
495496
echo "${_releaseID}"

0 commit comments

Comments
 (0)