Skip to content

Commit

Permalink
SQ balena-lib balena_lib_release add DEBUG
Browse files Browse the repository at this point in the history
  • Loading branch information
alexgg committed Oct 28, 2021
1 parent 7796ef2 commit c51b604
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions automation/include/balena-lib.inc
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,7 @@ balena_lib_release() {
local _image_id="${5}"
local _releaseID=""
local _status=""
local _debug=""

[ -z "${_appName}" ] && >&2 echo "balena_lib_release: Application name is required" && exit 1
_apiEnv=${_apiEnv:-"$(balena_lib_environment)"}
Expand All @@ -457,12 +458,13 @@ balena_lib_release() {
if [ "${_final}" = "no" ]; then
_status="--draft"
fi
[ "${VERBOSE}" = "verbose" ] && _debug="--debug"

balena_lib_login "${_apiEnv}"
if [ -n "${_image_id}" ]; then
_releaseID=$(BALENARC_BALENA_URL="${_apiEnv}" balena deploy "${_appName}" "${_image_id}" --source "${_path}" ${_status} | sed -n 's/.*Release: //p')
_releaseID=$(BALENARC_BALENA_URL="${_apiEnv}" balena deploy "${_appName}" "${_image_id}" --source "${_path}" ${_status} ${_debug} | sed -n 's/.*Release: //p')
else
_releaseID=$(BALENARC_BALENA_URL="${_apiEnv}" balena deploy "${_appName}" --build --source "${_path}" ${_status} | sed -n 's/.*Release: //p')
_releaseID=$(BALENARC_BALENA_URL="${_apiEnv}" balena deploy "${_appName}" --build --source "${_path}" ${_status} ${_debug} | sed -n 's/.*Release: //p')
fi
[ -n "${_releaseID}" ] && >&2 echo "Deployed ${_image_id} to ${_appName} as ${_status##--} at ${_releaseID}"
echo "${_releaseID}"
Expand Down

0 comments on commit c51b604

Please sign in to comment.