Skip to content

Commit aa48ad4

Browse files
committed
feat(scripts): add previous versions to releases in folders e.g. plebones.eth.limo/0.1.1
1 parent 6f79cca commit aa48ad4

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

scripts/deploy.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ if [ -z "${DEPLOY_PASSWORD+xxx}" ]; then echo "DEPLOY_PASSWORD not set" && exit;
1818
# save version
1919
PLEBONES_VERSION=$(node -e "console.log(require('../package.json').version)")
2020
PLEBONES_HTML_NAME="plebones-html-$PLEBONES_VERSION"
21+
PLEBONES_PREVIOUS_VERSIONS=$(git tag | sed 's/v//g' | tr '\n' ' ')
2122

2223
SCRIPT="
2324
# download html
@@ -30,6 +31,21 @@ wget https://github.com/plebbit/plebones/releases/download/v$PLEBONES_VERSION/$P
3031
unzip $PLEBONES_HTML_NAME.zip || exit
3132
rm $PLEBONES_HTML_NAME.zip || exit
3233
34+
# add previous versions as folders e.g. /0.1.1
35+
cd $PLEBONES_HTML_NAME
36+
for PLEBONES_PREVIOUS_VERSION in $PLEBONES_PREVIOUS_VERSIONS
37+
do
38+
# download previous version
39+
PLEBONES_PREVIOUS_VERSION_HTML_NAME="plebones-html-\$PLEBONES_PREVIOUS_VERSION"
40+
echo \$PLEBONES_PREVIOUS_VERSION_HTML_NAME
41+
wget https://github.com/plebbit/plebones/releases/download/v\$PLEBONES_PREVIOUS_VERSION/\$PLEBONES_PREVIOUS_VERSION_HTML_NAME.zip
42+
# extract previous version html
43+
unzip \$PLEBONES_PREVIOUS_VERSION_HTML_NAME.zip
44+
rm \$PLEBONES_PREVIOUS_VERSION_HTML_NAME.zip
45+
mv \$PLEBONES_PREVIOUS_VERSION_HTML_NAME \$PLEBONES_PREVIOUS_VERSION
46+
done
47+
cd ..
48+
3349
# add to ipfs
3450
CID=\`ipfs add --recursive --pin --quieter $PLEBONES_HTML_NAME | tail -n 1\`
3551
ipfs pin add --recursive \"\$CID\"

0 commit comments

Comments
 (0)