mirror of https://github.com/go-gitea/gitea
Git with a cup of tea, painless self-hosted git service
Mirror for internal git.with.parts use
https://git.with.parts
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.
25 lines
624 B
25 lines
624 B
9 years ago
|
#!/bin/sh
|
||
|
|
||
|
set -e
|
||
|
|
||
|
APP_NAME="gogs"
|
||
|
CLI="${APP_NAME}"
|
||
|
APP_USER=$(${CLI} config:get APP_USER)
|
||
|
APP_GROUP=$(${CLI} config:get APP_GROUP)
|
||
|
APP_CONFIG="/etc/${APP_NAME}/conf/app.ini"
|
||
|
|
||
|
mkdir -p $(dirname ${APP_CONFIG})
|
||
|
chown ${APP_USER}.${APP_GROUP} $(dirname ${APP_CONFIG})
|
||
|
[ -f ${APP_CONFIG} ] || ${CLI} run cp conf/app.ini ${APP_CONFIG}
|
||
|
${CLI} config:set USER=${APP_USER}
|
||
|
sed -i "s|RUN_USER = git|RUN_USER = ${APP_USER}|" ${APP_CONFIG}
|
||
|
sed -i "s|RUN_MODE = dev|RUN_MODE = prod|" ${APP_CONFIG}
|
||
|
|
||
|
${CLI} config:set GOGS_CUSTOM=/etc/${APP_NAME}
|
||
|
|
||
|
# scale
|
||
|
${CLI} scale web=1 || true
|
||
|
|
||
|
# restart the service
|
||
|
service gogs restart || true
|