-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'refs/heads/community_v2' into test_framework
# Conflicts: # pom.xml
- Loading branch information
Showing
15 changed files
with
317 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,11 @@ | ||
DB_USER= | ||
DB_PASS= | ||
RABBIT_USER= | ||
RABBIT_PASS= | ||
TELEGRAM_BOT_TOKEN= | ||
SPRING_DATASOURCE_URL= | ||
SPRING_JPA_HIBERNATE_DDL_AUTO= | ||
DB_NAME=community | ||
DB_USER=backend | ||
DB_PASS=superstrongpassword | ||
RABBIT_HOST=rabbitmq | ||
RABBIT_USER=community-rabbit | ||
RABBIT_PASS=superstrongpassword | ||
TELEGRAM_BOT_TOKEN=<your_token> | ||
SPRING_DATASOURCE_URL=jdbc:postgresql://db:5432/community | ||
SPRING_JPA_HIBERNATE_DDL_AUTO=update | ||
SERVER_URL=http://localhost:8080 | ||
SPRING_APP_HEALTH_URL=http://localhost:8080/actuator/health |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
version: '3.8' | ||
|
||
services: | ||
prometheus: | ||
image: prom/prometheus | ||
ports: | ||
- "9090:9090" | ||
volumes: | ||
- ./prometheus:/etc/prometheus | ||
command: | ||
- --config.file=/etc/prometheus/prometheus.yml | ||
healthcheck: | ||
test: [ "CMD-SHELL", "curl -f $${SPRING_APP_HEALTH_URL} || exit 1" ] | ||
interval: 30s | ||
timeout: 10s | ||
retries: 3 | ||
|
||
grafana: | ||
image: grafana/grafana | ||
ports: | ||
- "3000:3000" | ||
depends_on: | ||
- prometheus |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
@echo off | ||
setlocal enabledelayedexpansion | ||
|
||
set BASE_DIR=%cd% | ||
set REBUILD_CONTAINERS=false | ||
|
||
rem Check for rebuild flag | ||
if "%1"=="--rebuild" ( | ||
set REBUILD_CONTAINERS=true | ||
) | ||
|
||
rem Function to wait for service | ||
:wait_for_service | ||
set service_name=%1 | ||
set url=%2 | ||
set retry_count=20 | ||
set retry_interval=10 | ||
|
||
echo Waiting for %service_name% to be ready at %url%... | ||
|
||
for /L %%i in (1,1,%retry_count%) do ( | ||
powershell -Command "try { $response = Invoke-WebRequest -Uri %url% -UseBasicParsing; if ($response.StatusCode -eq 200) { exit 0 } } catch { exit 1 }" | ||
if !errorlevel! == 0 ( | ||
echo %service_name% is up! | ||
exit /b 0 | ||
) | ||
echo Waiting for %service_name%... (Attempt %%i/%retry_count%) | ||
timeout /t %retry_interval% >nul | ||
) | ||
|
||
echo Error: %service_name% is not responding at %url% | ||
exit /b 1 | ||
|
||
rem Start ELK stack | ||
echo Starting ELK stack... | ||
docker-compose -f "%BASE_DIR%\elk-compose\docker-compose.yml" up -d | ||
|
||
rem Wait for ELK stack to be up | ||
call :wait_for_service "Elasticsearch" "http://localhost:9200" | ||
if %errorlevel% neq 0 exit /b 1 | ||
call :wait_for_service "Kibana" "http://localhost:5601" | ||
if %errorlevel% neq 0 exit /b 1 | ||
|
||
rem Start app stack | ||
echo Starting app stack... | ||
if "%REBUILD_CONTAINERS%"=="true" ( | ||
docker-compose -f "%BASE_DIR%\docker-compose.yml" up -d --build | ||
) else ( | ||
docker-compose -f "%BASE_DIR%\docker-compose.yml" up -d | ||
) | ||
|
||
rem Wait for the app to be up (modify according to your app's health check) | ||
call :wait_for_service "App" "http://localhost:8080/health" | ||
if %errorlevel% neq 0 exit /b 1 | ||
|
||
rem Start Grafana stack | ||
echo Starting Grafana stack... | ||
docker-compose -f "%BASE_DIR%\monitoring-compose\docker-compose.yml" up -d | ||
|
||
echo All services are up and running! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#!/bin/bash | ||
|
||
function wait_for_service() { | ||
local service_name=$1 | ||
local url=$2 | ||
local retry_count=20 | ||
local retry_interval=10 | ||
|
||
echo "Waiting for $service_name to be ready at $url..." | ||
|
||
for i in $(seq 1 $retry_count); do | ||
if curl -s $url > /dev/null; then | ||
echo "$service_name is up!" | ||
return 0 | ||
fi | ||
echo "Waiting for $service_name... (Attempt $i/$retry_count)" | ||
sleep $retry_interval | ||
done | ||
|
||
echo "Error: $service_name is not responding at $url" | ||
return 1 | ||
} | ||
|
||
BASE_DIR=$(pwd) | ||
REBUILD_CONTAINERS=false | ||
|
||
# Check for rebuild flag | ||
if [[ "$1" == "--rebuild" ]]; then | ||
REBUILD_CONTAINERS=true | ||
fi | ||
|
||
# Start ELK stack | ||
echo "Starting ELK stack..." | ||
docker-compose -f "$BASE_DIR/elk-compose/docker-compose.yml" up -d | ||
|
||
# Wait for ELK stack to be up | ||
wait_for_service "Elasticsearch" "http://localhost:9200" || exit 1 | ||
wait_for_service "Kibana" "http://localhost:5601" || exit 1 | ||
|
||
# Start app stack | ||
echo "Starting app stack..." | ||
if [ "$REBUILD_CONTAINERS" = true ]; then | ||
docker-compose -f "$BASE_DIR/docker-compose.yml" up -d --build | ||
else | ||
docker-compose -f "$BASE_DIR/docker-compose.yml" up -d | ||
fi | ||
|
||
# Wait for the app to be up (modify according to your app's health check) | ||
wait_for_service "App" "http://localhost:8080/health" || exit 1 | ||
|
||
# Start Grafana stack | ||
echo "Starting Grafana stack..." | ||
docker-compose -f "$BASE_DIR/monitoring-compose/docker-compose.yml" up -d | ||
|
||
echo "All services are up and running!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
telegram: | ||
bot: | ||
username: communitystagebot | ||
token: 7483072284:AAEKReYVUKfbCu8i1kQHZW7IuV_W-ejMkCY | ||
|
||
community: | ||
likes-queue: like-events | ||
payment-queue: payment-events | ||
|
||
management: | ||
endpoints: | ||
web: | ||
exposure: | ||
include: info,health,metrics,prometheus | ||
endpoint: | ||
health: | ||
show-details: always | ||
metrics: | ||
enabled: true | ||
prometheus: | ||
enabled: true | ||
|
||
spring: | ||
app: | ||
rabbit: | ||
like-event-queue-name: like-events | ||
payment-event-queue-name: payment-events | ||
jpa: | ||
hibernate: | ||
ddl-auto: create-drop | ||
show-sql: true | ||
flyway: | ||
enabled: false | ||
data: | ||
mongodb: | ||
host: localhost | ||
port: 27017 | ||
database: mydatabase | ||
username: admin | ||
password: admin123 | ||
redis: | ||
url: redis://redis:6379 | ||
datasource: | ||
url: jdbc:postgresql://db:5432/${DB_NAME} | ||
username: ${DB_USER} | ||
password: ${DB_PASS} | ||
rabbitmq: | ||
username: ${RABBIT_USER} | ||
password: ${RABBIT_USER} | ||
|
||
amazon: | ||
s3: | ||
access-key: . | ||
secret-key: . | ||
bucket-name: . | ||
|
||
logging: | ||
level: | ||
root: info | ||
file: | ||
name: logs/community.log | ||
server: | ||
port: 8080 | ||
|
||
paypal: | ||
client: | ||
id: . | ||
secret: . | ||
mode: sandbox |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.