@@ -158,13 +158,35 @@ else
158158 popd > /dev/null 2>&1
159159fi
160160
161- " ${automation_dir} " /../build/balena-build.sh -d " ${MACHINE} " -s " ${JENKINS_PERSISTENT_WORKDIR} " -a " $( balena_lib_environment) " -v " ${buildFlavor} " -g " ${BARYS_ARGUMENTS_VAR} "
161+ # Artifacts
162+
163+ # Build hostapp
164+ " ${automation_dir} " /../build/balena-build.sh -d " ${MACHINE} " -s " ${JENKINS_PERSISTENT_WORKDIR} " -a " $( balena_lib_environment) " -v " ${buildFlavor} " -g " ${BARYS_ARGUMENTS_VAR} " -b " -c image_docker" -i " balena-image"
162165
163166image_path=$( find " ${WORKSPACE} /build/tmp/work/" -name " balena-image-${MACHINE} *.docker" -type l)
164167if [ -L " ${_image_path} " ]; then
165168 echo " [ERROR]:balena_deploy_hostapp: No hostapp to release"
166169 exit 1
167170fi
171+ balena_deploy_block " $( balena_lib_get_slug " ${MACHINE} " ) " " ${MACHINE} " " ${_bootable:- 1} " " ${deploy} " " ${image_path} "
172+
173+ # Build and release blocks
174+ if [ -n " ${blocks} " ]; then
175+ [ " ${deploy} " = " no" ] && _final=" "
176+ " ${automation_dir} /jenkins_build-blocks.sh" -d " ${MACHINE} " -a " $( balena_lib_environment) " -b " ${blocks} " -t " $( balena_lib_token) " -v " ${buildFlavor} " -s " ${JENKINS_PERSISTENT_WORKDIR} " " ${_final: +" -p" } "
177+ fi
178+
179+ # Release hostos
180+ osapp=" ${MACHINE} -hostos"
181+ blocks_apps=" ${MACHINE} "
182+ for block in ${blocks} ; do
183+ blocks_apps=" ${blocks_apps} ${MACHINE} -${block} "
184+ done
185+ balena_deploy_hostos " ${osapp} " " ${blocks_apps} " " ${MACHINE} " " ${deploy} "
186+ BARYS_ARGUMENTS_VAR=" ${BARYS_ARGUMENTS_VAR} -a HOSTOS_APPS=${osapp} "
187+
188+ # Build image
189+ " ${automation_dir} " /../build/balena-build.sh -d " ${MACHINE} " -s " ${JENKINS_PERSISTENT_WORKDIR} " -a " $( balena_lib_environment) " -v " ${buildFlavor} " -g " ${BARYS_ARGUMENTS_VAR} "
168190
169191if [ " $ENABLE_TESTS " = true ]; then
170192 # Run the test script in the device specific repository
@@ -186,7 +208,6 @@ if [ "$deploy" = "yes" ]; then
186208
187209 balena_deploy_to_s3 " $MACHINE " " ${buildFlavor} " " ${ESR} " " ${deployTo} "
188210 balena_deploy_to_dockerhub " ${MACHINE} "
189- balena_deploy_block " $( balena_lib_get_slug " ${MACHINE} " ) " " ${MACHINE} " " ${_bootable:- 1} " " ${deploy} " " ${image_path} "
190211
191212 if [ " $AMI " = " true" ]; then
192213 echo " [INFO] Generating AMI"
0 commit comments