install.sh 701 B

1234567891011121314151617181920212223242526272829303132
  1. #!/bin/bash
  2. # backup README
  3. cp README.md DOC.md
  4. # delete this git repo and sync the offical one
  5. rm -rf .git
  6. git clone https://github.com/umap-project/umap.git tmp
  7. rsync -r -L tmp/ .
  8. rm -rf tmp/
  9. # checkout to latest tag
  10. TAG=$(git tag -l | tail -1)
  11. git checkout $TAG
  12. # create two default branch
  13. git switch -c current
  14. git switch -c upstream
  15. # build docker image
  16. chmod +x docker-entrypoint.sh
  17. docker build --tag umap:$TAG .
  18. # initialize directories and
  19. # fix db volume permission to enable backup without root needed
  20. mkdir static uploads db
  21. chown -R 70:$USER db
  22. chmod g=rwx,o-rwx -R db
  23. # setup umap container tagname
  24. sed -i 's/umap:latest/umap:'${TAG}'/g' docker-compose.yml;
  25. docker-compose up -d;