-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit-quickwit
More file actions
executable file
·38 lines (30 loc) · 875 Bytes
/
init-quickwit
File metadata and controls
executable file
·38 lines (30 loc) · 875 Bytes
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
#!/usr/bin/env bash
set -e
shopt -s expand_aliases
alias mc="init-stack mc"
alias jq="init-stack jq"
alias quickwit="init-stack quickwit"
mc config host add storage \
"${DRYCC_STORAGE_ENDPOINT}" \
"${DRYCC_STORAGE_ACCESSKEY}" \
"${DRYCC_STORAGE_SECRETKEY}" \
--lookup "${DRYCC_STORAGE_LOOKUP}" \
--api s3v4
has_bucket(){
mc ls storage -json|jq -r '.key'|grep -w "${DRYCC_STORAGE_BUCKET}"
}
mc ping storage -x
if [ -z "$(has_bucket)" ] ;then
mc mb storage/"${DRYCC_STORAGE_BUCKET}"
if [ -z "$(has_bucket)" ] ;then
echo "create bucket ${DRYCC_STORAGE_BUCKET} error"
exit 1
fi
fi
echo "create bucket ${DRYCC_STORAGE_BUCKET} success"
AWS_REGION=${DRYCC_STORAGE_ENDPOINT%%.*}
if [ "$DRYCC_STORAGE_LOOKUP" = "path" ]; then
QW_S3_FORCE_PATH_STYLE_ACCESS="true"
fi
export AWS_REGION QW_S3_FORCE_PATH_STYLE_ACCESS
quickwit "$@"