Skip to content

Commit

Permalink
jenkins_build.sh: publish explicitly named balena-raw and balena-flas…
Browse files Browse the repository at this point in the history
…her 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 <[email protected]>
  • Loading branch information
mtoman committed Mar 7, 2021
1 parent 344941f commit f34dbe2
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions automation/jenkins_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit f34dbe2

Please sign in to comment.