Skip to content

Commit

Permalink
fix: [IMPORTANT] Resolve issues caused by the latest yq version's dif…
Browse files Browse the repository at this point in the history
…ferent parsing behavior, so Set the version to v4.35.1
  • Loading branch information
patternhelloworld committed Sep 30, 2024
1 parent 332a22d commit 75fa821
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
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).

- Use ``the latest Release version`` OR at least ``tagged versions`` for your production, NOT the latest commit of the 'main' branch.
- In production, place your project in a separate folder, not in the samples folder, as they are just examples.
- In production, place your project in a separate folder, not in the samples folder, as they are just examples.

## Table of Contents
- [Features](#Features)
Expand Down Expand Up @@ -48,6 +48,7 @@ Deploying web projects should be [simple, with high availability and security](h
- 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)
- You can achieve your goal by running ```bash run.sh```, but when coming across any permission issue run ```sudo bash run.sh```
- 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.
- The latest ``yq`` version causes problems, and has been fixed to ``v4.35.1``.


## Quick Start with Samples
Expand Down
22 changes: 17 additions & 5 deletions util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -343,12 +343,24 @@ cache_global_vars() {


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

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


Expand Down

0 comments on commit 75fa821

Please sign in to comment.