Skip to content

Commit

Permalink
moved HOMEgfs to HOMEGFS_ as it is not used to point to a build to an…
Browse files Browse the repository at this point in the history
… experment which should be its sole purpose, also did a which on gh incase it is not in ~/bin
  • Loading branch information
Terry McGuinness committed Dec 26, 2024
1 parent 8bafe29 commit 8b36793
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions ci/scripts/utils/launch_java_agent.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,14 @@ controller_url="https://jenkins.epic.oarcloud.noaa.gov"
controller_user=${controller_user:-"terry.mcguinness"}
controller_user_auth_token="jenkins_token"

HOMEgfs="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../.." >/dev/null 2>&1 && pwd )"
HOMEGFS_="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../.." >/dev/null 2>&1 && pwd )"
host=$(hostname)

#########################################################################
# Set up runtime environment varibles for accounts on supproted machines
#########################################################################

source "${HOMEgfs}/ush/detect_machine.sh"
source "${HOMEGFS_}/ush/detect_machine.sh"
case ${MACHINE_ID} in
hera | orion | hercules | wcoss2 | gaea)
echo "Launch Jenkins Java Controler on ${MACHINE_ID}";;
Expand All @@ -84,10 +84,10 @@ esac
LOG=lanuched_agent-$(date +%Y%m%d%M).log
rm -f "${LOG}"

source "${HOMEgfs}/ush/module-setup.sh"
module use "${HOMEgfs}/modulefiles"
source "${HOMEGFS_}/ush/module-setup.sh"
module use "${HOMEGFS_}/modulefiles"
module load "module_gwsetup.${MACHINE_ID}"
source "${HOMEgfs}/ci/platforms/config.${MACHINE_ID}"
source "${HOMEGFS_}/ci/platforms/config.${MACHINE_ID}"

JAVA_HOME="${JENKINS_AGENT_LANUCH_DIR}/JAVA/jdk-17.0.10"
if [[ ! -d "${JAVA_HOME}" ]]; then
Expand All @@ -102,7 +102,7 @@ JAVA="${JAVA_HOME}/bin/java"
echo "JAVA VERSION: "
${JAVA} -version

export GH="${HOME}/bin/gh"
export GH=$(which gh || echo "${HOME}/bin/gh")

Check warning

Code scanning / shellcheck

Declare and assign separately to avoid masking return values. Warning

Declare and assign separately to avoid masking return values.

Check notice

Code scanning / shellcheck

'which' is non-standard. Use builtin 'command -v' instead. Note

'which' is non-standard. Use builtin 'command -v' instead.
[[ -f "${GH}" ]] || echo "gh is not installed in ${HOME}/bin"
${GH} --version

Expand Down

0 comments on commit 8b36793

Please sign in to comment.