build.sh 708 B

12345678910111213141516171819202122232425262728293031
  1. #!/bin/sh
  2. set -x
  3. set -e
  4. # Set temp environment vars
  5. export GOPATH=/tmp/go
  6. export PATH=/usr/local/go/bin:${PATH}:${GOPATH}/bin
  7. # Build Gogs
  8. rm -rf ${GOPATH}/src/github.com/G-Node/gogs
  9. mkdir -p ${GOPATH}/src/github.com/G-Node/
  10. ln -s /app/gogs/build ${GOPATH}/src/github.com/G-Node/gogs
  11. cd ${GOPATH}/src/github.com/G-Node/gogs
  12. # Needed since git 2.9.3 or 2.9.4
  13. git config --global http.https://gopkg.in.followRedirects true
  14. touch *
  15. make bindata
  16. make build TAGS="sqlite cert pam"
  17. # Cleanup GOPATH
  18. #rm -r $GOPATH
  19. # Create git user for Gogs
  20. addgroup git
  21. adduser --home /data/git --shell /bin/sh --ingroup git --disabled-password git
  22. passwd -d git
  23. echo "export GOGS_CUSTOM=${GOGS_CUSTOM}" >> /etc/profile