From 32e6ea6b606fd0207decece0d261917ca42327e9 Mon Sep 17 00:00:00 2001 From: "@RubenKelevra" Date: Tue, 28 Jan 2020 19:11:02 +0100 Subject: [PATCH 1/2] hold old versions for 48h after they are updated, to make sure all ipns records are refreshed before releasing --- ipfs-websites/pin-websites.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ipfs-websites/pin-websites.sh b/ipfs-websites/pin-websites.sh index 882e36a..2f67987 100755 --- a/ipfs-websites/pin-websites.sh +++ b/ipfs-websites/pin-websites.sh @@ -36,7 +36,7 @@ project-repos.ipfs.io dnslink.io ' -ipfs-cluster-ctl $@ pin ls > pinset.txt +ipfs-cluster-ctl $@ pin ls | grep -v -e '-outdated-' > pinset.txt for s in $websites; do oldcids=`grep "| $s |" pinset.txt | cut -d ' ' -f 1` @@ -51,8 +51,8 @@ for s in $websites; do pinned=yes fi if [[ -n "$oldcid" && ("$newcid" != "$oldcid") ]]; then - echo "unpinning old version: $oldcid" - ipfs-cluster-ctl $@ pin rm --no-status "$oldcid" + echo "unpinning old version after 48h: $oldcid" + ipfs-cluster-ctl $@ pin add --expire-in '172800s' --no-status --name "${s}-outdated-$(date --utc -Iseconds)" "$oldcid" fi done done From f71079baf7f8f745f66ca8b2f89a149bfb0cc044 Mon Sep 17 00:00:00 2001 From: "@RubenKelevra" Date: Sat, 30 May 2020 05:53:44 +0200 Subject: [PATCH 2/2] implement requested changes --- ipfs-websites/pin-websites.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ipfs-websites/pin-websites.sh b/ipfs-websites/pin-websites.sh index 2f67987..87ed1c8 100755 --- a/ipfs-websites/pin-websites.sh +++ b/ipfs-websites/pin-websites.sh @@ -52,7 +52,7 @@ for s in $websites; do fi if [[ -n "$oldcid" && ("$newcid" != "$oldcid") ]]; then echo "unpinning old version after 48h: $oldcid" - ipfs-cluster-ctl $@ pin add --expire-in '172800s' --no-status --name "${s}-outdated-$(date --utc -Iseconds)" "$oldcid" + ipfs-cluster-ctl $@ pin add --expire-in '48h' --no-status --name "${s}-outdated-$(date --utc -Iseconds)" "$oldcid" fi done done