Merge pull request #335 from monotek/monotek
addded nginx to .pkgr.yml dependencies added contrib/packager.io/preinstall.sh (installs epel-release on centos to get nginx dependency work) moved contrib/pkgr-postinstall.sh to contrib/packager.io/postinstall.sh removed postgresql-devel, postgresql and httpd from .pkgr.yml centos dependencies added postgresql db init to pkgr-postinstall.sh & fixed some checks added codeclimate.yml
This commit is contained in:
commit
db9233d1e7
4 changed files with 78 additions and 11 deletions
48
.codeclimate.yml
Normal file
48
.codeclimate.yml
Normal 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/
|
15
.pkgr.yml
15
.pkgr.yml
|
@ -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
|
||||
|
|
|
@ -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
|
12
contrib/packager.io/preinstall.sh
Executable file
12
contrib/packager.io/preinstall.sh
Executable 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
|
||||
|
Loading…
Reference in a new issue