Skip to content

Commit

Permalink
feat: export full path to P4CONFIG file (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
runreal-warman authored May 8, 2024
1 parent 030ecca commit 0e51c3f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 0 additions & 2 deletions hooks/environment

This file was deleted.

12 changes: 12 additions & 0 deletions hooks/pre-checkout
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,15 @@ if [[ "${BUILDKITE_PLUGIN_PERFORCE_SHARE_WORKSPACE}" == true ]]; then
export BUILDKITE_BUILD_CHECKOUT_PATH="${PERFORCE_CHECKOUT_PATH}"
echo "Changed BUILDKITE_BUILD_CHECKOUT_PATH to ${PERFORCE_CHECKOUT_PATH}"
fi

# Setup P4CONFIG var to export the full path to the p4config file
SUBDIR_ROOT="${BUILDKITE_PLUGIN_PERFORCE_SUBDIR_ROOT}"
if [ -z "${SUBDIR_ROOT}" ]; then
P4CONFIG=$(realpath -m "${BUILDKITE_BUILD_CHECKOUT_PATH}/p4config")
else
P4CONFIG=$(realpath -m "${BUILDKITE_BUILD_CHECKOUT_PATH}/${SUBDIR_ROOT}/p4config")
fi

# Allow steps to pick up perforce configuration used by the plugin
export P4CONFIG
echo "P4CONFIG=$P4CONFIG"

0 comments on commit 0e51c3f

Please sign in to comment.