release-website.sh 1000 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #!/bin/bash
  2. # Release website with new Wekan version number
  3. # and new API docs.
  4. # 1) Check that there is only 2 parameters
  5. # of Wekan previous and new version number:
  6. if [ $# -ne 2 ]
  7. then
  8. echo "Syntax with Wekan previous and new version number:"
  9. echo " ./release-website.sh 5.09 5.10"
  10. exit 1
  11. fi
  12. # 2) Go to website directory
  13. cd ~/repos/w/wekan.github.io
  14. # 3) Get latest changes to website
  15. git pull
  16. # 4) Change version number in website
  17. sed -i "s|>v$1<\/span>|>v$2<\/span>|g" install/index.html
  18. # 5) Change version number in API docs index page
  19. cd api
  20. sed -i "s|v$1|v$2|g" index.html
  21. # 6) Create directory for new docs
  22. mkdir v$2
  23. # 7) Go to new docs directory
  24. cd v$2
  25. # 8) Copy new docs from Wekan repo to new docs directory
  26. cp ~/repos/wekan/public/api/* .
  27. # 9) Move wekan.html to index.html
  28. mv wekan.html index.html
  29. # 10) Go to docs repo
  30. cd ~/repos/w/wekan.github.io
  31. # 11) Commit all changes to git and push website changes live
  32. git add --all
  33. git commit -m "v$2"
  34. git push