-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
chore: Update Docker Compose command and add deployment script #26
base: main
Are you sure you want to change the base?
Conversation
# Update Nginx configuration to route traffic to new stack | ||
sed -i "s/proxy_pass http:\/\/web:$current_backend_port/proxy_pass http:\/\/web:$new_backend_port/" nginx.conf | ||
sed -i "s/proxy_pass http:\/\/frontend:$current_frontend_port/proxy_pass http:\/\/frontend:$new_frontend_port/" nginx.conf | ||
docker service update --force $STACK_NAME-$new_color_nginx |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue identified by ShellCheck is related to the lack of double quotes around the variable $STACK_NAME-$new_color_nginx
. Without quotes, if the variable contains spaces or special characters, it could lead to unexpected behavior due to globbing (filename expansion) or word splitting.
To fix this issue, you should wrap the variable in double quotes. Here is the corrected line:
docker service update --force $STACK_NAME-$new_color_nginx | |
docker service update --force "$STACK_NAME-$new_color_nginx" |
This comment was generated by an experimental AI tool.
set -e | ||
|
||
# Configuration | ||
REPO_URL="https://github.com/miskibin/sejm-stats.git" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue identified by ShellCheck is that the variable REPO_URL
is defined but not used anywhere within the script. This can be problematic as it might indicate unnecessary code or potential mistakes where the variable was intended to be used but was forgotten.
To fix this, you should either use the REPO_URL
variable somewhere in your script or remove it if it's not needed. If the intention was to use REPO_URL
for cloning the repository, you should add the appropriate command.
Here’s a single line change to use REPO_URL
for cloning the repository:
REPO_URL="https://github.com/miskibin/sejm-stats.git" | |
git clone "$REPO_URL" "$REPO_PATH" |
This line should be added at the appropriate place in your script where the repository needs to be cloned.
This comment was generated by an experimental AI tool.
|
||
sed -e "s/BACKEND_PORT_PLACEHOLDER/$backend_port/g" \ | ||
-e "s/FRONTEND_PORT_PLACEHOLDER/$frontend_port/g" \ | ||
docker-compose.yml > docker-compose-$color.yml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue identified by ShellCheck is related to the use of unquoted variables, which can lead to unintended globbing (filename expansion) and word splitting. In this case, the variable $color
is not quoted, which means if it contains spaces or special characters, it could cause unexpected behavior.
To fix this issue, you should add double quotes around the variable to ensure it is treated as a single word and to prevent any unwanted expansions.
Here's the suggested code change:
docker-compose.yml > docker-compose-$color.yml | |
sed -e "s/BACKEND_PORT_PLACEHOLDER/$backend_port/g" -e "s/FRONTEND_PORT_PLACEHOLDER/$frontend_port/g" docker-compose.yml > "docker-compose-$color.yml" |
This comment was generated by an experimental AI tool.
sed -e "s/BACKEND_PORT_PLACEHOLDER/$backend_port/g" \ | ||
-e "s/FRONTEND_PORT_PLACEHOLDER/$frontend_port/g" \ | ||
docker-compose.yml > docker-compose-$color.yml | ||
docker stack deploy -c docker-compose-$color.yml $STACK_NAME-$color |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue identified by ShellCheck is related to the potential for word splitting and globbing, which can occur when variables are not properly quoted. In the line docker stack deploy -c docker-compose-$color.yml $STACK_NAME-$color
, the variables $color
and $STACK_NAME
should be enclosed in double quotes to prevent unintended behavior if they contain spaces or special characters.
Here's the suggested fix:
docker stack deploy -c docker-compose-$color.yml $STACK_NAME-$color | |
docker stack deploy -c "docker-compose-$color.yml" "$STACK_NAME-$color" |
This comment was generated by an experimental AI tool.
Checklist before requesting a review
guidelines and standards
Change Description
How Has This Been Tested?
Does this PR introduce a breaking change?
Related Issue
Does this change resolve any open issues?
Fixes #(issue number)