Skip to content

Commit

Permalink
feat(docker): added entrypoint to optionally run workspace set
Browse files Browse the repository at this point in the history
  • Loading branch information
shinybrar committed Jul 16, 2024
1 parent 3a5eb65 commit 1d89e82
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env bash

# Look for the environment variable named WORKFLOW_WORKSPACE
if [ -z "$WORKFLOW_WORKSPACE" ]; then
echo "WORKFLOW_WORKSPACE not set, skipping workspace set"
fi

# If WORKFLOW_WORKSPACE is set, set the workflow workspace
if [ -n "$WORKFLOW_WORKSPACE" ]; then
echo "Setting workspace to $WORKFLOW_WORKSPACE"
workflow workspace set $WORKFLOW_WORKSPACE
# Check if the workspace was set successfully
if [ $? -ne 0 ]; then
echo "Failed to set workspace to $WORKFLOW_WORKSPACE. Exiting."
exit 1
fi
fi
exec "$@"

0 comments on commit 1d89e82

Please sign in to comment.