-
Notifications
You must be signed in to change notification settings - Fork 51
/
build-images.sh
executable file
·57 lines (45 loc) · 1.22 KB
/
build-images.sh
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/usr/bin/env bash
set -eEu -o pipefail
# Replace with your username. Don't push your dev images to redhat-github-actions.
REGISTRY=${RUNNERS_REGISTRY:-quay.io/tetchell}
TAG=${RUNNERS_TAG:-latest}
BASE_IMG=${REGISTRY}/runner:${TAG}
BUILDAH_IMG=${REGISTRY}/buildah-runner:${TAG}
K8S_TOOLS_IMG=${REGISTRY}/k8s-tools-runner:${TAG}
echo "Base img tag $BASE_IMG"
enabled() {
[[ $1 == *$2* ]]
}
cd $(dirname $0)
if enabled "$*" base; then
echo "Building base image..."
docker build -f ./base/Containerfile -t $BASE_IMG ./base
fi
if enabled "$*" buildah; then
echo "Building buildah image..."
docker build -f ./buildah/Containerfile -t $BUILDAH_IMG ./buildah
fi
if enabled "$*" k8s; then
echo "Building K8s image..."
docker build -f ./k8s-tools/Containerfile -t $K8S_TOOLS_IMG ./k8s-tools
fi
if enabled "$*" push; then
echo "Pushing..."
docker push $BASE_IMG
if enabled "$*" buildah; then
docker push $BUILDAH_IMG
fi
if enabled "$*" k8s; then
docker push $K8S_TOOLS_IMG
fi
else
echo "Not pushing. Pass 'push' to push"
fi
echo "$BASE_IMG"
if enabled "$*" buildah; then
echo "$BUILDAH_IMG"
fi
if enabled "$*" k8s; then
echo "$K8S_TOOLS_IMG"
fi
cd - > /dev/null