diff options
author | Unknwon <u@gogs.io> | 2019-10-24 02:01:43 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-24 02:01:43 -0700 |
commit | de61bb6a3522287040108b6f64668ac9ab8478b6 (patch) | |
tree | f4bde08578f009f121b1c7d9ea773edc99ec5a23 /.packager | |
parent | 01c8df01ec0608f1f25b2f1444adabb98fa5ee8a (diff) |
packager.io: update scripts (#5837)
* Test new buildpack and distro
* Try another buildpack version
* Give another try
* Try another one
* Best effort
Diffstat (limited to '.packager')
-rw-r--r-- | .packager/.godir | 1 | ||||
-rw-r--r-- | .packager/Procfile | 1 | ||||
-rwxr-xr-x | .packager/hooks/postinst | 24 |
3 files changed, 26 insertions, 0 deletions
diff --git a/.packager/.godir b/.packager/.godir new file mode 100644 index 00000000..ba2906d0 --- /dev/null +++ b/.packager/.godir @@ -0,0 +1 @@ +main diff --git a/.packager/Procfile b/.packager/Procfile new file mode 100644 index 00000000..ee1a0f55 --- /dev/null +++ b/.packager/Procfile @@ -0,0 +1 @@ +web: ./gogs web -p ${PORT:=3000} diff --git a/.packager/hooks/postinst b/.packager/hooks/postinst new file mode 100755 index 00000000..efae87ad --- /dev/null +++ b/.packager/hooks/postinst @@ -0,0 +1,24 @@ +#!/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 |