Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add hostapp to hostos #245

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion automation/jenkins_build-blocks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ __build_hostos_blocks() {
_appname="${_device_type}-${_block}"
balena_build_block "${_appname}" "${_device_type}" "${_packages}" "${_balenaos_account}" "${_api_env}"
_release_version=$(balena_lib_get_os_version)
balena_deploy_block "${_appname}" "${_device_type}" "${_bootable:-0}" "${_image_path:-"${WORKSPACE}/deploy-jenkins/${_appName}-${_release_version}.docker"}"
balena_deploy_block "${_appname}" "${_device_type}" "${_bootable:-0}" "${_final}" "${_image_path:-"${WORKSPACE}/deploy-jenkins/${_appName}-${_release_version}.docker"}"
done

# Remove packages folder from deploy directory
Expand Down
27 changes: 26 additions & 1 deletion automation/jenkins_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,34 @@ else
popd > /dev/null 2>&1
fi

"${automation_dir}"/../build/balena-build.sh -d "${MACHINE}" -s "${JENKINS_PERSISTENT_WORKDIR}" -a "$(balena_lib_environment)" -g "${BARYS_ARGUMENTS_VAR}"
"${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"
# 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

image_path=$(find "${WORKSPACE}/build/tmp/work/" -name "balena-image-${MACHINE}*.docker" -type l)
if [ -L "${_image_path}" ]; then
echo "[ERROR]:balena_deploy_hostapp: No hostapp to release"
exit 1
fi
balena_deploy_block "$(balena_lib_get_slug "${MACHINE}")" "${MACHINE}" "${_bootable:-1}" "${deploy}" "${image_path}"

# Build and release blocks
if [ -n "${blocks}" ]; then
[ "${deploy}" = "no" ] && _final=""
"${automation_dir}/jenkins_build-blocks.sh" -d "${MACHINE}" -a "$(balena_lib_environment)" -b "${blocks}" -t "$(balena_lib_token)" -s "${JENKINS_PERSISTENT_WORKDIR}" "${_final:+"-p"}"
fi

# Release hostos
osapp="${MACHINE}-hostos"
blocks_apps="${MACHINE}"
for block in ${blocks}; do
blocks_apps="${blocks_apps} ${MACHINE}-${block}"
done
balena_deploy_hostos "${osapp}" "${blocks_apps}" "${MACHINE}" "${deploy}"
BARYS_ARGUMENTS_VAR="${BARYS_ARGUMENTS_VAR} -a HOSTOS_APPS=${osapp}"

# Build image
"${automation_dir}"/../build/balena-build.sh -d "${MACHINE}" -s "${JENKINS_PERSISTENT_WORKDIR}" -a "$(balena_lib_environment)" -g "${BARYS_ARGUMENTS_VAR}"

if [ "$ENABLE_TESTS" = true ]; then
# Run the test script in the device specific repository
if [ -f "$WORKSPACE/tests/start.sh" ]; then
Expand Down