Fixing building process

This commit is contained in:
Adsooi 2024-09-24 17:35:51 +02:00
parent 236a9c4bc5
commit 104b483c3d
Signed by: Ad5001
GPG key ID: EF45F9C6AFE20160

View file

@ -83,8 +83,8 @@ to-docker-args() {
out=""
while read -r line; do
key="${line%=*}"
value="$(echo "${line#=*}" | pass-argument REPO "$1" | pass-argument VERSION "$2")"
out="$out--build-arg $key=$value";
value="$(echo "${line}" | get-value-of "$key" | pass-argument REPO "$1" | pass-argument VERSION "$2")"
out="$out--build-arg $key=$value ";
done
echo "$out"
}
@ -102,21 +102,22 @@ build_pyside() {
tag="$(from-toml-dict "$cfg" "$build.settings" | get-value-of TAG | pass-argument VERSION "$version")"
latest_tag="$(from-toml-dict "$cfg" "$build.settings" | get-value-of TAG | pass-argument VERSION "${major}-latest")"
build_args="$(from-toml-dict "$cfg" "$build.docker-args" | to-docker-args "$repo" "$version")"
box-green "Building image $tag..."
docker build -t "$tag" $build_args "$directory/${build}"
box-green "Building image $repo:$tag..."
echo "> docker build -t $repo:$tag $build_args $directory/${build}"
docker build -t "$repo:$tag" $build_args "$directory/${build}"
# Tag as latest
if [ "$latest" != "false" ]; then
docker tag "$tag" "$latest_tag"
docker tag "$repo:$tag" "$repo:$latest_tag"
fi
# Push builds
if [ "$push" != "false" ]; then
if [ "$latest" != "false" ]; then
box-green "Pushing image $repo/$tag and $repo/$latest_tag..."
docker push "$latest_tag"
docker push "$tag"
box-green "Pushing image $repo:$tag and $repo:$latest_tag..."
docker push "$repo:$latest_tag"
docker push "$repo:$tag"
else
box-green "Pushing image $repo/$tag..."
docker push "$tag"
box-green "Pushing image $repo:$tag..."
docker push "$repo:$tag"
fi
fi
done