From 59580e4b0f711ca55e8cb0d73803a4ff8b56352d Mon Sep 17 00:00:00 2001 From: Lauri Ojansivu Date: Sun, 28 Mar 2021 19:28:48 +0300 Subject: [PATCH] Updated release scripts. Thanks to xet7 ! --- releases/clone-release-repos.sh | 30 +++++++++++++++++ releases/maintainer-make-bundle-a.sh | 15 ++++++--- releases/maintainer-make-bundle-o.sh | 19 ++++++++++- releases/maintainer-make-bundle-s.sh | 12 +++++++ releases/node-version.sh | 2 ++ releases/rebuild-docs-install-deps.sh | 20 ------------ releases/rebuild-docs.sh | 40 ++++++++++++++++++++--- releases/release-bundle.sh | 5 ++- releases/release-ondra-1.sh | 16 +++++++++ releases/release-ondra-2.sh | 19 +++++++++++ releases/release-website.sh | 47 +++++++++++++++++++++++++++ releases/release.sh | 24 ++++++++++---- releases/up-a.sh | 15 +++++++++ releases/up-o.sh | 15 +++++++++ releases/up-s.sh | 15 +++++++++ releases/up.sh | 15 +++++++++ 16 files changed, 272 insertions(+), 37 deletions(-) create mode 100755 releases/clone-release-repos.sh create mode 100755 releases/node-version.sh delete mode 100755 releases/rebuild-docs-install-deps.sh create mode 100755 releases/release-website.sh diff --git a/releases/clone-release-repos.sh b/releases/clone-release-repos.sh new file mode 100755 index 000000000..dac9eb1d8 --- /dev/null +++ b/releases/clone-release-repos.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +# With this, clone all release related repos. + +# 1) Check that this script has no parameters +if [ $# -ne 0 ] + then + echo "Syntax, no parameters:" + echo " ./releases/clone-release-repos.sh" + exit 1 +fi + +# 2) Create directories, clone repos +mkdir ../w +cd ../w +git clone git@github.com:wekan/wekan.github.io.git +git clone git@github.com:wekan/wekan-ondra.git +git clone git@github.com:wekan/wekan-gantt-gpl.git + +# 3) Set upstreams +cd wekan-ondra +git remote add upstream https://github.com/wekan/wekan + +cd ../wekan-gantt-gpl +git remote add upstream https://github.com/wekan/wekan + +# 4) Go back to Wekan repo directory +cd ../wekan + +echo "Release repos ondra, gantt-gpl, and website cloned and upstreams set." diff --git a/releases/maintainer-make-bundle-a.sh b/releases/maintainer-make-bundle-a.sh index 98dfa3d99..71ef923a5 100755 --- a/releases/maintainer-make-bundle-a.sh +++ b/releases/maintainer-make-bundle-a.sh @@ -3,6 +3,13 @@ # This script is only for Wekan maintainer to # convert x64 bundle to arm64 bundle. +if [ $# -ne 1 ] + then + echo "Syntax with Wekan version number:" + echo " ./maintainer-make-bundle-a.sh 5.10" + exit 1 +fi + cd ~/repos rm -rf bundle @@ -21,13 +28,11 @@ sudo rm -rf /home/wekan/repos/bundle/programs/server/npm/node_modules/meteor/ost cd bundle/programs/server chmod u+w *.json -npm uninstall fibers node-gyp node-pre-gyp -npm install node-gyp@5.0.4 node-pre-gyp fibers +npm uninstall fibers node-gyp node-pre-gyp @mapbox/node-pre-gyp npm install -npm uninstall fibers node-gyp node-pre-gyp -npm install node-pre-gyp +npm install node-gyp +npm install @mapbox/node-pre-gyp npm install fibers -npm install node-gyp@5.0.4 cd /home/wekan/repos/bundle find . -type d -name '*-garbage*' | xargs rm -rf diff --git a/releases/maintainer-make-bundle-o.sh b/releases/maintainer-make-bundle-o.sh index 4d459a3e5..51004dc4f 100755 --- a/releases/maintainer-make-bundle-o.sh +++ b/releases/maintainer-make-bundle-o.sh @@ -1,3 +1,20 @@ +#!/bin/bash + +# This script is only for Wekan maintainer to +# convert x64 bundle to ppc64le bundle. + +# 1) Check that there is only one parameter +# of Wekan version number + +if [ $# -ne 1 ] + then + echo "Syntax with Wekan version number:" + echo " ./maintainer-make-bundle-o.sh 5.10" + exit 1 +fi + +# 2) Build bundle + cd /home/ubuntu rm -rf bundle #wget https://releases.wekan.team/wekan-$1.zip @@ -7,7 +24,7 @@ chmod u+w *.json cd /home/ubuntu/bundle/programs/server/node_modules/fibers node build.js cd /home/ubuntu -cp -pR /home/ubuntu/node-fibers/bin/linux-ppc64-72-glibc bundle/programs/server/node_modules/fibers/bin/ +#cp -pR /home/ubuntu/node-fibers/bin/linux-ppc64-72-glibc bundle/programs/server/node_modules/fibers/bin/ cd bundle find . -type d -name '*-garbage*' | xargs rm -rf find . -name '*phantom*' | xargs rm -rf diff --git a/releases/maintainer-make-bundle-s.sh b/releases/maintainer-make-bundle-s.sh index 149d51e76..eae1f82f3 100755 --- a/releases/maintainer-make-bundle-s.sh +++ b/releases/maintainer-make-bundle-s.sh @@ -1,3 +1,15 @@ +#!/bin/bash + +# This script is only for Wekan maintainer to +# convert x64 bundle to s390x bundle. + +if [ $# -ne 1 ] + then + echo "Syntax with Wekan version number:" + echo " ./maintainer-make-bundle-s.sh 5.10" + exit 1 +fi + cd /home/linux1 rm -rf bundle unzip wekan-$1.zip diff --git a/releases/node-version.sh b/releases/node-version.sh new file mode 100755 index 000000000..a5089fdba --- /dev/null +++ b/releases/node-version.sh @@ -0,0 +1,2 @@ +#!/bin/bash +cat ~/repos/wekan/Dockerfile | grep NODE_VERSION=v | sed 's|\\||g' - | sed 's| ||g' - | sed 's|NODE_VERSION=v||g' - diff --git a/releases/rebuild-docs-install-deps.sh b/releases/rebuild-docs-install-deps.sh deleted file mode 100755 index 2f6641892..000000000 --- a/releases/rebuild-docs-install-deps.sh +++ /dev/null @@ -1,20 +0,0 @@ -# Extract the OpenAPI specification. - -# Install dependencies. -sudo apt-get install python3-pip -sudo pip3 install -U setuptools wheel -sudo npm install -g api2html -mkdir -p ~/python -cd ~/python -git clone --depth 1 -b master https://github.com/Kronuz/esprima-python -cd ~/python/esprima-python -sudo python3 setup.py install --record files.txt -cd ~/repos/wekan -mkdir -p public/api - -# Generate docs. -python3 ./openapi/generate_openapi.py --release $(git describe --tags --abbrev=0) > ./public/api/wekan.yml -api2html -c ./public/logo-header.png -o ./public/api/wekan.html ./public/api/wekan.yml - -# Copy docs to bundle -#cp -pR ./public/api ~/repos/wekan/.build/bundle/programs/web.browser/app/ diff --git a/releases/rebuild-docs.sh b/releases/rebuild-docs.sh index 2ac46eb34..c7938793f 100755 --- a/releases/rebuild-docs.sh +++ b/releases/rebuild-docs.sh @@ -1,9 +1,41 @@ -# Generate docs. +# Extract the OpenAPI specification. -#mkdir -p public/api -python3 ./openapi/generate_openapi.py --release $(git describe --tags --abbrev=0) > ./public/api/wekan.yml +# 1) Check that there is only one parameter +# of Wekan version number: + +if [ $# -ne 1 ] + then + echo "Syntax with Wekan version number:" + echo " ./rebuild-docs.sh 5.10" + exit 1 +fi + +# 2) If esprima-python directory does not exist, +# install dependencies. + +if [ ! -d ~/python/esprima-python ]; then + sudo apt-get -y install python3-pip + sudo pip3 install -U setuptools wheel + sudo npm install -g api2html + mkdir -p ~/python + cd ~/python + git clone --depth 1 -b master https://github.com/Kronuz/esprima-python + cd ~/python/esprima-python + sudo python3 setup.py install --record files.txt +fi + +# 2) Go to Wekan repo directory +cd ~/repos/wekan + +# 3) Create api docs directory, if it does not exist +if [ ! -d public/api ]; then + mkdir -p public/api +fi + +# 4) Generate docs. +#python3 ./openapi/generate_openapi.py --release $(git describe --tags --abbrev=0) > ./public/api/wekan.yml +python3 ./openapi/generate_openapi.py --release v$1 > ./public/api/wekan.yml api2html -c ./public/logo-header.png -o ./public/api/wekan.html ./public/api/wekan.yml # Copy docs to bundle #cp -pR ./public/api ~/repos/wekan/.build/bundle/programs/web.browser/app/ -#cp -pR ./public/api ~/repos/wekan/.build/bundle/programs/web.browser.legacy/app/ diff --git a/releases/release-bundle.sh b/releases/release-bundle.sh index b6de8d820..309c041a0 100755 --- a/releases/release-bundle.sh +++ b/releases/release-bundle.sh @@ -6,6 +6,9 @@ cd ~/repos/wekan/.build zip -r wekan-$1.zip bundle { + scp ~/repos/wekan/releases/maintainer-make-bundle-a.sh a:/home/wekan/repos/maintainer-make-bundle.sh + scp ~/repos/wekan/releases/maintainer-make-bundle-s.sh s:/home/linux1/maintainer-make-bundle.sh + scp ~/repos/wekan/releases/maintainer-make-bundle-o.sh o:/home/ubuntu/maintainer-make-bundle.sh scp wekan-$1.zip x2:/var/snap/wekan/common/releases.wekan.team/ scp wekan-$1.zip a:/home/wekan/repos/ scp wekan-$1.zip s:/home/linux1/ @@ -14,4 +17,4 @@ zip -r wekan-$1.zip bundle cd .. -echo "Bundle uploaded to x2/a/s/o." +echo "x64 bundle and arm64/s390x/ppc64le build scripts uploaded to x2/a/s/o." diff --git a/releases/release-ondra-1.sh b/releases/release-ondra-1.sh index ee499e8db..986f8f0c0 100755 --- a/releases/release-ondra-1.sh +++ b/releases/release-ondra-1.sh @@ -1,2 +1,18 @@ +#!/bin/bash + +# Release script for wekan-ondra and wekan-gantt-gpl +# part 1. After this merge and fix merge conflicts, and part 2. + +# 1) Check that there is only one parameter +# of Wekan version number: + +if [ $# -ne 1 ] + then + echo "Syntax with Wekan version number:" + echo " ./release-ondra-2.sh 5.10" + exit 1 +fi + +# 2) Get up git fetch upstream git merge upstream/master diff --git a/releases/release-ondra-2.sh b/releases/release-ondra-2.sh index a78cd13e7..7278c08dd 100755 --- a/releases/release-ondra-2.sh +++ b/releases/release-ondra-2.sh @@ -1 +1,20 @@ +#/bin/bash + +# Release script for wekan-ondra and wekan-gantt-gpl +# part 2. Before these, part 1 and merge and fix merge conflicts. + +# 1) Check that there is only one parameter +# of Wekan version number: + +if [ $# -ne 1 ] + then + echo "Syntax with Wekan version number:" + echo " ./release-ondra-2.sh 5.10" + exit 1 +fi + +# 2) Move Wekan version tag to be newest after merge +# and push to repo. +git tag --force v$1 HEAD +git push --tags --force git push --follow-tags diff --git a/releases/release-website.sh b/releases/release-website.sh new file mode 100755 index 000000000..cdf0c60ab --- /dev/null +++ b/releases/release-website.sh @@ -0,0 +1,47 @@ +#!/bin/bash + +# Release website with new Wekan version number +# and new API docs. + +# 1) Check that there is only 2 parameters +# of Wekan previous and new version number: + +if [ $# -ne 2 ] + then + echo "Syntax with Wekan previous and new version number:" + echo " ./release-website.sh 5.09 5.10" + exit 1 +fi + +# 2) Go to website directory +cd ~/repos/w/wekan.github.io + +# 3) Get latest changes to website +git pull + +# 4) Change version number in website +sed -i 's|v$1|v$2|g' index.html + +# 5) Change version number in API docs index page +cd api +sed -i 's|v$1|v$2|g' index.html + +# 6) Create directory for new docs +mkdir v$2 + +# 7) Go to new docs directory +cd v$2 + +# 8) Copy new docs from Wekan repo to new docs directory +cp ~/repos/wekan/public/api/* . + +# 9) Move wekan.html to index.html +mv wekan.html index.html + +# 10) Go to docs repo +cd ~/repos/w/wekan.github.io + +# 11) Commit all changes to git and push website changes live +git add --all +git commit -m "v$2" +git push diff --git a/releases/release.sh b/releases/release.sh index 9dc503d4b..6d8dfe394 100755 --- a/releases/release.sh +++ b/releases/release.sh @@ -1,21 +1,33 @@ -# Usage: ./release.sh 4.37 +#!/bin/bash -# Commit and push version number changes +# Release script for wekan. + +# 1) Check that there is only one parameter +# of Wekan version number: + +if [ $# -ne 1 ] + then + echo "Syntax with Wekan version number:" + echo " ./release.sh 5.10" + exit 1 +fi + +# 2) Commit and push version number changes cd ~/repos/wekan git add --all git commit -m "v$1" git push -# Add release tag +# 3) Add release tag ~/repos/wekan/releases/add-tag.sh v$1 -# Push to repo +# 4) Push to repo git push -# Build Bundle +# 5) Build Bundle ~/repos/wekan/releases/release-bundle.sh $1 -# Build Sandstorm +# 6) Build Sandstorm ~/repos/wekan/releases/release-sandstorm.sh $1 # Build Snap diff --git a/releases/up-a.sh b/releases/up-a.sh index a474a1856..7eebc9270 100755 --- a/releases/up-a.sh +++ b/releases/up-a.sh @@ -1,2 +1,17 @@ +#!/bin/bash + +# 1) Check that there is only one parameter +# of Wekan version number + +if [ $# -ne 1 ] + then + echo "Syntax with Wekan version number:" + echo " ./up-a.sh 5.10" + exit 1 +fi + +# 2) Download release from arm64 build server scp a:/home/wekan/repos/wekan-$1-arm64.zip . + +# 3) Upload arm64 release to download server scp wekan-$1-arm64.zip x2:/var/snap/wekan/common/releases.wekan.team/raspi3/ diff --git a/releases/up-o.sh b/releases/up-o.sh index 3d8368371..6fe939073 100755 --- a/releases/up-o.sh +++ b/releases/up-o.sh @@ -1,2 +1,17 @@ +#!/bin/bash + +# 1) Check that there is only one parameter +# of Wekan version number + +if [ $# -ne 1 ] + then + echo "Syntax with Wekan version number:" + echo " ./up-o.sh 5.10" + exit 1 +fi + +# 2) Download release from ppc64le build server scp o:/home/ubuntu/wekan-$1-ppc64le.zip . + +# 3) Upload ppc64le release to download server scp wekan-$1-ppc64le.zip x2:/var/snap/wekan/common/releases.wekan.team/ppc64le/ diff --git a/releases/up-s.sh b/releases/up-s.sh index dc847add0..37c47c77c 100755 --- a/releases/up-s.sh +++ b/releases/up-s.sh @@ -1,2 +1,17 @@ +#!/bin/bash + +# 1) Check that there is only one parameter +# of Wekan version number + +if [ $# -ne 1 ] + then + echo "Syntax with Wekan version number:" + echo " ./up-s.sh 5.10" + exit 1 +fi + +# 2) Download release from s390x build server scp s:/home/linux1/wekan-$1-s390x.zip . + +# 3) Upload s390x release to download server scp wekan-$1-s390x.zip x2:/var/snap/wekan/common/releases.wekan.team/s390x/ diff --git a/releases/up.sh b/releases/up.sh index d437a9d1a..357e29cf2 100755 --- a/releases/up.sh +++ b/releases/up.sh @@ -1,7 +1,22 @@ #!/bin/bash +# 1) Check that there is only one parameter +# of Wekan version number + +if [ $# -ne 1 ] + then + echo "Syntax with Wekan version number:" + echo " ./maintainer-make-bundle-o.sh 5.10" + exit 1 +fi + +# 2) Install parallel if it's not installed yet sudo apt-get -y install parallel +# 3) Download releases from build servers and +# upload releases to download server, +# all at the same time in parallel. + { ~/repos/wekan/releases/up-a.sh $1 ~/repos/wekan/releases/up-s.sh $1