Skip to content

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

@BruceKropp-Raytheon

Description

@BruceKropp-Raytheon

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething is not working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions