-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbasic_setup.sh
More file actions
executable file
·44 lines (34 loc) · 1.43 KB
/
basic_setup.sh
File metadata and controls
executable file
·44 lines (34 loc) · 1.43 KB
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
#!/usr/bin/env bash
#run as basic_setup.sh PROMETHEUS_LOGIN GRANT_NAME
set -e
export PROMETHEUS_LOGIN=$1
export GRANT_NAME=$2
function prepare_local_venv {
#ENV_DIR=/tmp/example_venv
#echo "=================================================================="
#echo "Setting up local virtual env in $ENV_DIR"
#echo "We assume python3"
#echo "=================================================================="
#rm -rf $ENV_DIR
#python3 -m venv $ENV_DIR
#source $ENV_DIR/bin/activate
#pip install -r resources/requirements.txt
sleep 0
}
function prepare_mrunner_config {
#echo "=================================================================="
#echo "Preparing mrunner config in /tmp/mrunner_config.yaml"
#echo "=================================================================="
sed "s/<username>/$PROMETHEUS_LOGIN/g" mrunner_resources/prometheus_config_template.yaml > /tmp/mrunner_config_1.yaml
sed "s/<grantname>/$GRANT_NAME/g" /tmp/mrunner_config_1.yaml > /tmp/mrunner_config.yaml
rm /tmp/mrunner_config_1.yaml
#cat /tmp/mrunner_config.yaml
echo "basic_setup done."
}
function prepare_envs_and_mrunner_config {
if [ -z "$PROMETHEUS_LOGIN" ]; then echo "PROMETHEUS_LOGIN must be set. exiting";exit; fi
if [ -z "$GRANT_NAME" ]; then echo "GRANT_NAME must be set. exiting";exit; fi
prepare_local_venv
prepare_mrunner_config
}
prepare_envs_and_mrunner_config;