2015-10-02 10:56:36 +01:00
|
|
|
|
#!/bin/sh
|
2015-11-16 16:49:40 +00:00
|
|
|
|
set -x
|
|
|
|
|
|
set -e
|
2015-10-02 10:56:36 +01:00
|
|
|
|
|
2015-10-02 21:18:13 +02:00
|
|
|
|
# Set temp environment vars
|
|
|
|
|
|
export GOPATH=/tmp/go
|
2017-02-19 02:43:27 +01:00
|
|
|
|
export PATH=/usr/local/go/bin:${PATH}:${GOPATH}/bin
|
2015-10-02 21:18:13 +02:00
|
|
|
|
|
2015-10-02 10:56:36 +01:00
|
|
|
|
# Install build deps
|
2017-02-19 02:43:27 +01:00
|
|
|
|
apk --no-cache --no-progress add --virtual build-deps build-base linux-pam-dev
|
2015-10-02 10:56:36 +01:00
|
|
|
|
|
2016-05-11 18:11:59 +01:00
|
|
|
|
# Build Gogs
|
2018-05-27 08:53:48 +08:00
|
|
|
|
mkdir -p ${GOPATH}/src/github.com/gogs/
|
|
|
|
|
|
ln -s /app/gogs/build ${GOPATH}/src/github.com/gogs/gogs
|
|
|
|
|
|
cd ${GOPATH}/src/github.com/gogs/gogs
|
2017-02-19 02:43:27 +01:00
|
|
|
|
# Needed since git 2.9.3 or 2.9.4
|
|
|
|
|
|
git config --global http.https://gopkg.in.followRedirects true
|
2016-05-11 18:11:59 +01:00
|
|
|
|
make build TAGS="sqlite cert pam"
|
2015-10-02 10:56:36 +01:00
|
|
|
|
|
2017-02-09 19:48:13 -05:00
|
|
|
|
# Cleanup GOPATH
|
|
|
|
|
|
rm -r $GOPATH
|
2015-10-02 10:56:36 +01:00
|
|
|
|
|
|
|
|
|
|
# Remove build deps
|
2016-01-25 13:07:37 +00:00
|
|
|
|
apk --no-progress del build-deps
|
2015-10-02 21:18:13 +02:00
|
|
|
|
|
2018-08-13 20:50:25 +08:00
|
|
|
|
# Move to final place
|
|
|
|
|
|
mv /app/gogs/build/gogs /app/gogs/
|
|
|
|
|
|
|
|
|
|
|
|
# Cleanup go
|
|
|
|
|
|
rm -rf /tmp/go
|
|
|
|
|
|
rm -rf /usr/local/go
|