Replace python dependency in entrypoint and quiet repo credential logs
This commit is contained in:
@@ -93,13 +93,13 @@ get_auth_url() {
|
||||
|
||||
log "Initializing Shopify AI App Builder..."
|
||||
|
||||
# Log repository configuration details
|
||||
# Log repository configuration details only when cloning is enabled
|
||||
if [ -n "$REPO_URL" ]; then
|
||||
log "Repository Configuration:"
|
||||
log " URL: ${REPO_URL:-'NOT SET'}"
|
||||
log " Branch: ${REPO_BRANCH:-'NOT SET'}"
|
||||
log " URL: ${REPO_URL}"
|
||||
log " Branch: ${REPO_BRANCH}"
|
||||
log " Directory: ${REPO_DIR}"
|
||||
log " GitHub Username: ${GITHUB_USERNAME:-'NOT SET'}"
|
||||
log " GitHub PAT: ${GITHUB_PAT:+SET (hidden)}${GITHUB_PAT:-NOT SET}"
|
||||
fi
|
||||
|
||||
# Only clone/pull if REPO_URL is set
|
||||
if [ -n "$REPO_URL" ]; then
|
||||
@@ -107,13 +107,6 @@ if [ -n "$REPO_URL" ]; then
|
||||
log "Repository directory: $REPO_DIR"
|
||||
log "Default branch: $REPO_BRANCH"
|
||||
|
||||
# Check if authentication credentials are available
|
||||
if [ -n "$GITHUB_USERNAME" ] && [ -n "$GITHUB_PAT" ]; then
|
||||
log "GitHub authentication credentials found for user: $GITHUB_USERNAME"
|
||||
else
|
||||
log "WARNING: No GitHub authentication credentials found. Private repository access may fail."
|
||||
fi
|
||||
|
||||
# Check if git is available
|
||||
if ! command -v git &> /dev/null; then
|
||||
log "ERROR: git is not available in the container"
|
||||
@@ -229,43 +222,41 @@ ensure_root_opencode_config() {
|
||||
|
||||
log "Writing OpenCode config: ${config_path} (baseURL=${OPENCODE_OLLAMA_BASE_URL}, model=${OPENCODE_OLLAMA_MODEL})"
|
||||
|
||||
python3 - <<'PY' > "$config_path"
|
||||
import json, os
|
||||
node - <<'NODE' > "$config_path"
|
||||
const baseUrl = (process.env.OPENCODE_OLLAMA_BASE_URL || "https://ollama.plugincompass.com").replace(/\/+$/, "");
|
||||
const modelId = process.env.OPENCODE_OLLAMA_MODEL || "qwen3:0.6b";
|
||||
const apiKey = (process.env.OPENCODE_OLLAMA_API_KEY || "").trim();
|
||||
const providerName = process.env.OPENCODE_OLLAMA_PROVIDER || "ollama";
|
||||
|
||||
base_url = (os.environ.get("OPENCODE_OLLAMA_BASE_URL") or "https://ollama.plugincompass.com").rstrip("/")
|
||||
|
||||
model_id = os.environ.get("OPENCODE_OLLAMA_MODEL") or "qwen3:0.6b"
|
||||
api_key = (os.environ.get("OPENCODE_OLLAMA_API_KEY") or "").strip()
|
||||
provider_name = os.environ.get("OPENCODE_OLLAMA_PROVIDER") or "ollama"
|
||||
|
||||
provider_cfg = {
|
||||
"options": {
|
||||
"baseURL": base_url,
|
||||
const providerConfig = {
|
||||
options: {
|
||||
baseURL: baseUrl,
|
||||
},
|
||||
"models": {
|
||||
model_id: {
|
||||
"id": model_id,
|
||||
"name": model_id,
|
||||
"tool_call": True,
|
||||
"temperature": True,
|
||||
}
|
||||
models: {
|
||||
[modelId]: {
|
||||
id: modelId,
|
||||
name: modelId,
|
||||
tool_call: true,
|
||||
temperature: true,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
if (apiKey) {
|
||||
providerConfig.options.apiKey = apiKey;
|
||||
}
|
||||
|
||||
if api_key:
|
||||
provider_cfg["options"]["apiKey"] = api_key
|
||||
|
||||
cfg = {
|
||||
"$schema": "https://opencode.ai/config.json",
|
||||
"model": f"{provider_name}/{model_id}",
|
||||
"small_model": f"{provider_name}/{model_id}",
|
||||
"provider": {
|
||||
provider_name: provider_cfg,
|
||||
const config = {
|
||||
$schema: "https://opencode.ai/config.json",
|
||||
model: `${providerName}/${modelId}`,
|
||||
small_model: `${providerName}/${modelId}`,
|
||||
provider: {
|
||||
[providerName]: providerConfig,
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
print(json.dumps(cfg, indent=2))
|
||||
PY
|
||||
process.stdout.write(`${JSON.stringify(config, null, 2)}\n`);
|
||||
NODE
|
||||
|
||||
chmod 600 "$config_path" 2>/dev/null || true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user