diff --git a/.pkgr.yml b/.pkgr.yml index c3295b93b87..899863194b5 100644 --- a/.pkgr.yml +++ b/.pkgr.yml @@ -5,18 +5,21 @@ targets: build_dependencies: - libmagickwand-dev - libsqlite3-dev - dependencies: - - debconf - - memcached + fedora-20: + build_dependencies: + - ImageMagick-devel before_precompile: "packaging/setup" -after_install: "packaging/debian/postinst" -addons: - - mysql - - apache2 - - svn-dav - - smtp crons: - packaging/cron/openproject-clear-old-sessions - packaging/cron/openproject-create-svn-repositories +services: + - postgres +installer: true +wizards: + - https://github.com/pkgr/addon-mysql.git#installer + - https://github.com/pkgr/addon-apache2.git#installer + - https://github.com/pkgr/addon-svn-dav.git#installer + - https://github.com/pkgr/addon-smtp.git#installer + - https://github.com/pkgr/addon-memcached.git#installer + - https://github.com/pkgr/addon-openproject.git#installer buildpack: https://github.com/ddollar/heroku-buildpack-multi.git - diff --git a/packaging/debian/postinst b/packaging/debian/postinst deleted file mode 100755 index a0115de4fee..00000000000 --- a/packaging/debian/postinst +++ /dev/null @@ -1,75 +0,0 @@ -#!/bin/sh - -set -e - -# summary of how this script can be called: -# * `configure' -# * `abort-upgrade' -# * `abort-remove' `in-favour' -# -# * `abort-remove' -# * `abort-deconfigure' `in-favour' -# `removing' -# -# for details, see http://www.debian.org/doc/debian-policy/ or -# the debian-policy package - -APP_NAME="_APP_NAME_" -CLI="${APP_NAME}" -APP_USER=$(${CLI} config:get APP_USER) -APP_GROUP=$(${CLI} config:get APP_GROUP) - -# source debconf library -. /usr/share/debconf/confmodule - -case "$1" in - - configure) - # create attachments folder - attachments_path=$(${CLI} config:get ATTACHMENTS_STORAGE_PATH || echo "/var/db/${APP_NAME}/files") - mkdir -p "${attachments_path}" - chown ${APP_USER}.${APP_GROUP} "${attachments_path}" - ${CLI} config:set ATTACHMENTS_STORAGE_PATH="${attachments_path}" - - # set web concurrency - web_concurrency=$(${CLI} config:get WEB_CONCURRENCY || echo "2") - ${CLI} config:set WEB_CONCURRENCY=${web_concurrency} - - # set web timeout - web_timeout=$(${CLI} config:get WEB_TIMEOUT || echo "15") - ${CLI} config:set WEB_TIMEOUT=${web_timeout} - - # set SECRET_TOKEN env variable - secret_token=$(${CLI} config:get SECRET_TOKEN || ${CLI} run rake -s secret | tail -1) - ${CLI} config:set SECRET_TOKEN="$secret_token" - - # migrate - rake_commands="db:migrate db:seed" - ${CLI} run rake ${rake_commands} || true - - sys_api_key=$(${CLI} config:get SYS_API_KEY) - - # set various settings - db_get ${APP_NAME}/server/hostname - if [ -z "$RET" ]; then web_hostname=$(hostname -f); else web_hostname="$RET"; fi - db_get ${APP_NAME}/server/ssl - if [ "$RET" = "true" ]; then web_protocol="https"; else web_protocol="http"; fi - - ${CLI} run rake setting:set[host_name=${web_hostname},protocol=${web_protocol},sys_api_enabled=1,sys_api_key=${sys_api_key}] 1>/dev/null - - # scale - ${CLI} scale web=1 worker=1 || true - - # let the admin reboot when he's ready - ;; - - abort-upgrade|abort-remove|abort-deconfigure) - exit 0 - ;; - - *) - echo "postinst called with unknown argument \`$1'" >&2 - exit 1 - ;; -esac - diff --git a/packaging/scripts/check b/packaging/scripts/check index cb80389c4e5..bf019714150 100755 --- a/packaging/scripts/check +++ b/packaging/scripts/check @@ -17,10 +17,10 @@ else log_ko "MySQL connection is NOT working" fi -if /etc/init.d/apache2 status &>/dev/null; then - log_ok "Apache2 is running" +if ps -u "$SERVER_USER" &>/dev/null ; then + log_ok "Web server is running" else - log_ko "Apache2 is NOT running" + log_ko "Web server is NOT running" fi if ps -u "$APP_USER" -f | grep -q "unicorn worker" ; then diff --git a/packaging/scripts/create-svn-repositories b/packaging/scripts/create-svn-repositories index c98f6ec1ab9..59cfc0b2dc1 100755 --- a/packaging/scripts/create-svn-repositories +++ b/packaging/scripts/create-svn-repositories @@ -2,14 +2,18 @@ APP_NAME="_APP_NAME_" CLI="${APP_NAME}" -SVN_REPOSITORIES=$(${CLI} config:get SVN_REPOSITORIES) +APP_HOME="$(${CLI} config:get APP_HOME)" +SVN_REPOSITORIES="$(${CLI} config:get SVN_REPOSITORIES)" PORT=$(${CLI} config:get PORT) -SYS_API_KEY=$(${CLI} config:get SYS_API_KEY) -APP_GROUP=$(${CLI} config:get APP_GROUP) +SYS_API_KEY="$(${CLI} config:get SYS_API_KEY)" +APP_GROUP="$(${CLI} config:get APP_GROUP)" +SERVER_USER="$(${CLI} config:get SERVER_USER)" +SERVER_HOSTNAME="$(${CLI} config:get SERVER_HOSTNAME)" +SERVER_PROTOCOL="$(${CLI} config:get SERVER_PROTOCOL)" -/opt/${APP_NAME}/bin/ruby /opt/${APP_NAME}/extra/svn/reposman.rb \ +${APP_HOME}/bin/ruby ${APP_HOME}/extra/svn/reposman.rb \ --openproject-host "http://127.0.0.1:${PORT}" \ - --owner "www-data" \ + --owner "${SERVER_USER}" \ --group "${APP_GROUP}" \ --public-mode '2750' \ --private-mode '2750' \ @@ -18,4 +22,3 @@ APP_GROUP=$(${CLI} config:get APP_GROUP) --key "${SYS_API_KEY}" \ --scm Subversion \ --verbose - diff --git a/packaging/setup b/packaging/setup index 7e4c3349766..e90007671f9 100755 --- a/packaging/setup +++ b/packaging/setup @@ -1,9 +1,5 @@ #!/usr/bin/env bash -# we need postgresql for asset precompilation -# see: https://packager.io/documentation -sudo service postgresql start - cp -f packaging/conf/configuration.yml config/configuration.yml sed -i "s|config.serve_static_assets = false|config.serve_static_assets = true|" config/environments/production.rb