generated from layer5io/layer5-repo-template
-
Notifications
You must be signed in to change notification settings - Fork 22
/
main.sh
executable file
·56 lines (41 loc) · 1.29 KB
/
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/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_PROFILE_FILENAME:-}" ]]; then
commandArgs=(--perf-filename ${INPUT_PROFILE_FILENAME})
fi
if [[ -n "${INPUT_PROFILE_NAME:-}" ]]; then
commandArgs+=(--profile-name ${INPUT_PROFILE_NAME})
fi
if [[ -n "${INPUT_ENDPOINT_URL:-}" ]]; then
commandArgs+=(--endpoint-url ${INPUT_ENDPOINT_URL})
fi
if [[ -n "${INPUT_SERVICE_MESH:-}" ]]; then
commandArgs+=(--service-mesh ${INPUT_SERVICE_MESH})
fi
if [[ -n "${INPUT_TEST_NAME:-}" ]]; then
commandArgs+=(--test-name ${INPUT_TEST_NAME})
fi
if [[ -n "${INPUT_LOAD_GENERATOR:-}" ]]; then
commandArgs+=(--load-generator ${INPUT_LOAD_GENERATOR})
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