-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add 'stream sharing' feature, allowing avoidance of multiple syn… (#107)
- Loading branch information
1 parent
e61bc53
commit 45f3f06
Showing
4 changed files
with
45 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,23 @@ | ||
# Allow steps to pick up perforce configuration used by the plugin | ||
export P4CONFIG=p4config | ||
export P4CONFIG=p4config | ||
|
||
# Allow sharing of perforce client workspaces for the same stream between pipelines | ||
if [[ "${BUILDKITE_PLUGIN_PERFORCE_SHARE_WORKSPACE}" == true ]] ; then | ||
echo "Workspace sharing enabled" | ||
|
||
STREAM="${BUILDKITE_PLUGIN_PERFORCE_STREAM}" | ||
if [[ -z "${STREAM}" ]] ; then | ||
echo "Error: You must use stream workspaces to enable shared workspaces" >&2 | ||
exit 1 | ||
fi | ||
if [[ "${BUILDKITE_AGENT_META_DATA_AGENT_COUNT}" -gt 1 ]] ; then | ||
echo "Error: You cannot share stream workspaces when running more than one agent" >&2 | ||
exit 1 | ||
fi | ||
# Sanitize //depot/stream-name to __depot_stream-name | ||
SANITIZED_STREAM=$(echo $STREAM | python -c "import sys; print(sys.stdin.read().replace('/', '_'));") | ||
|
||
PERFORCE_CHECKOUT_PATH="${BUILDKITE_BUILD_CHECKOUT_PATH}/../${SANITIZED_STREAM}" | ||
export BUILDKITE_BUILD_CHECKOUT_PATH="${PERFORCE_CHECKOUT_PATH}" | ||
echo "Changed BUILDKITE_BUILD_CHECKOUT_PATH to ${PERFORCE_CHECKOUT_PATH}" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters