build.sh 680 B

123456789101112131415161718192021222324252627
  1. #!/bin/sh
  2. set -x
  3. set -e
  4. # Set temp environment vars
  5. export GOPATH=/tmp/go
  6. export PATH=${PATH}:${GOPATH}/bin
  7. export GO15VENDOREXPERIMENT=1
  8. # Install build deps
  9. apk --no-cache --no-progress add --virtual build-deps build-base linux-pam-dev go
  10. # Build Gogs
  11. mkdir -p ${GOPATH}/src/github.com/gogits/
  12. ln -s /app/gogs/ ${GOPATH}/src/github.com/gogits/gogs
  13. cd ${GOPATH}/src/github.com/gogits/gogs
  14. make build TAGS="sqlite cert pam"
  15. # Cleanup GOPATH
  16. rm -r $GOPATH
  17. # Remove build deps
  18. apk --no-progress del build-deps
  19. # Create git user for Gogs
  20. adduser -H -D -g 'Gogs Git User' git -h /data/git -s /bin/bash && passwd -u git
  21. echo "export GOGS_CUSTOM=${GOGS_CUSTOM}" >> /etc/profile