-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoc-process.sh
executable file
·68 lines (46 loc) · 1011 Bytes
/
oc-process.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
58
59
60
61
62
63
64
65
66
67
68
#!/bin/bash
i="all"
f="template.yml"
e=".env"
while getopts ":f:e:i::" flag; do
case $flag in
f) f=${OPTARG} ;;
e) e=${OPTARG} ;;
i) i=${OPTARG} ;;
esac
done
set -a
source ./$e
set +a
BRANCH=$(git symbolic-ref --short -q HEAD)
FINBIF_PRIVATE_API="unset"
if [ "$BRANCH" != "main" ]; then
HOST=$HOST_DEV
MEMORY=$MEMORY_DEV
MAX_CHUNK_SIZE=$MAX_CHUNK_SIZE_DEV
FINBIF_PRIVATE_API="dev"
fi
if [ $i = "deploy" ]; then
ITEM=".items[0]"
elif [ $i = "service" ]; then
ITEM=".items[1]"
elif [ $i = "route" ]; then
ITEM=".items[2]"
elif [ $i = "all" ]; then
ITEM=""
else
echo "Object not found"
exit 1
fi
echo "# $(oc project finbif-geo-convert)"
oc process -f $f \
-p BRANCH=$BRANCH \
-p HOST=$HOST \
-p MEMORY=$MEMORY \
-p MAX_CHUNK_SIZE=$MAX_CHUNK_SIZE \
-p FINBIF_PRIVATE_API=$FINBIF_PRIVATE_API \
-p SMTP_SERVER=$SMTP_SERVER \
-p SMTP_PORT=$SMTP_PORT \
-p ERROR_EMAIL_TO=$ERROR_EMAIL_TO \
-p ERROR_EMAIL_FROM=$ERROR_EMAIL_FROM \
| jq $ITEM