-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathutil.sh
More file actions
executable file
·56 lines (46 loc) · 1.14 KB
/
util.sh
File metadata and controls
executable file
·56 lines (46 loc) · 1.14 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
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/bash
# Color definitions for logging output
RED='\033[1;31m'
GREEN='\033[1;32m'
YELLOW='\033[1;33m'
BLUE='\033[1;34m'
NC='\033[0m' # No Color
# Logging functions
log_info() {
echo -e "$(date +'%Y-%m-%d %H:%M:%S') [INFO] ${BLUE}$*${NC}"
}
log_warn() {
echo -e "$(date +'%Y-%m-%d %H:%M:%S') [WARN] ${YELLOW}$*${NC}"
}
log_error() {
echo -e "$(date +'%Y-%m-%d %H:%M:%S') [ERROR] ${RED}$*${NC}"
}
log_success() {
echo -e "$(date +'%Y-%m-%d %H:%M:%S') [SUCCESS] ${GREEN}$*${NC}"
}
# Hardcoded names in Docker
get_infocompanies_data_model_postgres_container() {
echo "infocompanies-data-model-postgres"
}
# The volume name is different from the container name
get_infocompanies_data_model_postgres_volume() {
echo "infocompanies-data-model_postgres-data"
}
# Nexus
build_nexus_url_with_port() {
local port="$1"
if [[ -z "$port" ]]; then
echo "$NEXUS_URL"
else
echo "${NEXUS_URL}:${port}"
fi
}
build_nexus_username_with_password() {
local username="$1"
local password="$2"
if [[ -z "$username" || -z "$password" ]]; then
echo ""
else
echo "${username}:${password}"
fi
}