service/services/gitea.spec

29 lines
1.2 KiB
Plaintext
Raw Normal View History

command: ./gitea -C . -w . -c ./custom/conf/app.ini
2019-10-24 15:54:15 +02:00
# deamon's working directory
2019-10-26 14:00:11 +02:00
directory: ${SERVICE_ROOT} # FIXME: Could this be removed?
2019-10-24 15:54:15 +02:00
consumes: postgresql
%pre-start
2019-10-24 15:54:15 +02:00
name: working directory
# 'command' is run only if this directory doesn't exist
unless-directory: ${SERVICE_ROOT}/custom/conf/
2019-10-26 14:00:11 +02:00
command: mkdir -p ${SERVICE_ROOT}/custom/conf/
2019-10-24 15:54:15 +02:00
%pre-start
2019-10-24 15:54:15 +02:00
name: symlink
# 'command' is run only if this directory doesn't exist
unless-file: ${SERVICE_ROOT}/gitea
2019-10-26 14:00:11 +02:00
command: ln -s $(which gitea) ${SERVICE_ROOT}/gitea
2019-10-24 15:54:15 +02:00
%pre-start
2019-10-24 15:54:15 +02:00
name: configuration file
# 'command' is run only if this file doesn't exist
unless-file: ${SERVICE_ROOT}/custom/conf/app.ini
2019-10-26 14:00:11 +02:00
command: gen-config gitea.cfg ${SERVICE_ROOT}/custom/conf/app.ini postgresql=${POSTGRESQL_PROVIDER}
2019-10-24 15:54:15 +02:00
%pre-start
2019-10-24 15:54:15 +02:00
name: gitea database creation
# 'command' is run only if this directory doesn't exist
unless-file: ${SERVICE_ROOT}/db_is_setup
2019-10-26 14:00:11 +02:00
command: pg_create_user.sh --pghost=localhost --pgport=$(get-port $POSTGRESQL_PROVIDER) --pgdatadir=$POSTGRESQL_ROOT --pguser=postgres --dbuser=${ENVIRONMENT}_gitea --dbpassfile=${SERVICE_ROOT}/password_main --dbname=${ENVIRONMENT}_gitea_db create_user_and_db && touch ${SERVICE_ROOT}/db_is_setup