-
Notifications
You must be signed in to change notification settings - Fork 0
Hydrate repo from remote #50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Adds support for hydrating the repository from a remote snapshot URL and ensures project dependencies are installed in the devcontainer.
- Introduce a condition to run
hydrate.sh
in the background whenSNAPSHOT_SAS_URL
is provided. - Log hydration output to
hydration.log
in the workspace. - Append
npm i
at the end of the startup script to install dependencies.
.devcontainer/postStartCommand.sh
Outdated
# Check if SNAPSHOT_SAS_URL was passed, if so run hydrate.sh in background | ||
if [ -n "$SNAPSHOT_SAS_URL" ]; then | ||
WORKSPACE_DIR="/workspaces/spark-template" | ||
SAS_URI="$SNAPSHOT_SAS_URL" /usr/local/bin/hydrate.sh $WORKSPACE_DIR > $WORKSPACE_DIR/hydration.log 2>&1 & |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quote the redirection path to handle potential spaces in the workspace directory, e.g., > "$WORKSPACE_DIR/hydration.log"
.
SAS_URI="$SNAPSHOT_SAS_URL" /usr/local/bin/hydrate.sh $WORKSPACE_DIR > $WORKSPACE_DIR/hydration.log 2>&1 & | |
SAS_URI="$SNAPSHOT_SAS_URL" /usr/local/bin/hydrate.sh $WORKSPACE_DIR > "$WORKSPACE_DIR/hydration.log" 2>&1 & |
Copilot uses AI. Check for mistakes.
.devcontainer/postStartCommand.sh
Outdated
@@ -11,3 +17,5 @@ sudo chown -R node /var/log/ | |||
supervisord | |||
supervisorctl reread | |||
supervisorctl update | |||
|
|||
npm i |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider switching to npm ci
for deterministic installs and ensure it runs in the project root, e.g., cd $WORKSPACE_DIR && npm ci
.
npm i | |
WORKSPACE_DIR="/workspaces/spark-template" | |
cd $WORKSPACE_DIR && npm ci |
Copilot uses AI. Check for mistakes.
@@ -3,6 +3,12 @@ | |||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | |||
"$SCRIPT_DIR/refreshTools.sh" | |||
|
|||
# Check if SNAPSHOT_SAS_URL was passed, if so run hydrate.sh in background | |||
if [ -n "$SNAPSHOT_SAS_URL" ]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We will need some indicator to know when this is finished
No description provided.