build.sh 704 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. # Install build deps
  8. apk --no-cache --no-progress add --virtual build-deps build-base linux-pam-dev
  9. # Build Gogs
  10. mkdir -p ${GOPATH}/src/github.com/gogs/
  11. ln -s /app/gogs/build ${GOPATH}/src/github.com/gogs/gogs
  12. cd ${GOPATH}/src/github.com/gogs/gogs
  13. # Needed since git 2.9.3 or 2.9.4
  14. git config --global http.https://gopkg.in.followRedirects true
  15. make build TAGS="sqlite cert pam"
  16. # Cleanup GOPATH
  17. rm -r $GOPATH
  18. # Remove build deps
  19. apk --no-progress del build-deps
  20. # Move to final place
  21. mv /app/gogs/build/gogs /app/gogs/
  22. # Cleanup go
  23. rm -rf /tmp/go
  24. rm -rf /usr/local/go