|
1 | 1 | name: Open Gauss Batteries Included Devbox |
2 | | -description: Installer-driven Open Gauss template that uses the current checkout when run locally and otherwise clones math-inc/OpenGauss, runs the internal installer, exposes the local guide, and opens a ready Gauss session. |
| 2 | +description: Installer-driven Open Gauss template that uses the current checkout when run locally and otherwise clones math-inc/OpenGauss, runs the internal installer, stages optional provider keys, exposes the local guide, and opens a ready Gauss session. |
3 | 3 | steps: |
4 | 4 | - id: bootstrap-installer-runtime |
5 | 5 | title: Prepare Open Gauss Installer Runtime |
@@ -63,6 +63,90 @@ steps: |
63 | 63 | ./scripts/install-internal.sh --with-workspace --noninteractive |
64 | 64 | . "$HOME/.opengauss-template/runtime.env" |
65 | 65 | "$HOME/.local/bin/gauss-launch-session" --print-summary || true |
| 66 | + - id: optional-openrouter |
| 67 | + title: Optionally Stage OPENROUTER_API_KEY |
| 68 | + type: exportSecret |
| 69 | + name: OPENROUTER_API_KEY |
| 70 | + optional: true |
| 71 | + run: | |
| 72 | + set -euo pipefail |
| 73 | + . "$HOME/.opengauss-template/runtime.env" |
| 74 | + mkdir -p "$GAUSS_HOME" |
| 75 | + touch "$GAUSS_HOME/.env" |
| 76 | + python3 - <<'PY' |
| 77 | + from pathlib import Path |
| 78 | + import os |
| 79 | +
|
| 80 | + env_path = Path(os.environ["GAUSS_HOME"]) / ".env" |
| 81 | + lines = [] |
| 82 | + if env_path.exists(): |
| 83 | + lines = [line for line in env_path.read_text().splitlines() if line and not line.startswith("OPENROUTER_API_KEY=")] |
| 84 | + value = os.environ.get("OPENROUTER_API_KEY") |
| 85 | + if not value: |
| 86 | + raise SystemExit(0) |
| 87 | + lines.append("OPENROUTER_API_KEY=" + value) |
| 88 | + env_path.write_text("\n".join(lines) + "\n") |
| 89 | + PY |
| 90 | + - id: optional-openai |
| 91 | + title: Optionally Stage OPENAI_API_KEY |
| 92 | + type: exportSecret |
| 93 | + name: OPENAI_API_KEY |
| 94 | + optional: true |
| 95 | + run: | |
| 96 | + set -euo pipefail |
| 97 | + . "$HOME/.opengauss-template/runtime.env" |
| 98 | + mkdir -p "$GAUSS_HOME" |
| 99 | + touch "$GAUSS_HOME/.env" |
| 100 | + python3 - <<'PY' |
| 101 | + from pathlib import Path |
| 102 | + import os |
| 103 | +
|
| 104 | + env_path = Path(os.environ["GAUSS_HOME"]) / ".env" |
| 105 | + lines = [] |
| 106 | + if env_path.exists(): |
| 107 | + lines = [line for line in env_path.read_text().splitlines() if line and not line.startswith("OPENAI_API_KEY=")] |
| 108 | + value = os.environ.get("OPENAI_API_KEY") |
| 109 | + if not value: |
| 110 | + raise SystemExit(0) |
| 111 | + lines.append("OPENAI_API_KEY=" + value) |
| 112 | + env_path.write_text("\n".join(lines) + "\n") |
| 113 | + PY |
| 114 | + - id: optional-anthropic |
| 115 | + title: Optionally Stage ANTHROPIC_API_KEY |
| 116 | + type: exportSecret |
| 117 | + name: ANTHROPIC_API_KEY |
| 118 | + optional: true |
| 119 | + run: | |
| 120 | + set -euo pipefail |
| 121 | + . "$HOME/.opengauss-template/runtime.env" |
| 122 | + mkdir -p "$GAUSS_HOME" |
| 123 | + touch "$GAUSS_HOME/.env" |
| 124 | + python3 - <<'PY' |
| 125 | + from pathlib import Path |
| 126 | + import os |
| 127 | +
|
| 128 | + env_path = Path(os.environ["GAUSS_HOME"]) / ".env" |
| 129 | + lines = [] |
| 130 | + if env_path.exists(): |
| 131 | + lines = [line for line in env_path.read_text().splitlines() if line and not line.startswith("ANTHROPIC_API_KEY=")] |
| 132 | + value = os.environ.get("ANTHROPIC_API_KEY") |
| 133 | + if not value: |
| 134 | + raise SystemExit(0) |
| 135 | + lines.append("ANTHROPIC_API_KEY=" + value) |
| 136 | + env_path.write_text("\n".join(lines) + "\n") |
| 137 | + PY |
| 138 | + - id: finalize-provider-selection |
| 139 | + title: Apply Main Provider Selection |
| 140 | + type: command |
| 141 | + run: | |
| 142 | + set -euo pipefail |
| 143 | + . "$HOME/.opengauss-template/runtime.env" |
| 144 | + if [ -f "$GAUSS_HOME/.env" ]; then |
| 145 | + set -a |
| 146 | + . "$GAUSS_HOME/.env" |
| 147 | + set +a |
| 148 | + fi |
| 149 | + "$HOME/.local/bin/gauss-configure-main-provider" auto || true |
66 | 150 | - id: start-guide-server |
67 | 151 | title: Start Guide Iframe Server |
68 | 152 | type: command |
|
0 commit comments