Skip to content

Commit

Permalink
feat(scripts): Add --offline option to task build-image
Browse files Browse the repository at this point in the history
  • Loading branch information
RemiBardon committed Nov 21, 2024
1 parent 80e1281 commit 35f46ef
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions scripts/build-image
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ $(format_title 'Options:')
Do not build the Rust project.
$(format_secondary "Use when you haven't changed the code and only want to rebuild the Docker images.")
$(format_flag --debug)
Build projects the Prose Pod API in debug mode.
Builds the Prose Pod API in debug mode.
$(format_flag --offline)
Run without accessing the network. Implies $(format_flag --no-pull).
$(format_secondary "Speeds up the builds and does not use the network, but does not update crates.")
$(format_flag --no-pull)
Do not pull referenced Docker images.
$(format_secondary "Speeds up the builds and does not use the network, but does not update base images.")
Expand Down Expand Up @@ -100,6 +103,12 @@ for arg in "$@"; do
info 'Will not build the Rust project.'
SKIP_RUST_BUILD=1
;;
--offline)
info 'Will build without accesing the network.'
OFFLINE=1
info 'Will not pull referenced Docker images.'
NO_PULL=1
;;
--no-pull)
info 'Will not pull referenced Docker images.'
NO_PULL=1
Expand All @@ -116,7 +125,8 @@ info "Using $(format_code $(rustc --version)), $(format_code $(rustup --version
if ! (( $SKIP_RUST_BUILD )); then
edo "${RUST_ENGINE}" build \
${TARGET_ARCH:+--target "${TARGET_ARCH}"} \
--profile "${CARGO_PROFILE}"
--profile "${CARGO_PROFILE}" \
${OFFLINE+--offline}
fi

edo docker buildx build \
Expand Down

0 comments on commit 35f46ef

Please sign in to comment.