Skip to content

Commit 75fa821

Browse files
fix: [IMPORTANT] Resolve issues caused by the latest yq version's different parsing behavior, so Set the version to v4.35.1
1 parent 332a22d commit 75fa821

File tree

2 files changed

+19
-6
lines changed

2 files changed

+19
-6
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
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).
66

77
- 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.
8+
- In production, place your project in a separate folder, not in the samples folder, as they are just examples.
99

1010
## Table of Contents
1111
- [Features](#Features)
@@ -48,6 +48,7 @@ Deploying web projects should be [simple, with high availability and security](h
4848
- Do NOT build or run 'local' & 'real' at the same time (There's no reason to do so, but just in case... They have the same name of the image and container)
4949
- You can achieve your goal by running ```bash run.sh```, but when coming across any permission issue run ```sudo bash run.sh```
5050
- I have located the sample folders included in this project; however, I recommend locating your projects in external folders and using absolute paths at all times.
51+
- The latest ``yq`` version causes problems, and has been fixed to ``v4.35.1``.
5152

5253

5354
## Quick Start with Samples

util.sh

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -343,12 +343,24 @@ cache_global_vars() {
343343

344344

345345
check_yq_installed(){
346-
command -v yq >/dev/null 2>&1 ||
347-
{ echo >&2 "[ERROR] yq is NOT installed. Proceed with installing it.";
346+
required_version="4.35.1"
348347

349-
sudo wget -qO /usr/local/bin/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64
350-
sudo chmod a+x /usr/local/bin/yq
351-
}
348+
# Check if yq is installed
349+
if ! command -v yq >/dev/null 2>&1; then
350+
echo >&2 "[ERROR] yq is NOT installed. Please install yq version $required_version manually."
351+
echo >&2 "You can download it from the following URL:"
352+
echo >&2 "https://github.com/mikefarah/yq/releases/download/v$required_version/yq_linux_amd64"
353+
exit 1
354+
else
355+
# Check if installed version is not 4.35.1
356+
installed_version=$(yq --version | grep -oP 'version v\K[0-9.]+')
357+
if [ "$installed_version" != "$required_version" ]; then
358+
echo >&2 "[ERROR] yq version is $installed_version. Please install yq version $required_version manually."
359+
echo >&2 "You can download it from the following URL:"
360+
echo >&2 "https://github.com/mikefarah/yq/releases/download/v$required_version/yq_linux_amd64"
361+
exit 1
362+
fi
363+
fi
352364
}
353365

354366

0 commit comments

Comments
 (0)