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

automation scripts' use of dirname $0 doesn't work in Jenkins jobs #1512

Open
BruceKropp-Raytheon opened this issue Feb 12, 2025 · 0 comments
Labels
bug Something is not working

Comments

@BruceKropp-Raytheon
Copy link

Describe the bug
the bash scripts that use command $(dirname $0) to derive a full path for execution does not work as desired within Jenkins job's execution frames.
In Jenkins jobs, an execution frame to run bash commands creates a temporary script in which to execute the commands. This script is unbound from the workspace, and lives on the host in /tmp/...

So $(dirname $0) always returns "/tmp", which is not the intended path wanted for these scripts:

  • util/weekly_build/SpackStackBuildCache_AllSteps.sh (line 7)
  • util/weekly_build/ShellSetup.sh (line 36)
  • util/weekly_build/06_AppTests.sh (line 25)

To Reproduce
Run util/weekly_build/ShellSetup.sh within a Jenkins job

Expected behavior
executing any of the above scripts in a Jenkins job should find the full path of the target.

System:
Orion

Additional context
Perhaps add a top WORK_DIR global variable that can be referenced instead.

@BruceKropp-Raytheon BruceKropp-Raytheon added the bug Something is not working label Feb 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is not working
Projects
None yet
Development

No branches or pull requests

1 participant