Skip to content
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

cf ssh needs a PATH, add yum for RedHat #10

Merged
merged 3 commits into from
Jun 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions runner/cf-driver/prepare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,12 @@ install_dependencies () {
# Of course, RedHat/UBI will need more help to add RPM repos with the correct
# version. TODO - RedHat support
echo "[cf-driver] Ensuring git, git-lfs, and curl are installed"
cf ssh "$container_id" -c '(which git && which git-lfs && which curl) || \
cf ssh "$container_id" --request-pseudo-tty \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: what's the pseudo-tty's purpose here?

I do remember you had an issue when you were trying locally and this seemed to have an impact, but w/ the runner it doesn't make a difference for me as far as I can tell.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the request bit is actually being denied. I don't know that for sure, but when I try force... instead it just hangs.

--command 'source /etc/profile && (which git && which git-lfs && which curl) || \
(which apk && apk add git git-lfs curl) || \
(which apt-get && apt-get update && apt-get install -y git git-lfs curl) || \
(echo "Required packages missing and I do not know what to do about it" && exit 1)'
(which yum && yum install git git-lfs curl) || \
(echo "[cf-driver] Required packages missing and install attempt failed" && exit 1)'

# gitlab-runner-helper includes a limited subset of gitlab-runner functionality
# plus Git and Git-LFS. https://s3.dualstack.us-east-1.amazonaws.com/gitlab-runner-downloads/latest/index.html
Expand Down
2 changes: 1 addition & 1 deletion runner/cf-driver/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ if [ -n "${RUNNER_DEBUG-}" ] && [ "$RUNNER_DEBUG" == "true" ]; then
printf "\n=========\n[cf-driver] RUNNER_DEBUG: End command display\n"
fi

if ! cf ssh "$CONTAINER_ID" < "${1}"; then
if ! cf ssh "$CONTAINER_ID" -c "source /etc/profile" < "${1}"; then
# Exit using the variable, to make the build as failure in GitLab
# CI.
exit "$BUILD_FAILURE_EXIT_CODE"
Expand Down