Si vous constatez la perte de tickets, de commentaires ou de projets, veuillez consulter la page https://status.framasoft.org/incident/626.

Commit 3afa013e authored by Julien Fastré's avatar Julien Fastré

upgrade and reference installation process

parent a0fee8f4
......@@ -32,3 +32,4 @@ app/DoctrineMigrations/*
composer.lock
yarn-error.log
cache/*
phpdoc/*
......@@ -28,7 +28,7 @@ build-base-image-php:
init:
@$(MAKE) -f $(THIS_FILE) build-base-image-php
docker run --rm -e INSTALL_ID=$(UID) -e INSTALL_GID=$(GID) -e COMPOSER_HOME=/var/www/app/.composer --volume $(PWD):/var/www/app --workdir /var/www/app --entrypoint /usr/bin/env $(PHP_BASE_IMAGE_CHILL) /bin/bash ./docker/install.dev.sh
docker run --rm -e INSTALL_ID=$(UID) -e INSTALL_GID=$(GID) -e COMPOSER_HOME=/var/www/app/.composer --volume $(PWD):/var/www/app --workdir /var/www/app --entrypoint /usr/bin/env $(PHP_BASE_IMAGE_CHILL) php -d memory_limit=2G composer.phar upgrade --no-scripts
docker run --rm -e INSTALL_ID=$(UID) -e INSTALL_GID=$(GID) -e COMPOSER_HOME=/var/www/app/.composer --volume $(PWD):/var/www/app --workdir /var/www/app --entrypoint /usr/bin/env --user $(UID) $(PHP_BASE_IMAGE_CHILL) php -d memory_limit=2G composer.phar upgrade --no-scripts
@$(MAKE) -f $(THIS_FILE) build-assets
$(DOCKER_COMPOSE_PHP_EXEC_CMD) php -d memory_limit=2G composer.phar run-script post-install-cmd
......
Chill - Standard Project
========================
The Chill project is a fork of [symfony/symfony-standard]
(https://github.com/symfony/symfony-standard). This project has adapted the composer.json
file to adapt to chill installation.
This is the basic project you must install first in order to install Chill software.
## Requirements
The installation process is documented here: http://docs.chill.social/en/latest/installation/index.html
- This project use [docker](https://docker.com) to be run. As a developer, use [docker-compose](https://docs.docker.com/compose/overview/) to bootstrap a dev environment in a glance. You do not need any other dependencies ;
- Make is used to automate scripts.
## As a developer
Clone or download this project and `cd` into the main directory.
As a developer, the code will stay on your computer and will be executed in docker container. To avoid permission problem, the code should be run with the same uid/gid from your current user. Have a look at those id before continuing.
### Prepare your variables
Have a look at the variable in [`env.dist`](env.dist) and in [`app/config/parameters.yml.dist`](app/config/parameters.yml.dist) and check if you need to adapt them. If they do not adapt with your need, or if some are missing:
1. copy the file as `.env`: `cp env.dist .env`
2. replace the variable inside `.env`
3. copy the file `parameters.yml.dist`: `cp app/config/parameters.yml.dist app/config/parameters`
4. replace eventually the variable inside this file
**Note**: If you intend to use the bundle `Chill-Doc-Store`, you will need to configure and install an openstack object storage container with temporary url middleware. You will have to configure [secret keys](https://docs.openstack.org/swift/latest/api/temporary_url_middleware.html#secret-keys).
### Run the bootstrap script
This script can be run using `make`
```bash
make init
```
This script will :
1. force docker-compose to, eventually, pull the base images and build the image used by this project ;
2. run an install script to download [`composer`](https://getcomposer.org) ;
3. install the php dependencies
### Build assets
run those commands:
```
make build-assets
```
### Start the project
```bash
docker-compose up
```
**On the first run** (and after each upgrade), you must execute *post update commands* and run database migrations. With a container up and running, execute the following commands:
```
docker-compose exec --user <uid> php php composer.phar post-update-cmd
docker-compose exec --user <uid> php app/console doctrine:migrations:migrate
```
Chill will be available at http://localhost:8001. Currently, there isn't any user or data. To add fixtures, run
```
docker-compose exec --user <uid> php app/console doctrine:fixtures:load
```
There are several users available:
- `center a_social`
- `center b_social`
The password is always `password`.
Now, read the how-tos.
## How to
### How to read the email sent by the program ?
Go at http://localhost:8005 and you should have access to mailcatcher.
In case of you should click on a link in the email, be aware that you should remove the "s" from https.
### How to execute the console ?
```
# if a container is running
docker-compose exec --user <uid> php app/console
# if not
docker-compose run --user <uid> php app/console
```
### How to create the database schema (= run migrations) ?
```
# if a container is running
docker-compose exec --user <uid> php app/console doctrine:migrations:migrate
# if not
docker-compose run --user <uid> php app/console doctrine:migrations:migrate
```
### How to load fixtures ?
```
# if a container is running
docker-compose exec --user <uid> php app/console doctrine:fixtures:load
# if not
docker-compose run --user <uid> php app/console doctrine:fixtures:load
```
### How to open a terminal in the project
```
# if a container is running
docker-compose exec --user <uid> php /bin/bash
# if not
docker-compose run --user <uid> php /bin/bash
```
### How to run composer ?
```
# if a container is running
docker-compose exec --user <uid> php ./composer.phar
# if not
docker-compose run --user <uid> php ./composer.phar
```
### How to access to PGADMIN ?
Pgadmin is installed with docker-compose.
You can access it at http://localhost:8002 .
Credentials:
- login: admin@chill.social
- password: password
### How to run tests ?
Tests reside inside the installed bundles. You must `cd` into that directory, download the required packages, and execute them from this place.
**Note**: some bundle require the fixture to be executed. See the dedicated _how-tos_.
Exemple, for running test inside `main` bundle:
```
# mount into the php image
docker-compose run --user <uid> php /bin/bash
# cd into main directory
cd vendor/chill-project/main
# download deps
php ../../../composer.phar install
# run tests
/vendor/bin/phpunit
```
### How to run webpack interactively
Executing `bash docker-node.sh` will open a terminal in a node:9 container, with volumes mounted.
### Error `An exception has been thrown during the rendering of a template ("Asset manifest file "/var/www/app/web/build/manifest.json" does not exist.").` on first run
Run `make build-assets`
## Running in production
TODO
## Design principles
### Why the DB URL is set in environment, and not in parameters.yml ?
Because, at startup, a script does check the db is up and, if not, wait for a couple of seconds before running [`entrypoint.sh`](entrypoint.sh). For avoiding double configuration, the configuration of the PHP app takes his configuration from environment also (and it will be standard in future releases, with symfony 4.0).
......@@ -27,7 +27,8 @@
"require-dev": {
"sensio/generator-bundle": "~3.0",
"fzaninotto/faker": "~1",
"phpunit/phpunit": "^7.0"
"phpunit/phpunit": "^7.0",
"phpdocumentor/phpdocumentor": "2.*"
},
"scripts": {
"symfony-scripts": [
......
# enable or disable debug
APP_DEBUG=true
# environment to run the project
APP_ENV=dev
# the user which run php-fpm. Adapt it to your current uid. (get it with `id -u`)
PHP_FPM_USER=1000
# the group which run php-fpm. Adapt it to your current gid. (get it with `id -g`)
PHP_FPM_GROUP=1000
# the credential to access to pgadmin
PGADMIN_DEFAULT_EMAIL=admin@chill.social
PGADMIN_DEFAULT_PASSWORD=password
# create your custom image
# IMAGE_NGINX=my.registry/domain/image_nginx
# IMAGE_PHP=my.registry/domain/image_php
# for chill-doc-store only. Optional
OS_USERNAME=usernam3
OS_PASSWORD=pa$$w0rd
OS_TENANT_ID=id
OS_REGION_NAME=GRA3
OS_AUTH_URL=https://auth.cloud.ovh.net/v2.0/
ASYNC_UPLOAD_TEMP_URL_KEY=mySecretKey
# do not forget trailing slash
ASYNC_UPLOAD_TEMP_URL_BASE_PATH=https://path.to.storage/AUTH_123/mycontainer/
ASYNC_UPLOAD_TEMP_URL_CONTAINER=mycontainer
<?xml version="1.0" encoding="UTF-8" ?>
<phpdoc>
<parser>
<target>phpdoc</target>
</parser>
<transformer>
<target>phpdoc</target>
</transformer>
<transformations>
<template name="clean" />
</transformations>
<files>
<directory>src</directory>
<directory>vendor/chill-project</directory>
<directory>vendor/symfony</directory>
<directory>vendor/doctrine</directory>
<ignore>tests/*</ignore>
<ignore>Tests/*</ignore>
</files>
</phpdoc>
Markdown is supported
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