-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathentrypoint.sh
51 lines (37 loc) · 1.22 KB
/
entrypoint.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
#!/bin/bash
# Exit immediately if a command exits with a non-zero status
set -e
# Clone the git repository
echo "Cloning the git Test Data repository..."
git clone $GIT_TESTDATA_REPO_URL
echo "Cloning the git Test Cases repository..."
#git clone $GIT_TESTCASES_REPO_URL
#if [ -d "$TARGET_DIR" ]; then
# echo "Directory $TARGET_DIR exists. Removing it."
# rm -rf "$TARGET_DIR"
#fi
source EnvConfig.sh $ENV
# Function to check if a string is a Git URL
is_git_url() {
git ls-remote "$TEST_CASES_PATH" &>/dev/null
return $?
}
# Check if the user provided a GIT URL or a local path
if is_git_url "$TEST_CASES_PATH"; then
echo "Cloning test cases from Git URL: $TEST_CASES_PATH"
git clone "$TEST_CASES_PATH"
TEST_FILES_PATH="$(basename -s .git "$TEST_CASES_PATH")/"
else
echo "Using local test cases from: $TEST_CASES_PATH"
TEST_FILES_PATH="$TEST_CASES_PATH"
fi
# Export the test files path for the application to use
export TEST_FILES_PATH
#git clone --branch $1 $2
# Navigate to the tests directory
#cd /karate-tests
# Run Karate tests
echo "Running Karate tests..."
java -jar KarateAutomation/karate.jar $(basename -s .git "$TEST_FILES_PATH")/*
chown 777 target/*
#scp target [email protected]:/home/ankit