-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrunner_utils.sh
More file actions
executable file
·29 lines (20 loc) · 960 Bytes
/
runner_utils.sh
File metadata and controls
executable file
·29 lines (20 loc) · 960 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/bash
# Common Docker utilities that are independent of deployment method (k8s, docker-compose, etc.)
CONFIG_FILE="${CONFIG_FILE:-services.config.json}"
DOCKER_DEV_REGISTRY="${DOCKER_DEV_REGISTRY:-docker.io}"
function rebuild_images() {
echo "🔄 Rebuilding Docker images..."
jq -c '.services[]' $CONFIG_FILE | while read -r svc; do
NAME=$(echo $svc | jq -r '.name')
FOLDER=$(echo $svc | jq -r '.folder')
IMAGE=$(echo $svc | jq -r '.dockerImage')
REGISTRY_IMAGE="$DOCKER_DEV_REGISTRY/$IMAGE"
echo "→ Building image for $NAME..."
docker build -t "$IMAGE" "$FOLDER"
echo "→ Tagging image as $REGISTRY_IMAGE"
docker tag "$IMAGE" "$REGISTRY_IMAGE"
echo "→ Pushing image to $DOCKER_DEV_REGISTRY registry"
docker push "$REGISTRY_IMAGE" || echo "⚠️ Warning: Failed to push image $REGISTRY_IMAGE, continuing..."
done
echo "✅ Docker images built and pushed to $DOCKER_DEV_REGISTRY registry"
}