forked from yard-turkey/aws-s3-provisioner
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathrelease.sh
More file actions
executable file
·39 lines (31 loc) · 1.03 KB
/
release.sh
File metadata and controls
executable file
·39 lines (31 loc) · 1.03 KB
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
#!/bin/bash -e
cd "$(dirname "$0")/.." || exit
push=false
if [ "$1" == "--push" ]; then
push=true
shift
fi
tag=${1:-quay.io/cloudian/cloudian-s3-operator:1.0.1}
docker build -t "$tag" .
# If we're running a k3d cluster, load the image
# into the cluster so we don't have to download it
if [ -n "$(kubectl config get-contexts | grep "*" | grep "k3d-s3provisioner")" ]; then
k3d image import -c s3provisioner "$tag"
fi
# If we're running a kind cluster, load the image
# into the cluster so we don't have to download it
if [ -n "$(kubectl config get-contexts | grep "*" | grep "kind-kind")" ]; then
kind load docker-image "$tag"
fi
# If we're running a microk9s cluster, set a tag and push to the k8s registry
if [ -n "$(kubectl config get-contexts | grep "*" | grep "microk8s")" ]; then
mk8s_tag="localhost:32000/$(basename "$tag")"
docker image tag "$tag" "$mk8s_tag"
# tolerate errors so we don't if the microk8s registry isn't enabled
set +e
docker push "$mk8s_tag"
set -e
fi
if $push; then
docker push "$tag"
fi