harb/scripts/build-ci-images.sh

61 lines
1.3 KiB
Bash
Raw Normal View History

#!/bin/bash
# Build and push CI images for E2E testing
set -euo pipefail
cd "$(dirname "$0")/.."
REGISTRY="${REGISTRY:-registry.niovi.voyage}"
TAG="${TAG:-latest}"
echo "=== Building CI images ==="
echo "Registry: $REGISTRY"
echo "Tag: $TAG"
# Build ponder-ci
echo ""
echo "=== Building ponder-ci ==="
docker build \
-f docker/Dockerfile.ponder-ci \
-t "$REGISTRY/harb/ponder-ci:$TAG" \
.
# Build webapp-ci
echo ""
echo "=== Building webapp-ci ==="
docker build \
-f docker/Dockerfile.webapp-ci \
-t "$REGISTRY/harb/webapp-ci:$TAG" \
.
# Build landing-ci
echo ""
echo "=== Building landing-ci ==="
docker build \
-f docker/Dockerfile.landing-ci \
-t "$REGISTRY/harb/landing-ci:$TAG" \
.
# Build txnbot-ci
echo ""
echo "=== Building txnbot-ci ==="
docker build \
-f docker/Dockerfile.txnbot-ci \
-t "$REGISTRY/harb/txnbot-ci:$TAG" \
.
echo ""
echo "=== All images built ==="
echo ""
# Push if requested
if [[ "${PUSH:-false}" == "true" ]]; then
echo "=== Pushing images to registry ==="
docker push "$REGISTRY/harb/ponder-ci:$TAG"
docker push "$REGISTRY/harb/webapp-ci:$TAG"
docker push "$REGISTRY/harb/landing-ci:$TAG"
docker push "$REGISTRY/harb/txnbot-ci:$TAG"
echo "=== All images pushed ==="
else
echo "To push images, run: PUSH=true $0"
fi