- Add profiles to docker-services to selectively run the additional "Prometheus" and "Grafana" services or not.
- Update Gradle.
This commit is contained in:
parent
68759e3023
commit
1b14a7e554
|
@ -3,6 +3,7 @@ version: '3.3'
|
||||||
services:
|
services:
|
||||||
|
|
||||||
urls_controller:
|
urls_controller:
|
||||||
|
profiles: ["onlyController", "all"]
|
||||||
image: 'pdf_aggregation_service/urls_controller:latest'
|
image: 'pdf_aggregation_service/urls_controller:latest'
|
||||||
ports:
|
ports:
|
||||||
- '1880:1880'
|
- '1880:1880'
|
||||||
|
@ -21,6 +22,7 @@ services:
|
||||||
context: .
|
context: .
|
||||||
|
|
||||||
prometheus:
|
prometheus:
|
||||||
|
profiles: ["all"]
|
||||||
image: 'prom/prometheus:latest'
|
image: 'prom/prometheus:latest'
|
||||||
ports:
|
ports:
|
||||||
- '9090:9090'
|
- '9090:9090'
|
||||||
|
@ -31,6 +33,7 @@ services:
|
||||||
- urls_controller
|
- urls_controller
|
||||||
|
|
||||||
grafana:
|
grafana:
|
||||||
|
profiles: ["all"]
|
||||||
image: 'grafana/grafana:latest'
|
image: 'grafana/grafana:latest'
|
||||||
ports:
|
ports:
|
||||||
- '3000:3000'
|
- '3000:3000'
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
|
||||||
networkTimeout=10000
|
networkTimeout=10000
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
|
|
|
@ -26,7 +26,7 @@ if [[ justInstall -eq 1 && shouldRunInDocker -eq 1 ]]; then
|
||||||
justInstall=0
|
justInstall=0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
gradleVersion="8.1"
|
gradleVersion="8.1.1"
|
||||||
|
|
||||||
if [[ justInstall -eq 0 ]]; then
|
if [[ justInstall -eq 0 ]]; then
|
||||||
|
|
||||||
|
@ -48,11 +48,19 @@ if [[ justInstall -eq 0 ]]; then
|
||||||
gradle clean build
|
gradle clean build
|
||||||
|
|
||||||
if [[ shouldRunInDocker -eq 1 ]]; then
|
if [[ shouldRunInDocker -eq 1 ]]; then
|
||||||
|
|
||||||
|
runPrometheusAndGrafanaContainers=0
|
||||||
|
|
||||||
echo -e "\nBuilding the docker image and running the containers..\n"
|
echo -e "\nBuilding the docker image and running the containers..\n"
|
||||||
sudo docker --version || handle_error "Docker was not found!" 3
|
sudo docker --version || handle_error "Docker was not found!" 3
|
||||||
(sudo mkdir -p "$HOME"/tmp/config && sudo cp ./src/main/resources/application.yml "$HOME"/tmp/config) || true # This also replaces an existing "application.yml".
|
(sudo mkdir -p "$HOME"/tmp/config && sudo cp ./src/main/resources/application.yml "$HOME"/tmp/config) || true # This also replaces an existing "application.yml".
|
||||||
sudo mkdir -p "$HOME"/logs || true
|
sudo mkdir -p "$HOME"/logs || true
|
||||||
(sudo docker compose up --build -d && echo -e "\nThe Urls_Controller, Prometheus and Grafana docker-containers started running.\nWaiting 65 seconds before getting their status..\n") || handle_error "Could not list docker containers!" 4
|
|
||||||
|
if [[ runPrometheusAndGrafanaContainers -eq 1 ]]; then
|
||||||
|
(sudo docker compose --profile all up --build -d && echo -e "\nThe Urls_Controller, Prometheus and Grafana docker-containers started running.\nWaiting 65 seconds before getting their status..\n") || handle_error "Could not list docker containers!" 4
|
||||||
|
else
|
||||||
|
(sudo docker compose --profile onlyController up --build -d && echo -e "\nThe Urls_Controller docker-container started running.\nWaiting 65 seconds before getting its status..\n") || handle_error "Could not list docker containers!" 4
|
||||||
|
fi
|
||||||
# Run in "detached mode" -d (in the background).
|
# Run in "detached mode" -d (in the background).
|
||||||
sleep 65
|
sleep 65
|
||||||
sudo docker ps -a || handle_error "Could not get the status of docker-containers!" 5 # Using -a to get the status of failed containers as well.
|
sudo docker ps -a || handle_error "Could not get the status of docker-containers!" 5 # Using -a to get the status of failed containers as well.
|
||||||
|
|
Loading…
Reference in New Issue