Files
Atay-Makhzan/docker/build.sh
T

37 lines
923 B
Bash
Raw Normal View History

2015-10-02 10:56:36 +01:00
#!/bin/sh
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
export PATH=${PATH}:${GOPATH}/bin
export GO15VENDOREXPERIMENT=1
2015-10-02 21:18:13 +02:00
2015-10-02 10:56:36 +01:00
# Install build deps
apk --no-cache --no-progress add --virtual build-deps build-base linux-pam-dev go
2015-10-02 10:56:36 +01:00
# Install glide
git clone -b 0.10.2 https://github.com/Masterminds/glide ${GOPATH}/src/github.com/Masterminds/glide
cd ${GOPATH}/src/github.com/Masterminds/glide
make build
go install
# Build Gogs
2015-10-02 10:56:36 +01:00
mkdir -p ${GOPATH}/src/github.com/gogits/
ln -s /app/gogs/ ${GOPATH}/src/github.com/go-gitea/gitea
cd ${GOPATH}/src/github.com/go-gitea/gitea
glide install
make build TAGS="sqlite cert pam"
2015-10-02 10:56:36 +01:00
# Cleanup GOPATH & vendoring dir
rm -r $GOPATH /app/gogs/vendor
2015-10-02 10:56:36 +01:00
# Remove build deps
apk --no-progress del build-deps
2015-10-02 21:18:13 +02:00
# Create git user for Gogs
adduser -H -D -g 'Gogs Git User' git -h /data/git -s /bin/bash && passwd -u git
2016-11-07 11:41:50 +01:00
echo "export GITEA_CUSTOM=${GITEA_CUSTOM}" >> /etc/profile