-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun.sh
executable file
·42 lines (31 loc) · 1011 Bytes
/
run.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
#!/bin/bash
# Check if the correct number of arguments are provided
if [ "$#" -ne 3 ]; then
echo "Usage: $0 <local_repo_folder> <sonarcloud_project_name> <sonarcloud_jwt_token>"
exit 1
fi
# Assign arguments to variables
LOCAL_REPO_FOLDER=$1
SONARCLOUD_PROJECT_NAME=$2
SONARCLOUD_JWT_TOKEN=$3
mkdir -p ./tmp
# Run complexity.sh and churn.sh scripts
sh ./scripts/complexity.sh "$SONARCLOUD_PROJECT_NAME" "$SONARCLOUD_JWT_TOKEN"
sh ./scripts/churn.sh "$LOCAL_REPO_FOLDER"
# Check if complexity.json and churn.csv are generated
if [ ! -f tmp/complexity.json ] || [ ! -f tmp/churn.csv ]; then
echo "Error: complexity.json or churn.csv not generated."
exit 1
fi
VENV_DIR="./venv"
# Check if venv exists, if not create and activate it
if [ ! -d "$VENV_DIR" ]; then
python3 -m venv $VENV_DIR
fi
source $VENV_DIR/bin/activate
pip install -r requirements.txt
# Run plot.py script
python src/plot.py
# Deactivate the virtual environment
deactivate
echo "Plot generated and saved successfully."