tristanbes / resop

Home Page:https://resop.aws.mroca.fr/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Projet ResOp - Réserve Opérationnelle

Planning mockup

Contributing

pipeline status coverage report

Install

Requirements

  • git
  • make
  • docker >= 18.06
  • docker-compose >= 1.23

Install

Linux

git clone git@github.com:crf-devs/resop.git && cd resop
make

OS X

git clone git@github.com:crf-devs/resop.git && cd resop

make pre-configure
make configure

# Caution: you need to uncomment all `:cached` lines in the `the docker-compose.override.yml` file

make all

Run

After the make command, go to http://resop.vcap.me:7500/, or https://resop.vcap.me:7583/ for https (self signed certificate).

If you want to run a symfony or a php command: bin/tools <command>, example: bin/tools bin/console

Run : after a first install

You don't need to buld all the stack every time. If there is no new vendor, you can simply run:

make start

Access

The project is using a Traefik proxy in order to allow access to all the HTTP services of the project. This service is listening on the 7500 port of the host. The *.vcap.me domain names are binded on localhost. In order to use them offline, you only have to add a 127.0.0.1 adminer.vcap.me resop.vcap.me traefik.vcap.me line on your /etc/hosts file.

Stack

Caution: the traefik proxy will only serve healthy containers. The api container can be unaccessible before the first healthcheck (5s).

HTTPS

The nginx container is available over HTTPS. This url must be used in order to use Facebook, Gmaps, camera...

Before commiting

Please always run the following commands before commiting, or the CI won't be happy ;-)

make fix-cs
make test

Hint: you can run make fix-cs-php instead of make fix-cs if you are one of those backend devs who don't touch any css or js file.

Tests

make test # Run all tests except coverage
make test-cs # php-cs-fixer
make test-advanced # phpstan
make test-unit # phpunit
make test-unit-coverage # phpunit + phpdbg

PHP

Tools & commands

As the php-fpm docker container doesn't contain any dev tool as composer, all dev commands must be run on the tools container. For example:

bin/tools composer
bin/tools bin/console cache:clear
bin/tools # to open a shell on the tools container

Blackfire

In order to profile the php app with Blackfire, you need to have a Blackfire account, then:

  • Add your credentials in the .env file
  • Uncomment the blackfire service in the docker-compose.override.yml file
  • Uncomment the blackfire env var for the backend_php service in the docker-compose.override.yml file
  • docker-compose up -d --force-recreate backend_php blackfire
  • That's it, you can profile the app!

Node

A node container is available in order to run yarn commands for webpack encore:

bin/node-tools yarn encore dev

webpack-build-dev
make webpack-watch-dev

About

https://resop.aws.mroca.fr/


Languages

Language:PHP 71.8%Language:HTML 15.0%Language:JavaScript 6.5%Language:Makefile 1.8%Language:Dockerfile 1.8%Language:CSS 1.7%Language:Shell 1.4%