packager additions
This commit is contained in:
parent
4e84b60445
commit
a797add550
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:
|
targets:
|
||||||
centos-6:
|
centos-6:
|
||||||
dependencies:
|
dependencies:
|
||||||
- httpd
|
- nginx
|
||||||
- postgresql
|
|
||||||
- postgresql-server
|
- postgresql-server
|
||||||
- postgresql-devel
|
|
||||||
centos-7:
|
centos-7:
|
||||||
dependencies:
|
dependencies:
|
||||||
- httpd
|
- nginx
|
||||||
- postgresql
|
|
||||||
- postgresql-server
|
- postgresql-server
|
||||||
- postgresql-devel
|
|
||||||
debian-8:
|
debian-8:
|
||||||
dependencies:
|
dependencies:
|
||||||
|
- nginx
|
||||||
- postgresql
|
- postgresql
|
||||||
ubuntu-16.04:
|
ubuntu-16.04:
|
||||||
dependencies:
|
dependencies:
|
||||||
|
- nginx
|
||||||
- postgresql
|
- postgresql
|
||||||
sles-12:
|
sles-12:
|
||||||
dependencies:
|
dependencies:
|
||||||
|
- nginx
|
||||||
- postgresql
|
- postgresql
|
||||||
before:
|
before:
|
||||||
- uname -a
|
- uname -a
|
||||||
|
@ -31,7 +30,7 @@ before:
|
||||||
env:
|
env:
|
||||||
- RAILS_ENV=production
|
- RAILS_ENV=production
|
||||||
- PORT=3000
|
- PORT=3000
|
||||||
- RAILS_SERVE_STATIC_FILES=true
|
|
||||||
services:
|
services:
|
||||||
- postgres
|
- 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"
|
DB_USER="zammad"
|
||||||
|
|
||||||
# check which init system is used
|
# check which init system is used
|
||||||
if [ -n $(which initctl) ]; then
|
if [ -n "$(which initctl)" ]; then
|
||||||
INIT_CMD="initctl"
|
INIT_CMD="initctl"
|
||||||
elif [ -n $(which systemctl) ]; then
|
elif [ -n "$(which systemctl)" ]; then
|
||||||
INIT_CMD="systemctl"
|
INIT_CMD="systemctl"
|
||||||
else
|
else
|
||||||
function sysvinit () {
|
function sysvinit () {
|
||||||
|
@ -36,6 +36,14 @@ else
|
||||||
# create new password
|
# create new password
|
||||||
DB_PASS="$(tr -dc A-Za-z0-9 < /dev/urandom | head -c10)"
|
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
|
# create database
|
||||||
echo "# database.yml not found. Creating new db..."
|
echo "# database.yml not found. Creating new db..."
|
||||||
su - postgres -c "createdb -E UTF8 ${DB}"
|
su - postgres -c "createdb -E UTF8 ${DB}"
|
||||||
|
@ -58,7 +66,7 @@ echo "# Starting Zammad"
|
||||||
${INIT_CMD} start zammad
|
${INIT_CMD} start zammad
|
||||||
|
|
||||||
# nginx config
|
# nginx config
|
||||||
if [ -n $(which nginx) ]; then
|
if [ -n "$(which nginx)" ]; then
|
||||||
# copy nginx config
|
# copy nginx config
|
||||||
# debian / ubuntu
|
# debian / ubuntu
|
||||||
if [ -d /etc/nginx/sites-enabled ]; then
|
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