Skip to content

Commit

Permalink
[REVIEW] Only bind mount image if presetn
Browse files Browse the repository at this point in the history
  • Loading branch information
alexgg committed Jun 15, 2022
1 parent 6882508 commit ebd16df
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion automation/include/balena-deploy.inc
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,7 @@ balena_deploy_block() {
local _esr="${11}"
local _discontinued
local _api_env=$(balena_lib_environment)
local _image_bind

[ -z "${_device_type}" ] && echo "Device type is required" && return
_discontinued=$(balena_lib_get_dt_state "${_device_type}")
Expand All @@ -354,6 +355,7 @@ balena_deploy_block() {
[ -z "${_appName}" ] && echo "App name is required" && return
if [ -f "${_image_path}" ]; then
_image_path="$(readlink --canonicalize "${_image_path}")"
_image_bind="-v ${_image_path}:/host/appimage.docker"
fi
_esr=${_esr:-"${ESR}"}

Expand Down Expand Up @@ -387,7 +389,7 @@ balena_deploy_block() {
-e balenaCloudEmail="${_balenaCloudEmail}" \
-e balenaCloudPassword="${_balenaCloudPassword}" \
-e ESR="${_esr}" \
-v "${_image_path}":/host/appimage.docker \
${_image_bind} \
-v "${device_dir}":/work \
-v "${_work_dir}":/deploy \
--privileged \
Expand Down

0 comments on commit ebd16df

Please sign in to comment.