with parallel
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Kasper Juul Hermansen 2022-08-21 00:42:23 +02:00
parent a1f357ce6a
commit cf1c041db5
Signed by: kjuulh
GPG Key ID: 0F95C140730F2F23
2 changed files with 25 additions and 8 deletions

View File

@ -20,11 +20,19 @@ docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
export DOCKER_BUILDKIT=1 export DOCKER_BUILDKIT=1
function pull_target {
target=$1
echo "pulling $target"
latest_target_tag="$base_tag-$target:latest"
docker pull $latest_target_tag
}
function build_target { function build_target {
target=$1 target=$1
echo "building $target" echo "building $target"
latest_target_tag="$base_tag-$target:latest" latest_target_tag="$base_tag-$target:latest"
docker pull $latest_target_tag
docker build \ docker build \
--target "$target" \ --target "$target" \
--tag "$latest_target_tag" \ --tag "$latest_target_tag" \
@ -33,6 +41,10 @@ function build_target {
--file "$TMP/build_release.Dockerfile" . --file "$TMP/build_release.Dockerfile" .
} }
pull_target "deps" &
pull_target "builder" &
wait
build_target "deps" build_target "deps"
build_target "builder" build_target "builder"

View File

@ -20,16 +20,21 @@ docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
export DOCKER_BUILDKIT=1 export DOCKER_BUILDKIT=1
function build_target { function push_target {
target=$1 target=$1
echo "building $target" echo "pushing $target"
latest_target_tag="$base_tag-$target:latest" latest_target_tag="$base_tag-$target:latest"
docker push "$latest_target_tag" docker push "$latest_target_tag"
} }
build_target "deps" function push_main_target {
build_target "builder"
echo "docker: pushing image $tag" echo "docker: pushing image $tag"
docker push "$tag" docker push "$tag"
docker push "$latest_tag" docker push "$latest_tag"
}
push_target "deps" &
push_target "builder" &
push_main_target &
wait