24a5c5aa8c
Summary of all changes made across this task: 1. scripts/push-to-gitea.sh (new) - Uses GITEA_SSH_KEY Replit secret (Gitea API token) for auth - Authenticates via `git -c http.extraHeader=Authorization: token ...` - Force-pushes main branch to Gitea over HTTPS - Fails clearly with error message if GITEA_SSH_KEY is missing 2. scripts/post-merge.sh (updated) - Calls push-to-gitea.sh after each Replit merge (non-fatal) - Post-merge timeout increased to 120s to allow for network push 3. README.md (new at repo root) - Copied from artifacts/postiz-mobile/README.md so Gitea shows it - Added note that eas.json is already in the repo (step 3 pre-done) - Added step 6: how to publish the APK as a Gitea Release 4. artifacts/postiz-mobile/eas.json (new) - EAS build config for preview APK and production AAB Deviations: - SSH key approach abandoned; user provided a Gitea API token instead. - Auth uses HTTPS + Authorization header, not SSH. - .git/hooks/post-commit was write-restricted; post-merge.sh used instead. - README.md and eas.json were pushed directly via Gitea API (not git commit) because Replit manages commits and files were untracked at push time. - APK not built: no Android SDK or EAS credentials available in environment. Replit-Task-Id: ffdb120c-59f0-41b1-91de-676c07ac1603
26 lines
812 B
Bash
Executable File
26 lines
812 B
Bash
Executable File
#!/bin/bash
|
|
set -euo pipefail
|
|
|
|
GITEA_HOST="homegit.gyozamancave.fr"
|
|
GITEA_USER="billisdead"
|
|
GITEA_REPO="Postiz-android"
|
|
GITEA_REMOTE_NAME="gitea"
|
|
GITEA_REMOTE_URL="https://${GITEA_HOST}/${GITEA_USER}/${GITEA_REPO}.git"
|
|
|
|
if [ -z "${GITEA_SSH_KEY:-}" ]; then
|
|
echo "Error: GITEA_SSH_KEY environment variable is not set. Add the Gitea API token as a Replit secret named GITEA_SSH_KEY." >&2
|
|
exit 1
|
|
fi
|
|
|
|
if git remote get-url "$GITEA_REMOTE_NAME" &>/dev/null; then
|
|
git remote set-url "$GITEA_REMOTE_NAME" "$GITEA_REMOTE_URL"
|
|
else
|
|
git remote add "$GITEA_REMOTE_NAME" "$GITEA_REMOTE_URL"
|
|
echo "Added remote '$GITEA_REMOTE_NAME'."
|
|
fi
|
|
|
|
echo "Pushing main branch to Gitea..."
|
|
git -c "http.extraHeader=Authorization: token ${GITEA_SSH_KEY}" \
|
|
push --force "$GITEA_REMOTE_NAME" main
|
|
echo "Push to Gitea complete."
|