Skip to content

Commit

Permalink
updates (#183)
Browse files Browse the repository at this point in the history
  • Loading branch information
juchiast authored Jan 23, 2025
1 parent 0f86e5a commit 3f0bd77
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 17 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/basic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ jobs:
# - name: Install wasm32-wasi
# run: rustup target add wasm32-wasi
- name: Install deno
uses: denoland/setup-deno@v1
uses: denoland/setup-deno@v2
with:
deno-version: v1.x
deno-version: v2.x
# - name: Build WASM
# run: ./scripts/build_wasm_tests.bash
- name: Build tests
Expand Down
27 changes: 19 additions & 8 deletions scripts/build_images.bash
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
#!/usr/bin/env bash
set -Eeuo pipefail
set -Eexuo pipefail

CMD="podman"
BUILD="podman build --pull=always"
if [[ "${1:-}" == docker ]]; then
CMD="docker"
BUILD="docker build --pull"
fi

echo Using $CMD

PROFILE=${PROFILE:-release}

NAME="space-operator/flow-server"
DOCKERFILE="crates/flow-server/Dockerfile"
Expand All @@ -10,17 +21,17 @@ if [[ "$(git describe --always --dirty)" == *-dirty ]]; then
fi

set -x
time docker build --pull=always --target rustc -t "$NAME-rustc:latest" -f "$DOCKERFILE" .
time docker build --pull=always --target planner -t "$NAME-planner:latest" -f "$DOCKERFILE" .
time docker build --pull=always --target cacher -t "$NAME-cacher:latest" -f "$DOCKERFILE" .
time $BUILD --target rustc -t "$NAME-rustc:latest" -f "$DOCKERFILE" .
time $BUILD --target planner -t "$NAME-planner:latest" -f "$DOCKERFILE" .
time $BUILD --target cacher --build-arg PROFILE=$PROFILE -t "$NAME-cacher:$PROFILE-latest" -f "$DOCKERFILE" .

BUILDER_TAG=$RANDOM
time docker build --pull=always --target builder -t "$NAME-builder:$BUILDER_TAG" -f "$DOCKERFILE" .
time $BUILD --target builder --build-arg PROFILE=$PROFILE -t "$NAME-builder:$BUILDER_TAG" -f "$DOCKERFILE" .

COMMIT="$(git rev-parse --verify HEAD)$DIRTY"
time docker build --pull=always -t "$NAME:$COMMIT" -f "$DOCKERFILE" .
time $BUILD -t "$NAME:$COMMIT" -f "$DOCKERFILE" .

BRANCH="${BRANCH:-$(git rev-parse --abbrev-ref HEAD)$DIRTY}"
docker tag $NAME:$COMMIT $NAME:$BRANCH
$CMD tag $NAME:$COMMIT $NAME:$BRANCH

docker image rm "$NAME-builder:$BUILDER_TAG"
$CMD image rm "$NAME-builder:$BUILDER_TAG"
20 changes: 13 additions & 7 deletions scripts/ecr-push.bash
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
#!/usr/bin/env bash
set -Eeuxo pipefail

CMD="podman"
if [[ "${1:-}" == docker ]]; then
CMD="docker"
fi


ORG=space-operator
IMAGE=flow-server
NAME="$ORG/$IMAGE"

if [ "${1:-}" = "login" ]; then
aws ecr-public get-login-password --region us-east-1 |
docker login --username AWS --password-stdin "public.ecr.aws/$ORG"
$CMD login --username AWS --password-stdin "public.ecr.aws/$ORG"
fi

DIRTY=""
Expand All @@ -18,13 +24,13 @@ fi
BRANCH="${BRANCH:-$(git rev-parse --abbrev-ref HEAD)$DIRTY}"
COMMIT="$(git rev-parse --verify HEAD)$DIRTY"

docker tag $NAME:$COMMIT public.ecr.aws/$NAME:$COMMIT
docker push public.ecr.aws/$NAME:$COMMIT
$CMD tag $NAME:$COMMIT public.ecr.aws/$NAME:$COMMIT
$CMD push public.ecr.aws/$NAME:$COMMIT

docker tag $NAME:$BRANCH public.ecr.aws/$NAME:$BRANCH
docker push public.ecr.aws/$NAME:$BRANCH
$CMD tag $NAME:$BRANCH public.ecr.aws/$NAME:$BRANCH
$CMD push public.ecr.aws/$NAME:$BRANCH

if [[ "$BRANCH" == "main" ]]; then
docker tag $NAME:$COMMIT public.ecr.aws/$NAME:latest
docker push public.ecr.aws/$NAME:latest
$CMD tag $NAME:$COMMIT public.ecr.aws/$NAME:latest
$CMD push public.ecr.aws/$NAME:latest
fi

0 comments on commit 3f0bd77

Please sign in to comment.