packager additions

This commit is contained in:
André Bauer 2016-10-31 13:00:59 +01:00
parent 4e84b60445
commit a797add550
4 changed files with 78 additions and 11 deletions

48
.codeclimate.yml Normal file
View file

@ -0,0 +1,48 @@
---
engines:
brakeman:
enabled: true
bundler-audit:
enabled: true
csslint:
enabled: true
coffeelint:
enabled: true
duplication:
enabled: true
config:
languages:
- ruby
- javascript
- python
- php
eslint:
enabled: true
fixme:
enabled: true
phpmd:
enabled: true
rubocop:
enabled: true
ratings:
paths:
- Gemfile.lock
- "**.erb"
- "**.haml"
- "**.rb"
- "**.rhtml"
- "**.slim"
- "**.css"
- "**.coffee"
- "**.inc"
- "**.js"
- "**.jsx"
- "**.module"
- "**.php"
- "**.py"
exclude_paths:
- config/
- db/
- script/
- test/
- vendor/

View file

@ -2,24 +2,23 @@ notifications: false
targets:
centos-6:
dependencies:
- httpd
- postgresql
- nginx
- postgresql-server
- postgresql-devel
centos-7:
dependencies:
- httpd
- postgresql
- nginx
- postgresql-server
- postgresql-devel
debian-8:
dependencies:
- nginx
- postgresql
ubuntu-16.04:
dependencies:
- nginx
- postgresql
sles-12:
dependencies:
- nginx
- postgresql
before:
- uname -a
@ -31,7 +30,7 @@ before:
env:
- RAILS_ENV=production
- PORT=3000
- RAILS_SERVE_STATIC_FILES=true
services:
- postgres
after_install: contrib/pkgr-postinstall.sh
before_install: contrib/packager.io/preinstall.sh
after_install: contrib/packager.io/postinstall.sh

View file

@ -10,9 +10,9 @@ DB="zammad_production"
DB_USER="zammad"
# check which init system is used
if [ -n $(which initctl) ]; then
if [ -n "$(which initctl)" ]; then
INIT_CMD="initctl"
elif [ -n $(which systemctl) ]; then
elif [ -n "$(which systemctl)" ]; then
INIT_CMD="systemctl"
else
function sysvinit () {
@ -36,6 +36,14 @@ else
# create new password
DB_PASS="$(tr -dc A-Za-z0-9 < /dev/urandom | head -c10)"
if [ -n "$(which postgresql-setup)" ]; then
echo "preparing postgresql server"
postgresql-setup initdb
echo "restarting postgresql server"
${INIT_CMD} restart postgresql
fi
# create database
echo "# database.yml not found. Creating new db..."
su - postgres -c "createdb -E UTF8 ${DB}"
@ -58,7 +66,7 @@ echo "# Starting Zammad"
${INIT_CMD} start zammad
# nginx config
if [ -n $(which nginx) ]; then
if [ -n "$(which nginx)" ]; then
# copy nginx config
# debian / ubuntu
if [ -d /etc/nginx/sites-enabled ]; then

View file

@ -0,0 +1,12 @@
#!/bin/bash
#
# packager.io preinstall script
#
PATH=/opt/zammad/bin:/opt/zammad/vendor/bundle/bin:/sbin:/bin:/usr/sbin:/usr/bin:
# install epel-release on centos (needed for nginx)
if [ -n "$(which yum)" ]; then
yum install -y epel-release
fi