You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
923 B

  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. # Install glide
  11. git clone -b 0.10.2 https://github.com/Masterminds/glide ${GOPATH}/src/github.com/Masterminds/glide
  12. cd ${GOPATH}/src/github.com/Masterminds/glide
  13. make build
  14. go install
  15. # Build Gogs
  16. mkdir -p ${GOPATH}/src/github.com/gogits/
  17. ln -s /app/gogs/ ${GOPATH}/src/github.com/go-gitea/gitea
  18. cd ${GOPATH}/src/github.com/go-gitea/gitea
  19. glide install
  20. make build TAGS="sqlite cert pam"
  21. # Cleanup GOPATH & vendoring dir
  22. rm -r $GOPATH /app/gogs/vendor
  23. # Remove build deps
  24. apk --no-progress del build-deps
  25. # Create git user for Gogs
  26. adduser -H -D -g 'Gogs Git User' git -h /data/git -s /bin/bash && passwd -u git
  27. echo "export GITEA_CUSTOM=${GITEA_CUSTOM}" >> /etc/profile