@@ -143,9 +143,34 @@ else
143
143
popd > /dev/null 2>&1
144
144
fi
145
145
146
- " ${automation_dir} " /../build/balena-build.sh -d " ${MACHINE} " -s " ${JENKINS_PERSISTENT_WORKDIR} " -a " $( balena_lib_environment) " -g " ${BARYS_ARGUMENTS_VAR} "
146
+ " ${automation_dir} " /../build/balena-build.sh -d " ${MACHINE} " -s " ${JENKINS_PERSISTENT_WORKDIR} " -a " $( balena_lib_environment) " -g " ${BARYS_ARGUMENTS_VAR} " -b " -c image_docker " -i " balena-image "
147
147
# Do not check for artifacts as when discontinuing device types build artifacts are not created, but device-type.json needs to be deployed to mark the device as discontinued
148
148
149
+ image_path=$( find " ${WORKSPACE} /build/tmp/work/" -name " balena-image-${MACHINE} *.docker" -type l)
150
+ if [ -L " ${_image_path} " ]; then
151
+ echo " [ERROR]:balena_deploy_hostapp: No hostapp to release"
152
+ exit 1
153
+ fi
154
+ balena_deploy_block " $( balena_lib_get_slug " ${MACHINE} " ) " " ${MACHINE} " " ${_bootable:- 1} " " ${deploy} " " ${image_path} "
155
+
156
+ # Build and release blocks
157
+ if [ -n " ${blocks} " ]; then
158
+ [ " ${deploy} " = " no" ] && _final=" "
159
+ " ${automation_dir} /jenkins_build-blocks.sh" -d " ${MACHINE} " -a " $( balena_lib_environment) " -b " ${blocks} " -t " $( balena_lib_token) " -s " ${JENKINS_PERSISTENT_WORKDIR} " " ${_final: +" -p" } "
160
+ fi
161
+
162
+ # Release hostos
163
+ osapp=" ${MACHINE} -hostos"
164
+ blocks_apps=" ${MACHINE} "
165
+ for block in ${blocks} ; do
166
+ blocks_apps=" ${blocks_apps} ${MACHINE} -${block} "
167
+ done
168
+ balena_deploy_hostos " ${osapp} " " ${blocks_apps} " " ${MACHINE} " " ${deploy} "
169
+ BARYS_ARGUMENTS_VAR=" ${BARYS_ARGUMENTS_VAR} -a HOSTOS_APPS=${osapp} "
170
+
171
+ # Build image
172
+ " ${automation_dir} " /../build/balena-build.sh -d " ${MACHINE} " -s " ${JENKINS_PERSISTENT_WORKDIR} " -a " $( balena_lib_environment) " -g " ${BARYS_ARGUMENTS_VAR} "
173
+
149
174
if [ " $ENABLE_TESTS " = true ]; then
150
175
# Run the test script in the device specific repository
151
176
if [ -f " $WORKSPACE /tests/start.sh" ]; then
0 commit comments