Skip to content

Commit 812091c

Browse files
Merge branch 'leave-git-commit-sha-on-labels'
2 parents 0977302 + 2ba4d37 commit 812091c

28 files changed

+519
-137
lines changed

.env.example.local

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,11 @@ GOOD_APP_HEALTH_CHECK_PATTERN=xxx
5252
# This is for environment variables for docker-compose-app-${app_env}.
5353
DOCKER_COMPOSE_ENVIRONMENT={"XDEBUG_CONFIG":"idekey=IDE_DEBUG","PHP_IDE_CONFIG":"serverName=laravel-crud-boilerplate"}
5454
DOCKER_BUILD_ARGS={}
55+
DOCKER_BUILD_LABELS=[]
56+
DOCKER_BUILD_SHA_INSERT_GIT_ROOT=
57+
5558
DOCKER_COMPOSE_NGINX_SELECTIVE_VOLUMES=[]
59+
DOCKER_COMPOSE_HOST_VOLUME_CHECK=false
5660

5761
NGINX_CLIENT_MAX_BODY_SIZE=50M
5862

.env.example.real

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,15 @@ GOOD_APP_HEALTH_CHECK_PATTERN=xxx
5454
# This is for environment variables for docker-compose-app-${app_env}.
5555
DOCKER_COMPOSE_ENVIRONMENT={}
5656
DOCKER_BUILD_ARGS={}
57+
DOCKER_BUILD_LABELS=[]
58+
DOCKER_BUILD_SHA_INSERT_GIT_ROOT=
59+
5760
# This is overwritten on docker-compose-${project_name}-${app_env}.yml
5861
DOCKER_COMPOSE_REAL_SELECTIVE_VOLUMES=[]
5962
# This is added on docker-compose-${project_name}-nginx.yml
6063
DOCKER_COMPOSE_NGINX_SELECTIVE_VOLUMES=["./shared/nginx-error-logs:/var/log/nginx"]
61-
64+
# Check if the host folder or file exists
65+
DOCKER_COMPOSE_HOST_VOLUME_CHECK=false
6266

6367
NGINX_CLIENT_MAX_BODY_SIZE=50M
6468

.env.java.local

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,11 @@ DOCKER_COMPOSE_ENVIRONMENT={"TZ":"Asia/Seoul"}
4747
# This goes with "docker build ... in the 'run.sh' script file", and the command always contain "HOST_IP" and "APP_ENV" above.
4848
# docker exec -it CONTAINER_NAME cat /var/log/env_build_args.log
4949
DOCKER_BUILD_ARGS={"DOCKER_BUILDKIT":"1","PROJECT_ROOT_IN_CONTAINER":"/var/www/server/spring-sample-h-auth","APP_ENV":"local"}
50+
DOCKER_BUILD_LABELS=[]
51+
DOCKER_BUILD_SHA_INSERT_GIT_ROOT=
52+
5053
DOCKER_COMPOSE_NGINX_SELECTIVE_VOLUMES=[]
54+
DOCKER_COMPOSE_HOST_VOLUME_CHECK=false
5155

5256
NGINX_CLIENT_MAX_BODY_SIZE=50M
5357

.env.java.real

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,12 @@ DOCKER_COMPOSE_ENVIRONMENT={"TZ":"Asia/Seoul"}
4848
# This goes with "docker build ... in the 'run.sh' script file", and the command always contain "HOST_IP" and "APP_ENV" above.
4949
# docker exec -it CONTAINER_NAME cat /var/log/env_build_args.log
5050
DOCKER_BUILD_ARGS={"DOCKER_BUILDKIT":"1","PROJECT_ROOT_IN_CONTAINER":"/var/www/server/spring-sample-h-auth","APP_ENV":"production"}
51+
DOCKER_BUILD_LABELS=["foo=happy","bar=sad"]
52+
DOCKER_BUILD_SHA_INSERT_GIT_ROOT=
53+
5154
DOCKER_COMPOSE_REAL_SELECTIVE_VOLUMES=["./samples/spring-sample-h-auth/logs:/var/www/files"]
5255
DOCKER_COMPOSE_NGINX_SELECTIVE_VOLUMES=["./shared/nginx-error-logs:/var/log/nginx"]
56+
DOCKER_COMPOSE_HOST_VOLUME_CHECK=false
5357

