Skip to content

Commit

Permalink
Indulge the tool by quoting this path
Browse files Browse the repository at this point in the history
The tool will find the `"$(workspaces.source.path)/source"` (quoted) in
the base non-TA Task, and will replace the `$(workspaces.source.path)`
with `/var/workdir`, so the resulting value will be the value from this
commit. This is analogous to what Tekton Pipelines does for the variable
substitution.
Added so that the base-TA Task can be easily compared to the tool
generated TA Task.
  • Loading branch information
zregvart committed May 21, 2024
1 parent b48193f commit a7c03a3
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ spec:
cp "${WORKSPACE_GIT_AUTH_PATH}/.gitconfig" "${HOME}/.gitconfig"
# Compatibility with kubernetes.io/basic-auth secrets
elif [ -f "${WORKSPACE_GIT_AUTH_PATH}/username" ] && [ -f "${WORKSPACE_GIT_AUTH_PATH}/password" ]; then
HOSTNAME=$(cd /var/workdir/source && git remote get-url origin | awk -F/ '{print $3}')
HOSTNAME=$(cd "/var/workdir/source" && git remote get-url origin | awk -F/ '{print $3}')
echo "https://$(cat ${WORKSPACE_GIT_AUTH_PATH}/username):$(cat ${WORKSPACE_GIT_AUTH_PATH}/password)@$HOSTNAME" > "${HOME}/.git-credentials"
echo -e "[credential \"https://$HOSTNAME\"]\n helper = store" > "${HOME}/.gitconfig"
else
Expand Down

0 comments on commit a7c03a3

Please sign in to comment.