Skip to content

Commit

Permalink
Double quote variables
Browse files Browse the repository at this point in the history
This is to to prevent globs and multiple shell words being interpreted
where one is expected.
  • Loading branch information
zregvart committed May 2, 2024
1 parent 4bf6a19 commit ceca0a0
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions hack/build-and-push.sh
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,14 @@ find task/*/*/ -maxdepth 0 -type d | awk -F '/' '{ print $0, $2, $3 }' | \
while read -r task_dir task_name task_version
do
prepared_task_file="${WORKDIR}/$task_name-${task_version}.yaml"
if [ -f $task_dir/$task_name.yaml ]; then
cp $task_dir/$task_name.yaml $prepared_task_file
task_file_sha=$(git log -n 1 --pretty=format:%H -- $task_dir/$task_name.yaml)
elif [ -f $task_dir/kustomization.yaml ]; then
oc kustomize $task_dir > $prepared_task_file
task_file_sha=$(sha256sum $prepared_task_file | awk '{print $1}')
if [ -f "$task_dir/$task_name.yaml" ]; then
cp "$task_dir/$task_name.yaml" "$prepared_task_file"
task_file_sha=$(git log -n 1 --pretty=format:%H -- "$task_dir/$task_name.yaml")
elif [ -f "$task_dir/kustomization.yaml" ]; then
oc kustomize "$task_dir" > "$prepared_task_file"
task_file_sha=$(sha256sum "$prepared_task_file" | awk '{print $1}')
else
echo Unknown task in $task_dir
echo Unknown task in "$task_dir"
continue
fi
repository=${TEST_REPO_NAME:-task-${task_name}}
Expand Down

0 comments on commit ceca0a0

Please sign in to comment.