forked from layer5io/meshery-performance-action
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.sh
executable file
·40 lines (29 loc) · 894 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
"$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
"$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