Commit c0ce2c84 authored by MikeyMJCO's avatar MikeyMJCO
Browse files

Merge branch 'v2018' into 'master'

V2018

See merge request !94
parents 4c175cd7 c1eb878d
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
......@@ -51,12 +51,20 @@ Books are automatically published when the corresponding branch is updated their
### Setting up automatic publishing
#### GitHub
Auto updates are configured via webhooks within the repository on GitHub. You will need to be an owner (not just a collaborator) of the repository in order to perform these steps.
1. Go to `https://github.com/civicrm/[repo-name]/settings/hooks/new`
1. Set the **Payload URL** to https://docs.civicrm.org/admin/listen
1. Set the **Content type** to 'application/json'
1. Set **Which events would you like to trigger this webhook?** to 'Let me select individual events' and select 'Pull request' and 'Push' (since these are the only events that should trigger an update)
1. Go to `https://github.com/[user-or-group-name]/[repo-name]/settings/hooks/new`
2. Set the **Payload URL** to https://docs.civicrm.org/admin/listen
3. Set the **Content type** to 'application/json'
4. Set **Which events would you like to trigger this webhook?** to 'Let me select individual events' and select 'Pull request' and 'Push' (since these are the only events that should trigger an update)
#### GitLab
1. Go to `https://lab.civicrm.org/[user-or-group-name]/[repo-name]/settings/integrations
2. Set the **URL** to https://docs.civicrm.org/admin/listen
3. Set the **Trigger** to 'Push events' and 'Tag push events'.
### Manual publishing
......@@ -104,26 +112,64 @@ You should be able to see the app at http://localhost:8080.
**Note**: the following steps are only useful and necessary for people looking after CiviCRM's documentation *infrastructure*. You don't need to do this if you just want to [contribute to documentation content](https://docs.civicrm.org/dev/en/master/documentation/).
1. Ensure that that you have [pip](https://packaging.python.org/en/latest/install_requirements_linux/#installing-pip-setuptools-wheel-with-linux-package-managers) (for python) and [composer](https://getcomposer.org/) (for php) installed..
2. [Install MkDocs](https://docs.civicrm.org/dev/en/master/documentation/#mkdocs). Ensure that MkDocs is installed as root so that it can be accessed from the src/publish.php script (typically invoked as https://docs.civicrm.org/publish.php)*
3. clone this repository to somewhere like /var/www/civicrm-docs and run `composer install`
```bash
$ git clone /var/www/civicrm-docs
$ cd /var/www/civicrm-docs
$ composer install
```
4. Set appropriate permissions on web/static
5. Configure an nginx virtual host
```bash
$ cd /etc/nginx/sites-enabled
$ ln -s /var/www/civicrm-docs/app/config/nginx.conf civicrm-docs
```
1. Install the pre-requisites:
**Note**: the example commands have been tested on Ubuntu 16.04 and 18.04.
* [nginx](https://nginx.org):
``` bash
sudo apt install nginx
```
* [mysql](https://mysql.com):
``` bash
sudo apt install mysql-server
```
* [php 7.1](https://php.net):
``` bash
sudo apt install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt update
sudo apt install php7.1-fpm php7.1-mcrypt php7.1-mbstring php7.1-cli php7.1-xml php7.1-mysql php7.1-gd php7.1-imagick php7.1-recode php7.1-tidy php7.1-xmlrpc
```
* [pip](https://packaging.python.org/en/latest/install_requirements_linux/#installing-pip-setuptools-wheel-with-linux-package-managers):
``` bash
sudo apt install python-pip
```
* [composer](https://getcomposer.org)
``` bash
sudo apt install composer
```
* [mkdocs](https://mkdocs.org) *CiviCRM Docs Publisher expects MkDocs version 0.16.x*
``` bash
sudo -H pip install mkdocs==0.16.3
sudo -H pip install mkdocs-material==1.4.1
sudo -H pip install pygments==2.2.0
sudo -H pip install pymdown-extensions==2.0
```
**Note**: Ensure that MkDocs is installed as root so that it can be accessed from the src/publish.php script (typically invoked as https://docs.civicrm.org/publish.php)*
2. clone this repository to somewhere like /var/www/civicrm-docs and run `composer install`
```bash
git clone https://lab.civicrm.org/documentation/docs-publisher.git /var/www/civicrm-docs
cd /var/www/civicrm-docs
composer install
```
3. Set appropriate permissions on web/static
4. Update the nginx configuration file to point to the php7.1-fpm socket and fix the root.
[- root /var/www/web; -]
[+ root /var/www/civicrm-docs/web; +]
[- fastcgi_pass unix:/var/run/php-fpm.sock; -]
[+ fastcgi_pass unix:/var/run/php/php7.1-fpm.sock; +]
5. Configure the nginx virtual host
```bash
cd /etc/nginx/sites-enabled
ln -s /var/www/civicrm-docs/app/config/civicrm-docs.conf civicrm-docs
```
6. Reload your nginx config and you should be up and running.
......
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
......@@ -20,8 +20,7 @@ class AppKernel extends Kernel {
if (in_array($this->getEnvironment(), ['dev', 'test'], TRUE)) {
$bundles[] = new Symfony\Bundle\DebugBundle\DebugBundle();
$bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
$bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle();
$bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle();
$bundles[] = new Symfony\Bundle\MakerBundle\MakerBundle();
}
if ('dev' === $this->getEnvironment()) {
......
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
server {
server_name localhost;
listen *:8080;
root /var/www/web;
server_name v2018.docs.civicrm.dev.mjco.uk;
root /var/www/civicrm-docs-v2018/web;
# For a development configuration, change "app" to "app_dev" everywhere
# below. Then you'll see the Symfony web debug toolbar when viewing pages.
......@@ -26,7 +25,7 @@ server {
}
location ~ ^/app_dev\.php(/|$) {
fastcgi_pass unix:/var/run/php-fpm.sock;
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
# When you are using symlinks to link the document root to the
......@@ -50,7 +49,15 @@ server {
return 404;
}
#error_log /var/log/nginx/civicrm-docs-error.log;
#access_log /var/log/nginx/civicrm-docs-access.log;
}
error_log /var/log/nginx/civicrm-docs-error.log;
access_log /var/log/nginx/civicrm-docs-access.log;
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/v2018.docs.civicrm.dev.mjco.uk/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/v2018.docs.civicrm.dev.mjco.uk/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
......@@ -23,7 +23,7 @@ framework:
engines: ['twig']
default_locale: "%locale%"
trusted_hosts: ~
trusted_proxies: ~
#trusted_proxies: ~ # Deprecated v3.3
session:
# http://symfony.com/doc/current/reference/configuration/framework.html#handler-id
handler_id: session.handler.native_file
......@@ -66,3 +66,8 @@ swiftmailer:
username: "%mailer_user%"
password: "%mailer_password%"
spool: { type: memory }
# Sensio Framework Configuration
sensio_framework_extra:
router:
annotations: false
......@@ -17,10 +17,10 @@ monolog:
type: stream
path: "%kernel.logs_dir%/%kernel.environment%.log"
level: debug
channels: [!event]
channels: ["!event"]
console:
type: console
channels: [!event, !doctrine]
channels: ["!event", "!doctrine"]
# uncomment to get logging in your browser
# you may have to allow bigger header sizes in your Web server configuration
#firephp:
......
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
# Learn more about services, parameters and containers at
# http://symfony.com/doc/current/book/service_container.html
parameters:
books_dir: %kernel.root_dir%/../books
books_dir: "%kernel.root_dir%/../books"
services:
_defaults:
autowire: true
autoconfigure: true
library:
class: AppBundle\Model\Library
arguments:
- %books_dir%
- "%books_dir%"
public: true
github.hook.processor:
class: AppBundle\Utils\GitHubHookProcessor
webhook.processor:
class: AppBundle\Utils\WebhookProcessor
arguments:
-
- '@github.webhook_handler'
- '@gitlab.webbook_handler'
public: true
github.webhook_handler:
class: AppBundle\Utils\WebhookAdapters\GithubHandler
public: true
gitlab.webbook_handler:
class: AppBundle\Utils\WebhookAdapters\GitlabHandler
public: true
mkdocs:
class: AppBundle\Utils\MkDocs
......@@ -28,6 +45,7 @@ services:
- '@mkdocs'
- '@git'
- '@paths'
public: true
filesystem:
class: AppBundle\Utils\FileSystem
......@@ -35,8 +53,8 @@ services:
paths:
class: AppBundle\Utils\Paths
arguments:
- '%kernel.root_dir%'
- '%kernel.cache_dir%'
- "%kernel.root_dir%"
- "%kernel.cache_dir%"
git:
class: AppBundle\Utils\GitTools
......@@ -56,7 +74,7 @@ services:
streamhandler:
class: Monolog\Handler\StreamHandler
arguments:
- %kernel.logs_dir%/publish.log
- "%kernel.logs_dir%/publish.log"
app.exception_listener:
class: AppBundle\EventListener\ExceptionListener
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment