Skip to content

Commit

Permalink
build and push test apps from a separate script
Browse files Browse the repository at this point in the history
Signed-off-by: Rajat Jindal <[email protected]>
  • Loading branch information
rajatjindal committed Apr 22, 2024
1 parent 86821e4 commit c4f8eeb
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 12 deletions.
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ check-bins:
move-bins:
./scripts/move-bins.sh $(BIN_DIR)

./PHONY: build-and-push-test-apps
build-and-push-test-apps:
./scripts/build-and-push-test-apps.sh

./PHONY: up
up:
./scripts/up.sh
Expand All @@ -47,7 +51,7 @@ test-workloads-delete:
./scripts/workloads-delete.sh

.PHONY: integration-tests
integration-tests: check-bins move-bins up pod-status-check workloads test-workloads-delete
integration-tests: check-bins move-bins build-and-push-test-apps up pod-status-check workloads test-workloads-delete
cargo test -p containerd-shim-spin-tests -- --nocapture

.PHONY: tests/collect-debug-logs
Expand Down
13 changes: 13 additions & 0 deletions scripts/build-and-push-test-apps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

set -euo pipefail

DOCKER_IMAGES=("spin" "spin-keyvalue" "spin-outbound-redis" "spin-multi-trigger-app")
IMAGES=("spin-hello-world" "spin-keyvalue" "spin-outbound-redis" "spin-multi-trigger-app")

# Iterate through the Docker images and build them
for i in "${!DOCKER_IMAGES[@]}"; do
## we can push images to localhost:5000 registry, and pull will still work using registry name
docker buildx build -t "localhost:5000/${IMAGES[$i]}:latest" "./images/${DOCKER_IMAGES[$i]}"
docker push "localhost:5000/${IMAGES[$i]}:latest"
done
11 changes: 0 additions & 11 deletions scripts/up.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ set -euo pipefail
cluster_name="test-cluster" # name of the k3d cluster
dockerfile_path="deployments/k3d" # path to the Dockerfile

DOCKER_IMAGES=("spin" "spin-keyvalue" "spin-outbound-redis" "spin-multi-trigger-app")
OUT_DIRS=("test/out_spin" "test/out_spin_keyvalue" "test/out_spin_outbound_redis" "test/out_spin_multi_trigger_app")
IMAGES=("spin-hello-world" "spin-keyvalue" "spin-outbound-redis" "spin-multi-trigger-app")

# build the Docker image for the k3d cluster
docker build -t k3d-shim-test "$dockerfile_path"

Expand All @@ -18,13 +14,6 @@ k3d cluster create "$cluster_name" \

kubectl wait --for=condition=ready node --all --timeout=120s

# Iterate through the Docker images and build them
for i in "${!DOCKER_IMAGES[@]}"; do
## we can push images to localhost:5000 registry, and pull will still work using registry name
docker buildx build -t "localhost:5000/${IMAGES[$i]}:latest" "./images/${DOCKER_IMAGES[$i]}"
docker push "localhost:5000/${IMAGES[$i]}:latest"
done

sleep 5

## wait for middleware crd. without this intermittent failures occur on local setup
Expand Down

0 comments on commit c4f8eeb

Please sign in to comment.