5458
NGINX_CLIENT_MAX_BODY_SIZE=50M
5559

.env.java.real.commercial.ssl.sample

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,13 @@ DOCKER_COMPOSE_ENVIRONMENT={"TZ":"Asia/Seoul"}
4747
# This goes with "docker build ... in the 'run.sh' script file", and the command always contain "HOST_IP" and "APP_ENV" above.
4848
# 2) ''/var/web/project/spring-sample-h-auth' is here as well
4949
DOCKER_BUILD_ARGS={"DOCKER_BUILDKIT":"1","PROJECT_ROOT_IN_CONTAINER":"/var/www/server/spring-sample-h-auth","FILE_STORAGE_ROOT_IN_CONTAINER":"/var/www/files","JVM_XMS":"2048","JVM_XMX":"4096"}
50+
DOCKER_BUILD_LABELS=["foo.mylabel=happy","bar.mylabel=happy"]
51+
DOCKER_BUILD_SHA_INSERT_GIT_ROOT=/var/www/server/spring-sample-h-auth
5052

5153
# 3) ''/var/web/project/spring-sample-h-auth' is here as well. The thing is you should locate 'application.properties', 'logback-spring.xml', 'yourdomain.com.jks' on the './src/main/resource' folder.
5254
DOCKER_COMPOSE_REAL_SELECTIVE_VOLUMES=["/var/web/files/spring-sample-h-auth:/var/www/files","/var/web/project/spring-sample-h-auth/src/main/resources:/var/www/server/spring-sample-h-auth/src/main/resources"]
5355
DOCKER_COMPOSE_NGINX_SELECTIVE_VOLUMES=["/var/web/files/nginx/spring-sample-h-auth/logs:/var/log/nginx"]
54-
56+
DOCKER_COMPOSE_HOST_VOLUME_CHECK=false
5557

5658
NGINX_CLIENT_MAX_BODY_SIZE=50M
5759

.env.node.local

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,11 @@ GOOD_APP_HEALTH_CHECK_PATTERN=docs
4444
# This is for environment variables for docker-compose-app-${app_env}.
4545
DOCKER_COMPOSE_ENVIRONMENT={"MONGODB_URL":"mongodb://host.docker.internal:27017/node-boilerplate","NODE_ENV":"development"}
4646
DOCKER_BUILD_ARGS={}
47+
DOCKER_BUILD_LABELS=["foo=happy","bar=sad"]
48+
DOCKER_BUILD_SHA_INSERT_GIT_ROOT=
49+
4750
DOCKER_COMPOSE_NGINX_SELECTIVE_VOLUMES=[]
51+
DOCKER_COMPOSE_HOST_VOLUME_CHECK=false
4852

4953
NGINX_CLIENT_MAX_BODY_SIZE=50M
5054

