-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdeploy-od2-prod
executable file
·39 lines (35 loc) · 1.26 KB
/
deploy-od2-prod
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
target=$1
label=$2
namespace="od2-prod"
registry_prefix="registry.library.oregonstate.edu/od2_web"
usage_string="Usage: $0 <target> <image label to deploy>"
targets_example=' targets: all | web | workers | tools'
if [ -z "$label" ]; then
echo "$usage_string"
exit 1
fi
if [ -z "$target" ]; then
echo "$usage_string"
exit 1
fi
if [ "$target" == 'all' ]; then
echo "Updating all deployments to label: $label"
kubectl -n $namespace set image deploy/web web=${registry_prefix}:$label
kubectl -n $namespace set image deploy/workers workers=${registry_prefix}:$label
kubectl -n $namespace set image deploy/tools tools=${registry_prefix}:$label
elif [ "$target" == 'web' ]; then
echo "Updating web deployment to label: $label"
kubectl -n $namespace set image deploy/web web=${registry_prefix}:$label
elif [ "$target" == 'workers' ]; then
echo "Updating workers deployment to label: $label"
kubectl -n $namespace set image deploy/workers workers=${registry_prefix}:$label
elif [ "$target" == 'tools' ]; then
echo "Updating tools deployment to label: $label"
kubectl -n $namespace set image deploy/tools tools=${registry_prefix}:$label
else
echo "Unknown target: $target"
echo "$usage_string"
echo "$targets_example"
exit 1
fi