Create entrypoint.sh
Browse files- entrypoint.sh +25 -0
entrypoint.sh
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
set -e
|
| 3 |
+
|
| 4 |
+
# 1. Inject Git Credentials for seamless GitHub pushing
|
| 5 |
+
if [ -n "$GITHUB_TOKEN" ] && [ -n "$GITHUB_USER" ]; then
|
| 6 |
+
git config --global credential.helper store
|
| 7 |
+
git config --global user.name "$GITHUB_USER"
|
| 8 |
+
git config --global user.email "$GITHUB_USER@users.noreply.github.com"
|
| 9 |
+
echo "https://${GITHUB_USER}:${GITHUB_TOKEN}@github.com" > ~/.git-credentials
|
| 10 |
+
echo "Git credentials configured."
|
| 11 |
+
fi
|
| 12 |
+
|
| 13 |
+
# 2. Link OpenCode config to our persistent directory
|
| 14 |
+
export XDG_CONFIG_HOME="/workspace/config"
|
| 15 |
+
export OPENCODE_CONFIG_DIR="/workspace/config/opencode"
|
| 16 |
+
mkdir -p $OPENCODE_CONFIG_DIR
|
| 17 |
+
|
| 18 |
+
# 3. Start background config sync to HF Dataset
|
| 19 |
+
if [ -n "$HF_TOKEN" ] && [ -n "$HF_DATASET_REPO" ]; then
|
| 20 |
+
python /sync_config.py &
|
| 21 |
+
fi
|
| 22 |
+
|
| 23 |
+
# 4. Launch OpenChamber
|
| 24 |
+
echo "Starting OpenChamber on port 7860..."
|
| 25 |
+
PORT=7860 openchamber --host 0.0.0.0 --workspace /workspace/projects
|