.env.php.local

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,11 @@ DOCKER_COMPOSE_ENVIRONMENT={"XDEBUG_CONFIG":"idekey=IDE_DEBUG","PHP_IDE_CONFIG":
4848
# This goes with "docker build ... in the 'run.sh' script file", and the command always contain "HOST_IP" and "APP_ENV" above.
4949
# docker exec -it CONTAINER_NAME cat /var/log/env_build_args.log
5050
DOCKER_BUILD_ARGS={"SAMPLE":"YAHOO","SAMPLE2":"YAHOO2"}
51-
DOCKER_COMPOSE_NGINX_SELECTIVE_VOLUMES=[]
51+
DOCKER_BUILD_LABELS=["foo=happy","bar=sad"]
52+
DOCKER_BUILD_SHA_INSERT_GIT_ROOT=
5253

54+
DOCKER_COMPOSE_NGINX_SELECTIVE_VOLUMES=[]
55+
DOCKER_COMPOSE_HOST_VOLUME_CHECK=false
5356

5457
NGINX_CLIENT_MAX_BODY_SIZE=50M
5558

.env.php.real

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,15 @@ DOCKER_COMPOSE_ENVIRONMENT={"XDEBUG_CONFIG":"idekey=IDE_DEBUG","PHP_IDE_CONFIG":
4848
# This goes with "docker build ... in the 'run.sh' script file", and the command always contain "HOST_IP" and "APP_ENV" above.
4949
# docker exec -it CONTAINER_NAME cat /var/log/env_build_args.log
5050
DOCKER_BUILD_ARGS={"SAMPLE":"YAHOO","SAMPLE2":"YAHOO2","shared_volume_group_id":"1351","shared_volume_group_name":"laravel-shared-volume-group"}
51+
DOCKER_BUILD_LABELS=["foo=happy","bar=sad"]
52+
# Your Git's commit SHA will be added as a label to DOCKER_BUILD_LABELS when your container is built.
53+
DOCKER_BUILD_SHA_INSERT_GIT_ROOT=
54+
5155
# In the case of "REAL," the project is not synchronized in its entirety. The source codes that are required for only production are injected.
5256
# For SSL, the host folder is recommended to be './.docker/ssl' to be synchronized with 'docker-compose-nginx-original.yml'
5357
DOCKER_COMPOSE_REAL_SELECTIVE_VOLUMES=["./shared/app-error-logs:/var/www/app/storage/logs","./.docker/ssl:/etc/apache2/ssl"]
5458
DOCKER_COMPOSE_NGINX_SELECTIVE_VOLUMES=["./shared/nginx-error-logs:/var/log/nginx"]
59+
DOCKER_COMPOSE_HOST_VOLUME_CHECK=false
5560

5661
NGINX_CLIENT_MAX_BODY_SIZE=50M
5762

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
/shared/system-logs/*
1414
!/shared/system-logs/.gitkeep
1515

16+
/bin/*
17+
!/bin/.gitkeep
18+
19+
1620
**/.idea
1721
/.env
1822
/.env.ready.*

README.md

Lines changed: 68 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,8 @@
22

33
> One Simple Zero-Downtime Blue-Green Deployment with your Dockerfiles
44
5-
Deploying web projects should be [simple, with high availability and security](https://github.com/Andrew-Kang-G/docker-blue-green-runner?tab=readme-ov-file#Quick-Guide-on-Usage).
6-
7-
- Use ``the latest Release version`` OR at least ``tagged versions`` for your production, NOT the latest commit of the 'main' branch.
8-
- In production, place your project in a separate folder, not in the samples folder, as they are just examples.
9-
105
## Table of Contents
6+
- [Process Summary](#process-summary)
117
- [Features](#features)
128
- [Requirements](#requirements)
139
- [Quick Start with Samples](#quick-start-with-samples)
@@ -34,8 +30,7 @@ Deploying web projects should be [simple, with high availability and security](h
3430
- [Consul](#consul)
3531
- [USE_NGINX_RESTRICTION on .env](#use_nginx_restriction-on-env)
3632
- [Advanced](#advanced)
37-
- [Process Summary](#process-summary)
38-
- [Gitlab Container Registry](#gitlab-container-registry)
33+
- [GitLab Container Registry (Production)](#gitlab-container-registry-production)
3934
- [Upload Image (CI/CD Server -> Git)](#upload-image-cicd-server---git)
4035
- [Download Image (Git -> Production Server)](#download-image-git---production-server)
4136
- [Extra Information](#extra-information)
@@ -47,6 +42,44 @@ Deploying web projects should be [simple, with high availability and security](h
4742

4843
---
4944

45+
## Process Summary
46+
47+
- Term Reference
48+
- ``All`` means below is "App", "Nginx", "Consul&Registrator".
49+
- ``(Re)Load`` means ``docker run.... OR docker-compose up``.
50+
- ``State`` is ``Blue`` or ``Green``
51+
- More is on [Terms](#terms)
52+
- Load Consul & Registrator, then the App, and finally Nginx to prevent upstream errors.
53+
54+
55+
```mermaid
56+
graph TD;
57+
A[Initialize and Set Variables] --> B[Backup All Images]
58+
B --> C[Check the .env File Integrity]
59+
C --> D[Build All Images]
60+
D --> E[Create Consul Network]
61+
E --> F{Reload Consul if Required}
62+
F -- Yes --> G[Reload Consul]
63+
F -- No --> H[Load Your App]
64+
G --> H[Load Your App]
65+
H --> I[Check App Integrity]
66+
I --> J{Reload Nginx if Required}
67+
J -- Yes --> K[Check Nginx Template Integrity by Running a Test Container]
68+
J -- No --> L[Check All Containers' Health]
69+
K --> L[Check All Containers' Health]
70+
L --> M{Set New State Using Consul Template}
71+
M -- Fails --> O[Run Nginx Contingency Plan]
72+
M -- Success --> N[External Integrity Check]
73+
O --> N[External Integrity Check]
74+
N -- Fails --> P[Rollback App if Needed]
75+
N -- Success --> Q["Remove the Opposite State (Blue or Green) from the Running Containers"]
76+
P --> Q["Remove the Opposite State from the Running Containers"]
77+
Q --> R[Clean Up Dangling Images]
78+
R --> S[Deployment Complete]
79+
80+
```
81+
![img5.png](/documents/images/img5.png)
82+
![img6.png](documents/images/img6.png)
5083
## Features
5184

5285
- **No Unpredictable Errors in Reverse Proxy and Deployment**
@@ -58,6 +91,7 @@ Deploying web projects should be [simple, with high availability and security](h
5891

5992
- **From Scratch**
6093
- Docker-Blue-Green-Runner's `run.sh` script is designed to simplify deployment: "With your `.env`, project, and a single Dockerfile, simply run 'bash run.sh'." This script covers the entire process from Dockerfile build to server deployment from scratch.
94+
- This means you can easily migrate to another server with just the files mentioned above.
6195
- In contrast, Traefik requires the creation and gradual adjustment of various configuration files, which can introduce the types of errors mentioned above.
6296

6397
- Focus on zero-downtime deployment on a single machine.
@@ -105,10 +139,10 @@ Deploying web projects should be [simple, with high availability and security](h
105139
| git | N/A | Manual | - |
106140
| bash | 4.4 at least | Manual | - |
107141
| curl | N/A | Manual | - |
108-
| yq | 4.35.1 | Manual | Use v4.35.1 instead of the latest version. The lastest version causes a parsing error |
142+
| yq | 4.35.1 | Auto | Use v4.35.1 instead of the latest version. The lastest version causes a parsing error |
109143
| consul (docker image) | 1.14.11 | Auto | An error occurred due to a payload format issue while the lastest version of it was communicating with gliderlabs/registrator. |
110144
| gliderlabs/registrator (docker image) | master | Auto | |
111-
| nginx (docker image) | latest | Auto | Considering changing it to a certain version, but until now no issues have been detected. |
145+
| nginx (docker image) | 1.25.4 | Auto | Considering changing it to a certain version, but until now no issues have been detected. |
112146
| docker | 24~27 | Manual | I think too old versions could cause problems, and the lastest version v27.x causes only a warning message. |
113147
| docker-compose | 2 | Manual | I think too old versions could cause problems, and the v2 is recommended. |
114148

@@ -273,9 +307,9 @@ sudo bash run.sh
273307
- ```shell
274308
APP_URL=http://localhost:<--!host-port-number!-->
275309
PROJECT_PORT=<--!common-port-number!--> OR
276-
PROJECT_PORT=[<--!host-port-number!-->,<--!new-project-port-number!-->]
310+
PROJECT_PORT=[<--!host-port-number!-->,<--!internal-project-port-number!-->]
277311
```
278-
- Additionally, the APP_URL parameter is used for 'check_availability_out_of_container' at [Structure](#Structure)
312+
- Additionally, the `APP_URL` parameter is used for the ["External Integrity Check"](#process-summary) process.
279313
- You can set it as https://localhost:13000 or https://your-domain:13000 for production environments. (Both configurations are acceptable)
280314
- Moreover, the Runner parses the protocol (http or https), and if it is https, it checks for SSL certificates in the .docker/ssl directory on the host according to the following settings:
281315
- ```shell
@@ -288,9 +322,23 @@ sudo bash run.sh
288322
# Set this to 'real' in the .env file for production environments.
289323
APP_ENV=real
290324
325+
# This path is used for both internal and external health checks.
326+
# Note: Do not include a leading slash ("/") at the start of the path.
327+
# Example: "api/v1/health" (correct), "/api/v1/health" (incorrect)
328+
APP_HEALTH_CHECK_PATH=api/v1/health
329+
330+
# The BAD & GOOD conditions are checked using an "AND" condition.
331+
# To ignore the "BAD_APP_HEALTH_CHECK_PATTERN", set it to a non-existing value (e.g., "###lsdladc").
332+
BAD_APP_HEALTH_CHECK_PATTERN=DOWN
333+
334+
# Pattern required for a successful health check.
335+
GOOD_APP_HEALTH_CHECK_PATTERN=UP
336+
337+
291338
# The 'real' setting requires defining 'DOCKER_COMPOSE_REAL_SELECTIVE_VOLUMES'.
292339
DOCKER_COMPOSE_REAL_SELECTIVE_VOLUMES=["/my-host/files/:/in-container/files", "/my-host/java-spring-project/src/main/resources:/in-container/java-spring-project/src/main/resources"]
293-
340+
# Check if the host folder or file exists
341+
DOCKER_COMPOSE_HOST_VOLUME_CHECK=false
294342
# If APP_ENV is set to 'local', as specified in 'docker-compose-app-local-original.yml', synchronize your entire project as follows: "HOST_ROOT_LOCATION:PROJECT_LOCATION".
295343
# [IMPORTANT] If this is set to true, Nginx will be restarted, resulting in a short downtime.
296344
# This option should be used when upgrading the Runner. See the "Upgrade" section below.
@@ -299,6 +347,10 @@ NGINX_RESTART=false
299347
# Setting this to 'true' is not recommended for normal operation as it results in prolonged downtime.
300348
CONSUL_RESTART=false
301349
350+
# Specify the location of the .git folder for your project here to enable tracking through container labels.
351+
# To track, simply run `bash check-current_states.sh`.
352+
DOCKER_BUILD_SHA_INSERT_GIT_ROOT=
353+
302354
# Not recommended for normal operation as it leads to a long downtime.
303355
# If this is set to true, it entails running 'stop-all-containers.sh & remove-all-images.sh'.
304356
# In case your project is renamed or moved to another folder, Docker may not work properly.
@@ -402,6 +454,8 @@ bash check-current-states.sh
402454
[DEBUG] ! Checked which (Blue OR Green) is currently running... (Final Check) : blue_score : 130, green_score : 27, state : blue, new_state : green, state_for_emergency : blue, new_upstream : https://PROJECT_NAME:8300.
403455
```
404456
- The higher the score a state receives, the more likely it is to be the currently running state. So the updated App should be deployed as the non-occupied state(new_state).
457+
458+
- ![img6.png](documents/images/img6.png)
405459

406460
### Emergency
407461
- Nginx (like when Nginx is NOT booted OR 502 error...)
@@ -491,44 +545,9 @@ bash check-source-integrity.sh
491545
- **For the properties of 'environment, volumes', use .env instead of setting them on the yml.**
492546
- Set ```USE_MY_OWN_APP_YML=true``` on .env
493547
- ```bash run.sh```
494-
495-
## Process Summary
496-
497-
- Term Reference
498-
- ``All`` means below is "App", "Nginx", "Consul&Registrator".
499-
- ``(Re)Load`` means ``docker run.... OR docker-compose up``.
500-
- ``State`` is ``Blue`` or ``Green``
501-
- More is on [Terms](#terms)
502-
- Load Consul & Registrator, then the App, and finally Nginx to prevent upstream errors.
503548
504549
505-
```mermaid
506-
graph TD;
507-
A[Initialize and Set Variables] --> B[Backup All Images]
508-
B --> C[Check the .env File Integrity]
509-
C --> D[Build All Images]
510-
D --> E[Create Consul Network]
511-
E --> F{Reload Consul if Required}
512-
F -- Yes --> G[Reload Consul]
513-
F -- No --> H[Load Your App]
514-
G --> H[Load Your App]
515-
H --> I[Check App Integrity]
516-
I --> J{Reload Nginx if Required}
517-
J -- Yes --> K[Check Nginx Template Integrity by Running a Test Container]
518-
J -- No --> L[Check All Containers' Health]
519-
K --> L[Check All Containers' Health]
520-
L --> M{Set New State Using Consul Template}
521-
M -- Fails --> O[Run Nginx Contingency Plan]
522-
M -- Success --> N[External Integrity Check]
523-
O --> N[External Integrity Check]
524-
N -- Fails --> P[Rollback App if Needed]
525-
N -- Success --> Q["Remove the Opposite State (Blue or Green) from the Running Containers"]
526-
P --> Q["Remove the Opposite State from the Running Containers"]
527-
Q --> R[Clean Up Dangling Images]
528-
R --> S[Deployment Complete]
529-
530-
```
531-
## Gitlab Container Registry
550+
## Gitlab Container Registry (Production)
532551
533552
### Upload Image (CI/CD Server -> Git)
534553
- In case you run the command ``push-to-git.sh``, ``docker-blue-green-runner`` pushes one of ``Blue or Green`` images which is currently running to the address above of the Gitlab Container Registry.
@@ -593,4 +612,4 @@ git status # If any changes are detected, the source code may be corrupted.
593612
docker swarm init
594613
sudo bash run.sh
595614
```
596-
---
615+
---

apply-security.sh

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22
set -eu
33

44
source use-common.sh
5+
56
check_bash_version
67
check_gnu_grep_installed
78
check_gnu_sed_installed
9+
check_yq_installed
810
check_git_docker_compose_commands_exist
911

1012
cache_global_vars
@@ -32,7 +34,24 @@ sudo chmod 750 *.sh || echo "[WARN] Running chmod 750 *.sh failed."
3234
sudo chmod 770 *.yml || echo "[WARN] Running chmod 770 *.yml failed."
3335
sudo chmod 740 .env.* || echo "[WARN] Running chmod 740 .env.* failed."
3436
sudo chmod 740 .env || echo "[WARN] Running chmod 740 .env failed."
37+
sudo chmod -R 750 bin || echo "[WARN] Running chmod 750 for the bin folder"
3538
sudo chmod 770 .gitignore || echo "[WARN] Running chmod 770 .gitignore failed."
3639
sudo chmod -R 770 .docker/ || echo "[WARN] Running chmod -R 770 .docker/ failed."
37-
sudo chown -R 0:${shared_volume_group_id} .docker/ || echo "[WARN] Running chgrp ${shared_volume_group_id} .docker/ failed."
38-
set_safe_filemode_on_app
40+
# Check if the OS is not Darwin (macOS) before running the command
41+
if [[ "$(uname)" != "Darwin" ]]; then
42+
sudo chown -R 0:${shared_volume_group_id} .docker/ || echo "[WARN] Running chgrp ${shared_volume_group_id} .docker/ failed."
43+
else
44+
echo "[NOTICE] Skipping chown command on Darwin (macOS) platform. See the README."
45+
fi
46+
47+
if [[ "$(uname)" != "Darwin" ]]; then
48+
sudo chown -R 0:${shared_volume_group_id} bin/ || echo "[WARN] Running chgrp ${shared_volume_group_id} bin/ failed."
49+
else
50+
echo "[NOTICE] Skipping chown command on Darwin (macOS) platform. See the README."
51+
fi
52+
53+
if [[ "$(uname)" != "Darwin" ]]; then
54+
set_safe_filemode_on_app
55+
else
56+
echo "[NOTICE] Skipping chown command on Darwin (macOS) platform. See the README."
57+
fi

bin/.gitkeep

Whitespace-only changes.

check-current-states.sh

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,26 @@
22
set -eu
33

44
source use-common.sh
5+
56
check_bash_version
67
check_gnu_grep_installed
78
check_gnu_sed_installed
9+
check_yq_installed
810
check_git_docker_compose_commands_exist
911

12+
# Load global variables
13+
cache_global_vars
14+
15+
# Define container name
16+
container_name="${project_name}-${state}"
17+
18+
echo "[NOTICE] Project Name: ${project_name}"
19+
display_emphasized_message "[NOTICE] Current State: ${state}"
20+
display_emphasized_message "[NOTICE] Container Name: ${container_name}"
21+
22+
23+
# Call the function
24+
display_emphasized_message "$(print_git_sha_and_message "$container_name" "$docker_build_sha_insert_git_root")"
1025

11-
cache_global_vars
26+
# echo "[NOTICE] All labels inside the Container $container_name"
27+
# docker inspect -f '{{json .Config.Labels}}' "$container_name" 2>/dev/null | yq -P

0 commit comments

Comments
 (0)