-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: add quotes to variables in shell scripts #340
base: mainline
Are you sure you want to change the base?
chore: add quotes to variables in shell scripts #340
Conversation
3e8d9b7
to
21b72de
Compare
scripts/add_queue_env.sh
Outdated
@@ -1,7 +1,7 @@ | |||
#!/bin/bash | |||
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | |||
|
|||
export ENV_JSON=$(dirname $0)/queue-env.json | |||
export ENV_JSON=$(dirname "$0")/queue-env.jso |
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.
export ENV_JSON=$(dirname "$0")/queue-env.jso | |
export ENV_JSON=$(dirname "$0")/queue-env.json |
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.
Fixed
scripts/run_posix_docker.sh
Outdated
-v "$(pwd)":/code:ro \ | ||
-v "${HOME}"/.aws:/aws \ | ||
--env-file "${TMP_ENV_FILE}" \ | ||
"${ARGS}" \ |
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.
"${ARGS}" \ | |
${ARGS} \ |
I don't think that this one should be quotes. ARGS
is built-up in this script and contains multiple command-line arguments appended together. Quoting this turns that list of args into a single argument.
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.
Fixed
sudo -u agentuser -i "${ENVS}" /home/agentuser/run_agent.sh |
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.
sudo -u agentuser -i "${ENVS}" /home/agentuser/run_agent.sh | |
sudo -u agentuser -i ${ENVS} /home/agentuser/run_agent.sh |
ENVS
is built-up in this script by appending multiple env var definitions together. This needs to be interpreted as multiple args to the shell, so it cannot be quoted.
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.
Fixed
e5a5694
to
e184024
Compare
scripts/run_posix_docker.sh
Outdated
-v $(pwd):/code:ro \ | ||
-v ${HOME}/.aws:/aws \ | ||
--env-file ${TMP_ENV_FILE} \ | ||
--name test_worker_agentss \ |
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.
This looks like an unintended change, right?
This container name is referenced in a few other places:
deadline-cloud-worker-agent/DEVELOPMENT.md
Line 128 in 9367c10
docker exec test_worker_agent /home/agentuser/term_agent.sh |
docker exec -it test_worker_agent /bin/bash |
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.
Yes, that was unintended. Thanks.
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.
Looks like there is still an unintended change from test_worker_agent
→ test_worker_agents
. We should restore the original name (test_worker_agent
)
e184024
to
70d90b1
Compare
Signed-off-by: Charles Moore <[email protected]>
70d90b1
to
6e0550b
Compare
-v $(pwd):/code:ro \ | ||
-v ${HOME}/.aws:/aws \ | ||
--env-file ${TMP_ENV_FILE} \ | ||
--name test_worker_agents \ |
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.
This is still breaks the docker workflows I think. This should now have changed and should actually be test_worker_agent
scripts/run_posix_docker.sh
Outdated
-v $(pwd):/code:ro \ | ||
-v ${HOME}/.aws:/aws \ | ||
--env-file ${TMP_ENV_FILE} \ | ||
--name test_worker_agentss \ |
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.
Looks like there is still an unintended change from test_worker_agent
→ test_worker_agents
. We should restore the original name (test_worker_agent
)
Quality Gate passedIssues Measures |
What was the problem/requirement? (What/Why)
We have a bunch of unquoted variables in our shell scripts
What was the solution? (How)
Add the quotes
What is the impact of this change?
n/a
How was this change tested?
hatch run test
Was this change documented?
No
Is this a breaking change?
No
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.