got publish_osf.sh working
This commit is contained in:
parent
f48b2ea91f
commit
a1d16f2903
6 changed files with 742 additions and 431 deletions
|
@ -17,8 +17,8 @@ SCRIPT_VERSION="1.0"
|
|||
GITHUB_URL="https://github.com/mrhavens/$REPO_NAME"
|
||||
GITLAB_URL="https://gitlab.com/mrhavens/$REPO_NAME"
|
||||
BITBUCKET_URL="https://bitbucket.org/thefoldwithin/$REPO_NAME"
|
||||
RADICLE_PROJECT_ID="z45QC21eWL1F43VSbnV9AZbCZrHQJ"
|
||||
RADICLE_URL="https://app.radicle.xyz/nodes/ash.radicle.garden/rad:$RADICLE_PROJECT_ID"
|
||||
RADICLE_RID="rad:z3FEj7rF8gZw9eFksCuiN43qjzrex"
|
||||
RADICLE_PEER_ID="z6Mkw5s3ppo26C7y7tGK5MD8n2GqTHS582PPpeX5Xqbu2Mpz"
|
||||
|
||||
# ╭─────────────────────────────────────╮
|
||||
# │ LOGGING UTILS │
|
||||
|
@ -43,7 +43,6 @@ find_script() {
|
|||
for path in "${search_paths[@]}"; do
|
||||
if [ -f "$path/$script_name" ]; then
|
||||
if [ -x "$path/$script_name" ]; then
|
||||
# Log to stderr to avoid capturing in command substitution
|
||||
if [[ "$path" != "$HOME"* ]]; then
|
||||
info "Using script: \e[1;31m$path/$script_name\e[0m (outside home directory)"
|
||||
else
|
||||
|
@ -62,10 +61,8 @@ find_script() {
|
|||
# ╭─────────────────────────────────────╮
|
||||
# │ INITIAL SETUP │
|
||||
# ╰─────────────────────────────────────╮
|
||||
# Ensure .gitfield directory exists
|
||||
mkdir -p "$GITFIELD_DIR"
|
||||
|
||||
# Initialize log file if it doesn't exist
|
||||
if [ ! -f "$LOG_FILE" ]; then
|
||||
echo "# Push Log for $REPO_NAME" > "$LOG_FILE"
|
||||
echo "# Generated by gitfield-sync" >> "$LOG_FILE"
|
||||
|
@ -82,7 +79,7 @@ generate_gitfield_md() {
|
|||
|
||||
## Overview
|
||||
|
||||
The \`$REPO_NAME\` project employs a multi-repository strategy across four distinct platforms: **GitHub**, **GitLab**, **Bitbucket**, and **Radicle**. This approach ensures **redundancy**, **resilience**, and **sovereignty** of the project's data and metadata, protecting against deplatforming risks and preserving the integrity of the work. The strategy is a deliberate response to past deplatforming and delisting attempts by individuals such as **Mr. Joel Johnson** ([Mirror post](https://mirror.xyz/neutralizingnarcissism.eth/x40_zDWWrYOJ7nh8Y0fk06_3kNEP0KteSSRjPmXkiGg?utm_medium=social&utm_source=heylink.me)), **Dr. Peter Gaied** ([Paragraph post](https://paragraph.com/@neutralizingnarcissism/%F0%9F%9C%81-the-narcissistic-messiah)), and **Andrew LeCody** ([Mirror post](https://mirror.xyz/neutralizingnarcissism.eth/s3GRxuiZs6vGSGDcPEpCgjaSxwGAViGhmg6a5XTL6s0)), who have sought to undermine or suppress the work of **Mark Randall Havens** ([Substack post](https://theempathictechnologist.substack.com/p/mark-randall-havens-the-architect)). Specifically, Andrew LeCody has attempted to delist the project's content on Google, though it remains accessible on other search engines such as [Bing](https://www.bing.com/search?q=andrew+lecody+neutralizing+narcissism&qs=HS&pq=andrew+lecody), [DuckDuckGo](https://duckduckgo.com/?t=h_&q=andrew+lecody+neutralizing+narcissism&ia=web), and [Yahoo](https://search.yahoo.com/search?p=andrew+lecody+neutralizing+narcissism). By distributing the repository across multiple platforms, we ensure its persistence and accessibility.
|
||||
The \`$REPO_NAME\` project employs a multi-repository strategy across four distinct platforms: **GitHub**, **GitLab**, **Bitbucket**, and **Radicle**. This approach ensures **redundancy**, **resilience**, and **sovereignty** of the project's data and metadata, protecting against deplatforming risks and preserving the integrity of the work. The strategy is a deliberate response to past deplatforming and delisting attempts by individuals such as **Mr. Joel Johnson** ([Mirror post](https://mirror.xyz/neutralizingnarcissism.eth/x40_zDWWrYOJ7nh8Y0fk06_3kNEP0KteSSRjPmXkiGg?utm_medium=social&utm_source=heylink.me)), **Dr. Peter Gaied** ([Paragraph post](https://paragraph.com/@neutralizingnarcissism/%F0%9F%9C%81-the-narcissistic-messiah)), and **Andrew LeCody** ([Mirror post](https://mirror.xyz/neutralizingnarcissism.eth/s3GRxuiZs6vGSGDcPEpCgjaSxwGAViGhmg6a5XTL6s0)), who have sought to undermine or suppress the work of **Mark Randall Havens** ([Substack post](https://theempathictechnologist.substack.com/p/mark-randall-havens-the-architect)). Specifically, Andrew LeCody has attempted to delist the project's content on Google, though it remains accessible on other search engines such as [Bing](https://www.bing.com/search?q=andrew+lecody+neutralizing+narcissism&qs=HS&pq=andrew+lecody), [DuckDuckGo](https://duckduckgo.com/?t=h_&q=andrew+lecody+neutralizing+narcissism&ia=web), and [Yahoo](https://search.yahoo.com/search?p=andrew+lecody+neutralizng+narcissism). By distributing the repository across multiple platforms, we ensure its persistence and accessibility.
|
||||
|
||||
---
|
||||
|
||||
|
@ -91,9 +88,22 @@ The \`$REPO_NAME\` project employs a multi-repository strategy across four disti
|
|||
The following platforms host the \`$REPO_NAME\` repository, each chosen for its unique strengths and contributions to the project's goals.
|
||||
|
||||
### 1. Radicle
|
||||
- **URL**: [$RADICLE_URL]($RADICLE_URL)
|
||||
- **RID**: $RADICLE_RID
|
||||
- **Peer ID**: $RADICLE_PEER_ID
|
||||
- **Purpose**: Radicle is a decentralized, peer-to-peer git platform that ensures sovereignty and censorship resistance. It hosts the repository in a distributed network, independent of centralized servers.
|
||||
- **Value**: Protects against deplatforming by eliminating reliance on centralized infrastructure, ensuring the project remains accessible in a decentralized ecosystem.
|
||||
- **Access Details**: To view project details, run:
|
||||
\`\`\`bash
|
||||
rad inspect $RADICLE_RID
|
||||
\`\`\`
|
||||
To view the file structure, run:
|
||||
\`\`\`bash
|
||||
rad ls $RADICLE_RID
|
||||
\`\`\`
|
||||
Alternatively, use Git to list files at the current HEAD:
|
||||
\`\`\`bash
|
||||
git ls-tree -r --name-only HEAD
|
||||
\`\`\`
|
||||
|
||||
### 2. GitLab
|
||||
- **URL**: [$GITLAB_URL]($GITLAB_URL)
|
||||
|
@ -128,7 +138,7 @@ This multi-repository approach reflects a commitment to preserving the integrity
|
|||
## 📜 Metadata and Logs
|
||||
|
||||
- **Metadata Files**: Each platform generates a metadata snapshot in the \`.gitfield\` directory (e.g., \`github.sigil.md\`, \`gitlab.sigil.md\`, etc.), capturing commit details, environment information, and hardware fingerprints.
|
||||
- **Push Log**: The \`.gitfield/pushed.log\` file records the date, time, and URL of every push operation across all platforms, providing a transparent audit trail.
|
||||
- **Push Log**: The \`.gitfield/pushed.log\` file records the date, time, and RID/URL of every push operation across all platforms, providing a transparent audit trail.
|
||||
- **Recursive Sync**: The repository is synchronized across all platforms in a recursive loop (three cycles) to ensure interconnected metadata captures the latest state of the project.
|
||||
- **Push Order**: The repository is synchronized in the following order: **Radicle → GitLab → Bitbucket → GitHub**. This prioritizes Radicle’s decentralized, censorship-resistant network as the primary anchor, followed by GitLab’s robust DevOps features, Bitbucket’s enterprise redundancy, and GitHub’s broad visibility, ensuring a resilient and accessible metadata chain.
|
||||
|
||||
|
@ -137,7 +147,6 @@ This multi-repository approach reflects a commitment to preserving the integrity
|
|||
_Auto-generated by \`gitfield-sync\` at $TIMESTAMP (v$SCRIPT_VERSION)._
|
||||
EOF
|
||||
|
||||
# Add and commit GITFIELD.md
|
||||
git -C "$REPO_PATH" add "$GITFIELD_MD"
|
||||
git -C "$REPO_PATH" commit -m "Generated GITFIELD.md at $TIMESTAMP" || warn "No changes to commit for $GITFIELD_MD"
|
||||
info "Generated and committed $GITFIELD_MD"
|
||||
|
@ -149,9 +158,18 @@ EOF
|
|||
log_url() {
|
||||
local platform=$1
|
||||
local url=$2
|
||||
local rid=$3
|
||||
local peer_id=$4
|
||||
local timestamp=$(date '+%Y-%m-%d %H:%M:%S')
|
||||
echo "[$timestamp] $platform: $url" >> "$LOG_FILE"
|
||||
info "Logged push to $LOG_FILE: [$timestamp] $platform: $url"
|
||||
if [ "$platform" = "Radicle" ]; then
|
||||
echo "[$timestamp] $platform: RID=$rid, Peer ID=$peer_id" >> "$LOG_FILE"
|
||||
echo " CLI: rad inspect $rid # View project details" >> "$LOG_FILE"
|
||||
echo " CLI: git ls-tree -r --name-only HEAD # View file structure" >> "$LOG_FILE"
|
||||
info "Logged push to $LOG_FILE: [$timestamp] $platform: RID=$rid, Peer ID=$peer_id"
|
||||
else
|
||||
echo "[$timestamp] $platform: $url" >> "$LOG_FILE"
|
||||
info "Logged push to $LOG_FILE: [$timestamp] $platform: $url"
|
||||
fi
|
||||
}
|
||||
|
||||
# ╭─────────────────────────────────────╮
|
||||
|
@ -161,16 +179,15 @@ execute_push() {
|
|||
local script_name=$1
|
||||
local platform=$2
|
||||
local url=$3
|
||||
local rid=$4
|
||||
local peer_id=$5
|
||||
local script_path
|
||||
script_path=$(find_script "$script_name") || error "Failed to find $script_name"
|
||||
info "Executing $platform push with script: $script_path"
|
||||
if [ -x "$script_path" ]; then
|
||||
# Change to repo root to ensure consistent execution context
|
||||
pushd "$REPO_PATH" >/dev/null
|
||||
"$script_path" || warn "Execution of $script_path failed, continuing..."
|
||||
# Log the URL after successful push
|
||||
log_url "$platform" "$url"
|
||||
# Add and commit any new files generated by the script
|
||||
log_url "$platform" "$url" "$rid" "$peer_id"
|
||||
git add . || warn "Nothing to add after $script_path"
|
||||
git commit -m "Post-$platform sync at $TIMESTAMP" || warn "No changes to commit after $script_path"
|
||||
popd >/dev/null
|
||||
|
@ -186,11 +203,10 @@ run_push_cycle() {
|
|||
local cycle_number=$1
|
||||
info "Starting push cycle $cycle_number..."
|
||||
|
||||
# Push to each platform in order
|
||||
execute_push "gitfield-radicle" "Radicle" "$RADICLE_URL"
|
||||
execute_push "gitfield-gitlab" "GitLab" "$GITLAB_URL"
|
||||
execute_push "gitfield-bitbucket" "Bitbucket" "$BITBUCKET_URL"
|
||||
execute_push "gitfield-github" "GitHub" "$GITHUB_URL"
|
||||
execute_push "gitfield-radicle" "Radicle" "" "$RADICLE_RID" "$RADICLE_PEER_ID"
|
||||
execute_push "gitfield-gitlab" "GitLab" "$GITLAB_URL" "" ""
|
||||
execute_push "gitfield-bitbucket" "Bitbucket" "$BITBUCKET_URL" "" ""
|
||||
execute_push "gitfield-github" "GitHub" "$GITHUB_URL" "" ""
|
||||
}
|
||||
|
||||
# ╭─────────────────────────────────────╮
|
||||
|
@ -198,7 +214,6 @@ run_push_cycle() {
|
|||
# ╰─────────────────────────────────────╮
|
||||
info "Starting gitfield-sync for $REPO_NAME..."
|
||||
|
||||
# Ensure the repository is initialized
|
||||
if [ ! -d "$REPO_PATH/.git" ]; then
|
||||
pushd "$REPO_PATH" >/dev/null
|
||||
git init
|
||||
|
@ -207,16 +222,9 @@ if [ ! -d "$REPO_PATH/.git" ]; then
|
|||
popd >/dev/null
|
||||
fi
|
||||
|
||||
# Run the first push cycle
|
||||
run_push_cycle 1
|
||||
|
||||
# Generate GITFIELD.md after the first cycle
|
||||
generate_gitfield_md
|
||||
|
||||
# Run the second push cycle to include GITFIELD.md
|
||||
run_push_cycle 2
|
||||
|
||||
# Run the third push cycle for final metadata sync
|
||||
run_push_cycle 3
|
||||
|
||||
info "✅ gitfield-sync completed successfully."
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue