Files
proxmox/scripts/dev-vm/push-to-gitea.sh
defiQUG fbda1b4beb
Some checks failed
Deploy to Phoenix / deploy (push) Has been cancelled
docs: Ledger Live integration, contract deploy learnings, NEXT_STEPS updates
- ADD_CHAIN138_TO_LEDGER_LIVE: Ledger form done; public code review repo bis-innovations/LedgerLive; init/push commands
- CONTRACT_DEPLOYMENT_RUNBOOK: Chain 138 gas price 1 gwei, 36-addr check, TransactionMirror workaround
- CONTRACT_*: AddressMapper, MirrorManager deployed 2026-02-12; 36-address on-chain check
- NEXT_STEPS_FOR_YOU: Ledger done; steps completable now (no LAN); run-completable-tasks-from-anywhere
- MASTER_INDEX, OPERATOR_OPTIONAL, SMART_CONTRACTS_INVENTORY_SIMPLE: updates
- LEDGER_BLOCKCHAIN_INTEGRATION_COMPLETE: bis-innovations/LedgerLive reference

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 15:46:57 -08:00

36 lines
1.5 KiB
Bash
Executable File

#!/usr/bin/env bash
# Push current repo to Gitea (d-bis org). Uses GITEA_TOKEN for HTTPS auth.
# Usage: GITEA_TOKEN=xxx bash scripts/dev-vm/push-to-gitea.sh
# Or from repo root: GITEA_TOKEN=xxx bash scripts/dev-vm/push-to-gitea.sh
# Run from each project dir, or set REPO_NAME and run from project root.
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
[ -f "$PROJECT_ROOT/.env" ] && set +u && source "$PROJECT_ROOT/.env" 2>/dev/null || true && set -u
GITEA_ORG="${GITEA_ORG:-d-bis}"
GITEA_URL="${GITEA_URL:-https://gitea.d-bis.org}"
# Use current directory if it's a git repo, else use PROJECT_ROOT (proxmox)
if [ -d ".git" ]; then
REPO_NAME="${REPO_NAME:-$(basename "$PWD")}"
elif [ -d "$PROJECT_ROOT/.git" ]; then
cd "$PROJECT_ROOT"
REPO_NAME="${REPO_NAME:-$(basename "$PWD")}"
else
echo "Run from a git repo root (e.g. ~/projects/dbis_core), or set REPO_NAME and run from repo root."
exit 1
fi
if [ -z "${GITEA_TOKEN:-}" ]; then
echo "Set GITEA_TOKEN to push via HTTPS (e.g. from Gitea Settings → Applications)."
exit 1
fi
if ! git remote get-url gitea &>/dev/null; then
git remote add gitea "https://gitea.d-bis.org/${GITEA_ORG}/${REPO_NAME}.git"
fi
# Push using token for auth (URL embeds token for this push only)
BRANCH=$(git branch --show-current)
git push "https://${GITEA_TOKEN}@gitea.d-bis.org/${GITEA_ORG}/${REPO_NAME}.git" "$BRANCH" --set-upstream
echo "Pushed $REPO_NAME (branch $BRANCH) to gitea."