-
Notifications
You must be signed in to change notification settings - Fork 183
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
Add custom terraform and bash script to the setup #1020
Conversation
@vsinghal13 Does it meets the given requirements for additional terraform support?
|
4592a05
to
0f680ed
Compare
I updated the behavior and here is example configuration for the feature
|
984a05e
to
70e3bd6
Compare
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.
Overall looks good, although my head is too small for this PR 🤯
target="/scripts/${dir}" | ||
mkdir "${target}" | ||
# shellcheck disable=SC2010 | ||
for file in $(ls "/customer-scripts/${dir}_"* | grep -oE '_.*' | sed 's/_//g'); do |
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.
Ditto here
for file in $(ls "/customer-scripts/${dir}_"* | grep -oE '_.*' | sed 's/_//g'); do | |
for file in $(ls -1 "/customer-scripts/${dir}_"* | grep -oE '_.*' | sed 's/_//g'); do |
for file in $(ls "/customer-scripts/${dir}_"* | grep -oE '_.*' | sed 's/_//g'); do | ||
cp "/customer-scripts/${dir}_${file}" "${target}/${file}" | ||
done | ||
cd "${target}" && ls -al && bash setup.sh && cd .. |
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.
pushd
and popd
instead of using cd
s?
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.
changed to cd
and running the script, no need to revert cwd
for file in $(ls -1 "/customer-scripts/${dir}_"* | grep -oE '_.*' | sed 's/_//g'); do | ||
cp "/customer-scripts/${dir}_${file}" "${target}/${file}" | ||
done | ||
cd "${target}" && bash setup.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.
Ok so this will work but it will keep the changed CWD from the last dir
in the loop hence the directory for the caller will be changed.
To fix that we can e.g. save the dir before the loop and then popd
or cd
to it at the end
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.
I'm operating on absolute paths, so CWD
inside the custom.sh
doesn't impact on anything
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.
👍
131cf77
to
5dcd7be
Compare
5dcd7be
to
f120207
Compare
f120207
to
0e6ebaa
Compare
Description
Testing performed