Skip to content

Commit 61f78ac

Browse files
committed
add dry run ability
this will just print things out instead of running
1 parent cc1e2f0 commit 61f78ac

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

operators/bake.sh

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ BUILD_BASE=false
1313
PUSH_LOCAL=false
1414
PUSH_REMOTE=false
1515
PULL_LOCAL=false
16+
DRY_RUN=false
1617
TARGET=""
1718

1819
# Parse args
@@ -36,6 +37,10 @@ while [[ $# -gt 0 ]]; do
3637
VARS="$OPERATORS_DIR/vars-prod.hcl"
3738
shift
3839
;;
40+
--dry-run)
41+
DRY_RUN=true
42+
shift
43+
;;
3944
--target)
4045
TARGET="$2"
4146
shift 2
@@ -57,14 +62,18 @@ cd "$REPO_ROOT_DIR"
5762

5863

5964
if $BUILD_BASE; then
65+
base_cmd=(docker buildx bake)
66+
if $DRY_RUN; then
67+
base_cmd+=(--print)
68+
fi
6069
echo "=== Building base images ==="
61-
docker buildx bake base --file "$BAKE_FILE" \
70+
"${base_cmd[@]}" base --file "$BAKE_FILE" \
6271
--file "$BASE_VARS"
6372

64-
docker buildx bake operator --file "$BAKE_FILE" \
73+
"${base_cmd[@]}" operator --file "$BAKE_FILE" \
6574
--file "$BASE_VARS"
6675

67-
docker buildx bake distiller-streaming --file "$BAKE_FILE" \
76+
"${base_cmd[@]}" distiller-streaming --file "$BAKE_FILE" \
6877
--file "$BASE_VARS"
6978
fi
7079

@@ -105,6 +114,11 @@ build_operators() {
105114

106115
cmd+=(--push)
107116

117+
118+
if $DRY_RUN; then
119+
cmd+=(--print)
120+
fi
121+
108122
# Execute the command
109123
"${cmd[@]}"
110124
}

0 commit comments

Comments
 (0)