fix docker build
parent
aee37628bd
commit
14c6110367
@ -0,0 +1,30 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ -z "$SSH_KEY_B64" ]; then
|
||||
echo "Environment variable SSH_KEY_B64 is not set. Exiting."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "$SSH_KEY_B64" | base64 -d >> /home/devuser/.ssh/authorized_keys
|
||||
chmod 600 /home/devuser/.ssh/authorized_keys
|
||||
|
||||
export MONGO_DB_DATA=$PYTHAGORA_DATA_DIR/mongodata
|
||||
mkdir -p $MONGO_DB_DATA
|
||||
|
||||
mongod --dbpath "$MONGO_DB_DATA" --bind_ip_all >> $MONGO_DB_DATA/mongo_logs.txt 2>&1 &
|
||||
|
||||
export DB_DIR=$PYTHAGORA_DATA_DIR/database
|
||||
|
||||
chown -R devuser: $PYTHAGORA_DATA_DIR
|
||||
su - devuser -c "mkdir -p $DB_DIR"
|
||||
|
||||
set -e
|
||||
|
||||
su - devuser -c "cd /var/init_data/ && ./on-event-extension-install.sh &"
|
||||
|
||||
echo "Starting ssh server..."
|
||||
|
||||
su - devuser -c "git config --global user.email 'devuser@pythagora.ai'"
|
||||
su - devuser -c "git config --global user.name 'pythagora'"
|
||||
|
||||
/usr/sbin/sshd -D
|
||||
@ -0,0 +1,34 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
# Directory to monitor
|
||||
MONITOR_DIR="$HOME/.vscode-server/cli/servers"
|
||||
PATTERN="Stable-*"
|
||||
EXCLUDE_SUFFIX=".staging"
|
||||
|
||||
# Command to execute when a new directory is detected
|
||||
COMMAND="echo 'New Stable directory detected:'"
|
||||
|
||||
# Ensure inotify-tools is installed
|
||||
if ! command -v inotifywait >/dev/null 2>&1; then
|
||||
echo "Error: inotifywait is not installed. Please install inotify-tools." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Monitor for directory creation
|
||||
echo "Monitoring $MONITOR_DIR for new directories matching $PATTERN..."
|
||||
|
||||
inotifywait -m -e create -e moved_to --format '%f' "$MONITOR_DIR" | while read -r NEW_ITEM; do
|
||||
# Check if the created item matches the pattern
|
||||
if [[ "$NEW_ITEM" == $PATTERN && "$NEW_ITEM" != *$EXCLUDE_SUFFIX ]]; then
|
||||
echo "Detected new directory: $NEW_ITEM"
|
||||
# Run the specified command
|
||||
# $COMMAND "$MONITOR_DIR/$NEW_ITEM"
|
||||
while [ ! -f "$HOME/.vscode-server/cli/servers/$NEW_ITEM/server/bin/code-server" ]; do
|
||||
sleep 1
|
||||
done
|
||||
mkdir -p /pythagora/pythagora-core/workspace/.vscode && printf '{\n "gptPilot.isRemoteWs": true,\n "gptPilot.useRemoteWs": false\n}' > /pythagora/pythagora-core/workspace/.vscode/settings.json
|
||||
$HOME/.vscode-server/cli/servers/$NEW_ITEM/server/bin/code-server --install-extension /var/init_data/pythagora-vs-code.vsix
|
||||
fi
|
||||
done
|
||||
Loading…
Reference in New Issue