generated from layer5io/layer5-repo-template
-
Notifications
You must be signed in to change notification settings - Fork 10
/
main.sh
40 lines (29 loc) · 891 Bytes
/
main.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
#!/usr/bin/env bash
set -o errexit
set -o nounset
set -o pipefail
SCRIPT_DIR=$(dirname -- "$(readlink -f "${BASH_SOURCE[0]}" || realpath "${BASH_SOURCE[0]}")")
main() {
get_dependencies
setupArgs=()
if [[ -n "${INPUT_PROVIDER_TOKEN:-}" ]]; then
setupArgs=(--provider-token ${INPUT_PROVIDER_TOKEN})
fi
if [[ -n "${INPUT_PLATFORM:-}" ]]; then
setupArgs+=(--platform ${INPUT_PLATFORM})
fi
bash "$SCRIPT_DIR/meshery.sh" "${setupArgs[@]}"
commandArgs=()
if [[ -n "${INPUT_PATTERN_FILE:-}" ]]; then
commandArgs=(--pattern-file ${INPUT_PATTERN_FILE})
fi
if [[ -n "${INPUT_PATTERN_URL:-}" ]]; then
commandArgs+=(--pattern-url ${INPUT_PATTERN_URL})
fi
bash "$SCRIPT_DIR/mesheryctl.sh" "${commandArgs[@]}"
}
get_dependencies() {
sudo wget https://github.com/mikefarah/yq/releases/download/v4.10.0/yq_linux_amd64 -O /usr/bin/yq --quiet
sudo chmod +x /usr/bin/yq
}
main