forked from openeuropa/drupal-site-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.md.dist
156 lines (107 loc) · 5.1 KB
/
README.md.dist
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
# OpenEuropa Drupal project.
This project starter kit will create a website using
[OpenEuropa components](https://github.com/openeuropa/documentation/blob/master/docs/openeuropa-components.md).
It will install only two components:
- [The OpenEuropa Profile](https://github.com/openeuropa/oe_profile):
a lightweight Drupal installation profile that includes the minimal number of
modules to help get your started
- [The OpenEuropa Theme](https://github.com/openeuropa/oe_theme): the official
Drupal 8 theme of the European Commission which will ensure that the project
complies with the [European Component Library](https://github.com/ec-europa/europa-component-library)
guidelines.
In order to build the functionality of the website you are free to use any of the
[OpenEuropa components](https://github.com/openeuropa/openeuropa/blob/master/docs/openeuropa-components.md).
## Prerequisites
You need to have the following software installed on your local development environment:
* [Docker Compose](https://docs.docker.com/compose/install/)
* PHP 7.1 or greater (needed to run [GrumPHP](https://github.com/phpro/grumphp) Git hooks)
Having the following installed locally is also recommended, but not mandatory:
* [Composer](https://getcomposer.org/doc/00-intro.md#installation-linux-unix-osx).
**Please be aware:** the OpenEuropa team will only address support requests
if you use the provided `docker-compose.yml`.
## Troubleshooting
If you run `composer install` for the first time from within the Docker container GrumPHP
will set its Git hook paths to the container's ones.
If you get such error messages reinitialize GrumPHP paths on your host machine
(meaning, outside the container) by running:
```bash
./vendor/bin/grumphp git:deinit
./vendor/bin/grumphp git:init
```
## Configuration
The project ships with default setup configuration that is intended to run the
website on the Docker containers we provide.
To customize the default configuration values copy `runner.yml.dist` to `runner.yml`:
```bash
cp runner.yml.dist runner.yml
```
Now edit `runner.yml` with your most beloved text editor and change setup
configuration as needed.
## Site build and installation
The shipped `docker-compose.yml` file provides the necessary services and tools
to install, run and test an OpenEuropa Drupal 8 site.
By default, Docker Compose reads two files, a `docker-compose.yml` and an
optional `docker-compose.override.yml` file. By convention, the `docker-compose.yml`
contains your base configuration. The override file, as its name implies,
can contain configuration overrides for existing services or entirely new services.
If a service is defined in both files, Docker Compose merges the configurations.
Find more information on Docker Compose extension mechanism on
[the official Docker Compose documentation](https://docs.docker.com/compose/extends/).
To start, run:
```bash
docker-compose up -d
```
This will run the Docker containers in the background, i.e. it will "daemonize" them.
Then:
```bash
docker-compose exec web composer install
docker-compose exec web ./vendor/bin/run toolkit:install-clean
```
The site build will be available in the `web` directory and the site itself
will be reachable at: [http://localhost:8080/web](http://localhost:8080/web).
Before to commit your project on your repository, export the configuration on `config/sync`
using the following command:
```bash
docker-compose exec web ./vendor/bin/drush cex
```
## Commit and push
The final step is to have a new git repository and commit all the files. A
`.gitignore` file is provided to ensure you only commit your own project files.
If you have not been already provided with one please contact your management
and/or the Quality Assurance team.
```bash
git init
git add .
git commit -m "Initial commit."
```
Now you are ready to push your project to your chosen code hosting service.
## Running the tests
To run the coding standards and other static checks:
```bash
docker-compose exec web ./vendor/bin/grumphp run
```
To run Behat tests:
```bash
docker-compose exec web ./vendor/bin/behat
```
## Continuous integration and deployment
To check the status of the continuous integration of your project, go to [Drone](https://drone.fpfis.eu/).
A pipeline - created and maintained by DevOps - is applied by default.
It manages the code review of the code, it runs all tests on the repository and
builds the site artifact for the deployment.
You can control which commands will be ran during deployment by creating
and pushing a `.opts.yml` file.
If none is found the following one will be ran:
```yml
upgrade_commands:
- './vendor/bin/drush state:set system.maintenance_mode 1 --input-format=integer -y'
- './vendor/bin/drush updatedb -y'
- './vendor/bin/drush cache:rebuild'
- './vendor/bin/drush state:set system.maintenance_mode 0 --input-format=integer -y'
- './vendor/bin/drush cache:rebuild'
```
The following conventions apply:
- Every push on the site's deployment branch (usually `master`) will trigger
a deployment on the acceptance environment
- Every new tag on the site's deployment branch (usually `master`) will
trigger a deployment on production