-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbuild_all.example.sh
More file actions
executable file
·87 lines (72 loc) · 2.82 KB
/
build_all.example.sh
File metadata and controls
executable file
·87 lines (72 loc) · 2.82 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#!/bin/bash
set -e
help() {
echo "Build a release image with specific changes to enable external cloud provider and upload it to quay.io"
echo ""
echo "Usage: ./build_all.sh [options] -u <quay.io username>"
echo "Options:"
echo "-h, --help show this message"
echo "-u, --username registered username in quay.io"
echo "-t, --tag push to a custom tag in your origin release image repo, default: latest"
echo "-r, --release openshift release version, default: 4.11"
echo "-a, --auth path of registry auth file, default: ./pull-secrets/pull-secret.txt"
}
: ${TAG:="latest"}
: ${RELEASE:="4.11"}
: ${OC_REGISTRY_AUTH_FILE:=$(pwd)"/pull-secrets/pull-secret.txt"}
while [[ $# -gt 0 ]]; do
case "$1" in
-h|--help)
help
exit 0
;;
-u|--username)
USERNAME=$2
shift 2
;;
-t|--tag)
TAG=$2
shift 2
;;
-r|--release)
RELEASE=$2
shift 2
;;
-a|--auth)
OC_REGISTRY_AUTH_FILE=$2
shift 2
;;
*)
echo "Invalid option $1"
help
exit 1
;;
esac
done
if [ -z "$USERNAME" ]; then
echo "-u/--username was not provided, exiting ..."
exit 1
fi
if [ ! -f "$OC_REGISTRY_AUTH_FILE" ]; then
echo "$OC_REGISTRY_AUTH_FILE not found, exiting ..."
exit 1
fi
# Build from https://github.com/openshift/cluster-kube-controller-manager-operator pr n 557
# Repo for cloning constructing as https://github.com/openshift/{operator_name}
echo "Building and uploading a custom image for KCMO"
./build_operator_image.sh -u "$USERNAME" -o cluster-kube-controller-manager-operator -i 557 -d Dockerfile.rhel7 -t "$TAG"
# Build from https://github.com/openshift/machine-config-operator HEAD
echo "Building and uploading a custom image for MCO"
./build_operator_image.sh -u "$USERNAME" -o machine-config-operator -t "$TAG"
# Build cluster-cloud-controller-manager-operator from lobziik's fork last commit
echo "Building and uploading a custom image for CCCMO"
./build_operator_image.sh -u "$USERNAME" \
-o cluster-cloud-controller-manager-operator \
-r git@github.com:lobziik/cluster-cloud-controller-manager-operator.git \
-c 18d1f30 \
-t "$TAG"
echo "Building a release image"
./build_release_image.sh -u "$USERNAME" -a "$OC_REGISTRY_AUTH_FILE" \
-i cluster-kube-controller-manager-operator=quay.io/"$USERNAME"/cluster-kube-controller-manager-operator:"$TAG" \
-i machine-config-operator=quay.io/"$USERNAME"/machine-config-operator:"$TAG" \
-i cluster-cloud-controller-manager-operator=quay.io/"$USERNAME"/cluster-cloud-controller-manager-operator:"$TAG"