installation.md 2.47 KB
Newer Older
Sebastian Castro's avatar
Sebastian Castro committed
1
2
3
Installation and Production Instructions
========================================

Alan Poulain's avatar
Alan Poulain committed
4
Feel free to add some more information if you solve installation issues!
5

Alan Poulain's avatar
Alan Poulain committed
6
Quick Install
Sebastien Rosset's avatar
Sebastien Rosset committed
7
8
-------------

Alan Poulain's avatar
Alan Poulain committed
9
- **Debian script**: there is a script for Debian installation named `install_debian.sh` in this docs directory! After installation, go to `http://localhost/GoGoCarto/web/project/initialize` to initialize your project.
Sebastien Rosset's avatar
Sebastien Rosset committed
10
11

- **Docker containers**: please follow the instructions [here](installation_docker.md).
Sebastian Castro's avatar
Sebastian Castro committed
12

Sebastian Castro's avatar
Sebastian Castro committed
13
14
15
Requirements
------------

Alan Poulain's avatar
Alan Poulain committed
16
1. PHP 7
17
2. [Composer](https://getcomposer.org/download/)
Sebastian Castro's avatar
Sebastian Castro committed
18
19
3. [Nodejs](https://nodejs.org/en/download/)
4. [Git](https://git-scm.com/)
Alan Poulain's avatar
Alan Poulain committed
20
5. Web Server (Apache, Nginx, [Wamp server](http://www.wampserver.com/) ...)
21
6. MongoDB (http://php.net/manual/fr/mongodb.installation.php) -> !!Version 3.4 or below!!!
Sebastian Castro's avatar
Sebastian Castro committed
22

Sebastien Rosset's avatar
Sebastien Rosset committed
23
24
Consider the [Docker installation](installation_docker.md) if you run into troubles installing these softwares.

Sebastian Castro's avatar
Sebastian Castro committed
25
26
27
Installation
------------

Alan Poulain's avatar
Alan Poulain committed
28
29
30
### Cloning Repository (clone dev branch)

```shell
Sebastian Castro's avatar
Sebastian Castro committed
31
cd path-to-php-server-folder (default linux /var/www/html, windows c:/wamp/www... )
Sebastian Castro's avatar
Sebastian Castro committed
32
git clone https://gitlab.adullact.net/pixelhumain/GoGoCarto.git
33
cd GoGoCarto/
Sebastian Castro's avatar
Sebastian Castro committed
34
35
```

36
### Initialize the Project
Alan Poulain's avatar
Alan Poulain committed
37
38
39

Create an `.env.local` file containing:

Sebastian Castro's avatar
Sebastian Castro committed
40
```
Alan Poulain's avatar
Alan Poulain committed
41
MONGODB_URL=mongodb://localhost:27017
Sebastian Castro's avatar
Sebastian Castro committed
42
43
```

44
Execute the command:
Alan Poulain's avatar
Alan Poulain committed
45
46

```shell
47
make init
Sebastian Castro's avatar
Sebastian Castro committed
48
49
```

50
51
52
53
It will:
- install the dependencies
- install and build the assets
- load the fixtures
Alan Poulain's avatar
Alan Poulain committed
54

55
Now initialize your project with the following route:
Alan Poulain's avatar
Alan Poulain committed
56

57
`http://localhost/GoGoCarto/web/project/initialize`
Sebastian Castro's avatar
Sebastian Castro committed
58

59
60
Start
-----
Alan Poulain's avatar
Alan Poulain committed
61

62
Start watching for file changes (automatic recompilation):
Sebastian Castro's avatar
Sebastian Castro committed
63

Alan Poulain's avatar
Alan Poulain committed
64
```shell
65
gulp watch
Alan Poulain's avatar
Alan Poulain committed
66
67
68
```

Updating your Install
Sebastian Castro's avatar
Sebastian Castro committed
69
70
---------------------

71
Each time you want to update GoGoCarto, run:
Alan Poulain's avatar
Alan Poulain committed
72
73

```shell
74
make deploy
Sebastian Castro's avatar
Sebastian Castro committed
75
```
76

Alan Poulain's avatar
Alan Poulain committed
77
You can have a look to [the CHANGELOG](../CHANGELOG.md) to know what are the new features.
Sebastian Castro's avatar
Sebastian Castro committed
78

Sebastian Castro's avatar
Sebastian Castro committed
79
80
81
Production
----------

82
Dump assets in Symfony console to update the web/templates files:
Alan Poulain's avatar
Alan Poulain committed
83
84
85
86
87

```
assets:install web
```

88
Generate compressed JS and CSS files:
Sebastian Castro's avatar
Sebastian Castro committed
89
90
91
92
93

```
gulp build
gulp production
```
Sebastian Castro's avatar
Sebastian Castro committed
94

95
Enable gz compression in your web server.
Alan Poulain's avatar
Alan Poulain committed
96

97
In the distant console (http://yoursite.com/web/_console):
Sebastian Castro's avatar
Sebastian Castro committed
98
99
100
101

```
cache:clear --env=prod
```
102

103
Make sure that the var folder is writable `chmod -R 771 var/`.
104
105

Issues
106
------
107

Alan Poulain's avatar
Alan Poulain committed
108
109
110
If when you create an element you have the issue "cannot load method bcmod from namespace ...",
you need to install the bc-math module:

111
```
Alan Poulain's avatar
Alan Poulain committed
112
sudo apt install php7.3-bcmath
113
114
```

Alan Poulain's avatar
Alan Poulain committed
115
116
117
If memory limits while using Composer:

```shell
118
COMPOSER_MEMORY_LIMIT=-1 composer ...
Alan Poulain's avatar
Alan Poulain committed
119
```