mirror of
https://gitee.com/gitea/gitea.git
synced 2024-11-30 18:57:46 +08:00
b7263f31a5
Still use GOGS_WORK_DIR and GOGS_CUSTOM env variables as a fallback if the equivalent GITEA_* are not set, warning user about the need for change. Does not change "gogs" to "gitea" in webhook type name Because "gogs" hook type is part of the API (routes) and used in templates... Closes #87
37 lines
923 B
Bash
Executable File
37 lines
923 B
Bash
Executable File
#!/bin/sh
|
||
set -x
|
||
set -e
|
||
|
||
# Set temp environment vars
|
||
export GOPATH=/tmp/go
|
||
export PATH=${PATH}:${GOPATH}/bin
|
||
export GO15VENDOREXPERIMENT=1
|
||
|
||
# Install build deps
|
||
apk --no-cache --no-progress add --virtual build-deps build-base linux-pam-dev go
|
||
|
||
# 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
|
||
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"
|
||
|
||
# Cleanup GOPATH & vendoring dir
|
||
rm -r $GOPATH /app/gogs/vendor
|
||
|
||
# Remove build deps
|
||
apk --no-progress del build-deps
|
||
|
||
# Create git user for Gogs
|
||
adduser -H -D -g 'Gogs Git User' git -h /data/git -s /bin/bash && passwd -u git
|
||
echo "export GITEA_CUSTOM=${GITEA_CUSTOM}" >> /etc/profile
|