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
|
|
|
|
|
|
|
|
|
|
# Create git user for Gogs
|
2017-10-13 21:26:39 +01:00
|
|
|
|
addgroup -S git
|
|
|
|
|
|
adduser -G git -H -D -g 'Gogs Git User' git -h /data/git -s /bin/bash && usermod -p '*' git && passwd -u git
|
2015-10-02 21:18:13 +02:00
|
|
|
|
echo "export GOGS_CUSTOM=${GOGS_CUSTOM}" >> /etc/profile
|