From f34dbe2c52cbfdeaf68050dcb606b3af4d09cdf6 Mon Sep 17 00:00:00 2001 From: Michal Toman Date: Fri, 20 Nov 2020 15:59:43 +0100 Subject: [PATCH] jenkins_build.sh: publish explicitly named balena-raw and balena-flasher images At this moment we are providing a single balena.img file that is either raw or flasher based on the coffee script. We want to publish both for some device types, therefore split the single file into balena-raw.img and balena-flasher.img. Temporarily keep the existing balena.img for backwards compatibility until all coffee scripts are updated and image maker is aware of the split. Signed-off-by: Michal Toman --- automation/jenkins_build.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/automation/jenkins_build.sh b/automation/jenkins_build.sh index 87ed4bb7d..5ebbc16d4 100755 --- a/automation/jenkins_build.sh +++ b/automation/jenkins_build.sh @@ -88,7 +88,13 @@ deploy_build () { # uncompressed, just copy and we're done cp -v $(readlink --canonicalize "$YOCTO_BUILD_DEPLOY/$_deploy_artifact") "$_deploy_dir/image/balena.img" if [ -n "$_deploy_flasher_artifact" ]; then + cp -v "$_deploy_dir/image/balena.img" "$_deploy_dir/image/balena-raw.img" cp -v $(readlink --canonicalize "$YOCTO_BUILD_DEPLOY/$_deploy_flasher_artifact") "$_deploy_dir/image/balena-flasher.img" + elif [ "$_image" = "resin-image-flasher" ]; then + # backwards compatibility - deployFlasherArtifact is not set and deployArtifact contains flasher + cp -v "$_deploy_dir/image/balena.img" "$_deploy_dir/image/balena-flasher.img" + else + cp -v "$_deploy_dir/image/balena.img" "$_deploy_dir/image/balena-raw.img" fi return fi @@ -107,11 +113,21 @@ deploy_build () { cp -v $(readlink --canonicalize "$YOCTO_BUILD_DEPLOY/$_deploy_artifact") "$_deploy_dir/image/balena.img" (cd "$_deploy_dir/image" && zip balena.img.zip balena.img) if [ -n "$_deploy_flasher_artifact" ]; then + cp -v "$_deploy_dir/image/balena.img" "$_deploy_dir/image/balena-raw.img" + (cd "$_deploy_dir/image" && zip balena-raw.img.zip balena-raw.img) cp -v $(readlink --canonicalize "$YOCTO_BUILD_DEPLOY/$_deploy_flasher_artifact") "$_deploy_dir/image/balena-flasher.img" (cd "$_deploy_dir/image" && zip balena-flasher.img.zip balena-flasher.img) + elif [ "$_image" = "resin-image-flasher" ]; then + # backwards compatibility - deployFlasherArtifact is not set and deployArtifact contains flasher + cp -v "$_deploy_dir/image/balena.img" "$_deploy_dir/image/balena-flasher.img" + (cd "$_deploy_dir/image" && zip balena-flasher.img.zip balena-flasher.img) + else + cp -v "$_deploy_dir/image/balena.img" "$_deploy_dir/image/balena-raw.img" + (cd "$_deploy_dir/image" && zip balena-raw.img.zip balena-raw.img) fi if [ "$_remove_compressed_file" = "true" ]; then rm -rf $_deploy_dir/image/balena.img + rm -rf $_deploy_dir/image/balena-raw.img rm -rf $_deploy_dir/image/balena-flasher.img fi fi