Skip to content

Commit 2eaaf38

Browse files
committedDec 7, 2024·
simplified validate.sh script
1 parent d846c1e commit 2eaaf38

File tree

1 file changed

+2
-27
lines changed

1 file changed

+2
-27
lines changed
 

‎backend/infra/srv/scripts/validate.sh

+2-27
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
#!/bin/bash
22
set -e
33

4-
# Default values
5-
DEFAULT_HOST="localhost"
6-
DEFAULT_PORT="8080"
7-
DEFAULT_SERVICE="srv.service"
4+
SERVICE_NAME="srv.service"
85

96
# Function to check if service is running
107
check_service() {
@@ -20,32 +17,10 @@ check_service() {
2017
return 0
2118
}
2219

23-
# Function to check web endpoint
24-
check_web() {
25-
local host=$1
26-
local port=$2
27-
local url="http://${host}:${port}/"
28-
29-
echo "Checking web endpoint at $url..."
30-
if ! curl -s -f --connect-timeout 5 "$url" >/dev/null; then
31-
echo "ERROR: Web service is not responding at $url"
32-
return 1
33-
fi
34-
echo "Web endpoint at $url is accessible"
35-
return 0
36-
}
37-
38-
# Main function
3920
main() {
40-
local host=${1:-$DEFAULT_HOST}
41-
local port=${2:-$DEFAULT_PORT}
42-
local service=${3:-$DEFAULT_SERVICE}
43-
44-
echo "Starting validation with host=$host, port=$port, service=$service"
21+
local service=${3:-$SERVICE_NAME}
4522

46-
# Run checks
4723
check_service "$service" || exit 1
48-
# check_web "$host" "$port" || exit 1
4924

5025
echo "All validations passed successfully"
5126
exit 0

0 commit comments

Comments
 (0)
Please sign in to comment.