---
# System prepended metadata

title: Needs

---

## Environments
### Development
#### Installation
* Install [Git](https://git-scm.com/downloads)
* Install [Docker](https://docs.docker.com/get-docker/)
* Install [Compose](https://docs.docker.com/compose/install/)
* Install Bash 4+ (for associative arrays support: `bash --version`)
* Install [Moreutils](https://joeyh.name/code/moreutils/) (for the Sponge command)
* Install [Mutagen](https://mutagen.io/documentation/introduction/installation)
* Add the folowing line at the end of your to your `/etc/hosts` file:
``` bash
127.0.0.1 eu.dev.caudalie.com fr.dev.caudalie.com en.dev.caudalie.com es.dev.caudalie.com it.dev.caudalie.com pt.dev.caudalie.com uk.dev.caudalie.com de.dev.caudalie.com ru.dev.caudalie.com be.dev.caudalie.com tr.dev.caudalie.com be-nl.dev.caudalie.com nl.dev.caudalie.com pl.dev.caudalie.com ae.dev.caudalie.com dev.caudalie.com
```
* `git clone [this repository]`
* `cd [this repository's newly created directory]`
* Launch `./packages/clone_all.sh` to clone all the internal packages repositories in the `packages/` directory
* Get a fresh database dump by launching `mutagen project run get-fresh-db`
* Init the app configuration with `mutagen project run reset-env`
* Then launch the whole virtualized infrastructure with `mutagen project start`
* The `fpm` container will wait for the `mysql` container to be loaded & up
* The `fpm` container will log `Waiting for MySQL server...` until the database dump is loaded (only ran if the database dump is new since last `start`)
* And when you see `Run 'php-fpm -R'...` in the `fpm` container's log, you're ready to code !
* Run a little `mutagen project run setup-upgrade`, a long `mutagen project run di-compile`, and to be sure a `mutagen project run mode-set-dev`, and at last a `mutagen project run static-deploy` to initialize your app.

### Usage
#### Environment management
* `mutagen project start` to synchronize the assets and import a staging environment fresh database dump, patch Magento, install Composer packages, compile DI and clean caches (only while virtualized infrastructure is down), and then launch the virualized environment
* `mutagen project terminate` to shut down the virtualized infrastructure and reset all the data and code context
* `mutagen project pause` stop the virualized environment while keeping data and context
* `mutagen project resume` restart the virualized environment from kept data and context

#### Files manipulation
* `mutagen project run drop-volumes` stop the virualized environment and drop attached volumes (databse, composer cache and Mutagen code synchronization)
* `mutagen project run get-fresh-db` gets a fresh staging dump of the database
* `mutagen project run media-sync` rsyncs `pub/media` files from S3 backup
* `mutagen project run reset-files` empties auto created and filled directories
* `mutagen project run reset-env` copies `.platform/hooks/mcloud/deploy/env/local.env.php` to `app/etc/env.php`

#### Logs following
* `mutagen project run sys-logs` follows the logs of all the containers of the virtualized environment
* `mutagen project run app-logs` follows the app logs of the `fpm` container

#### Composer
* `mutagen project run composer-install`
* `mutagen project run composer-update`

#### Magento CLI (backend)
* `mutagen project run setup-upgrade`
* `mutagen project run di-compile`
* `mutagen project run static-deploy`
* `mutagen project run mode-set-dev`
* `mutagen project run cache-clean`
* `mutagen project run cache-flush`

#### Grunt CLI (frontend task runner)
* `mutagen project run grunt-exec-luma`: Compile frontend (js, css) files for the Luma theme
* `mutagen project run grunt-exec-backend`: Compile frontend (js, css) files for the Backend theme
* `mutagen project run grunt-exec-blank`: Compile frontend (js, css) files for the Blank theme
* `mutagen project run grunt-watch-luma`: Watch frontend (js, css) files for the Luma theme and dynamicaly compile them. Browser hot-reload available with [LiveReload](https://chrome.google.com/webstore/detail/livereload/jnihajbhpnppcggbcgedagnkighmdlei?hl=en)
* `mutagen project run grunt-watch-backend`: Watch frontend (js, css) files for the Backend theme and dynamicaly compile them. Browser hot-reload available with [LiveReload](https://chrome.google.com/webstore/detail/livereload/jnihajbhpnppcggbcgedagnkighmdlei?hl=en)
* `mutagen project run grunt-watch-blank`: Watch frontend (js, css) files for the Blank theme and dynamicaly compile them. Browser hot-reload available with [LiveReload](https://chrome.google.com/webstore/detail/livereload/jnihajbhpnppcggbcgedagnkighmdlei?hl=en)

### Logging in code
`$this->objectManager->get(LoggerInterface::class)->error('message');`

### Tools
* admin:
* NewRelic:
* Gandi
* Magento Cloud
* Artifakt
* Easyware

* phpinfo : `<SITE_URL>/phpinfo` on all environments except production

### CI/CD
Developper's workflow
![Caudalie CI/CD development workflow](workflow.jpg "Caudalie CI/CD development workflow")

#### Per stage
| stage \ branch      | dev | dev-d | int | int-d | sta | sta-d | mas | mas-d |
|:--------------------|:---:|:-----:|:---:|:-----:|:---:|:-----:|:---:|:-----:|
| lint                |   + |       |   + |       |     |       |     |       |
| build-and-fix       |   + |       |   + |       |     |       |     |       |
| dist                |   + |       |   + |       |   + |       |   + |       |
| deploy-production   |     |       |     |       |     |       |     |     + |
| deploy-staging      |     |       |     |       |     |     + |     |       |
| deploy              |     |     + |     |     + |     |       |     |       |
| sync-and-deploy     |     |     + |     |     + |     |     + |     |       |
| maintenance-db-dump |     |     + |     |     + |     |     + |     |       |

#### Per branch
| branch \ stage      | lin | baf | dis | dpr | dst | dep | sad | mdd |
|:--------------------|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|
| develop(*)          |   + |   + |   + |     |     |     |     |     |
| develop(*)-dist     |     |     |       |     |     |   + |   + |   + |
| integration(*)      |   + |   + |   + |     |     |     |     |     |
| integration(*)-dist |     |     |     |     |     |   + |   + |   + |
| staging(*)          |     |     |   + |     |     |     |     |     |
| staging(*)-dist     |     |     |     |     |   + |     |   + |   + |
| master              |     |     |   + |     |     |     |     |     |
| master-dist         |     |     |     |   + |     |     |     |     |

common:
* change git origin to gitlab's oauth2 url (?)
* change git upstream to magento cloud "equivalent" branch

lint
* PHP, Shell and YAML syntax checks

build-and-fix
* checks on syntax and coherence -> push & exit if diff
* composer update and check `composer.lock` -> push & exit if diff
* enable disable magento modules -> push & exit if diff
* apply magento2 cloud patches
* `bin/magento setup:di:compile`

dist `$CLOUD_BRANCH`
* copy artifact scripts to root directory
* add .dist file with vendors directory hashsum to repository

deploy* `$CLOUD_BRANCH` `$FORCE`
* git push to magento cloud equivalent branch with `.force.deploy` file on integration branches
* check if deployed and notify

sync-and-deploy `$CAUDALIE_AREA` `$CLOUD_BRANCH`
* dump database on the upstream environment (production for staging, staging for integration, ...)
* re import database current environment
* git push to magento cloud equivalent branch with `.force.deploy` file
* check if deployed and notify

maintenance-db-dump
* dump database on corresponding environment

## Code Corpuses
### Main repositories
* [Sources EU](https://git.caudaliepro.com/magento/v2/projects/source-eu)
* [Sources HK](https://git.caudaliepro.com/magento/v2/projects/source-hk)
* [Sources US](https://git.caudaliepro.com/magento/v2/projects/source-us)

### Caudalie extensions repositories
* Languages
  * [de DE](https://git.caudaliepro.com/magento/v2/modules/caudalie/language-de-de.git)
  * [en CA](https://git.caudaliepro.com/magento/v2/modules/caudalie/language-en-ca.git)
  * [en GB](https://git.caudaliepro.com/magento/v2/modules/caudalie/language-en-gb.git)
  * [en US](https://git.caudaliepro.com/magento/v2/modules/caudalie/language-en-us.git)
  * [es MX](https://git.caudaliepro.com/magento/v2/modules/caudalie/language-es-mx.git)
  * [es ES](https://git.caudaliepro.com/magento/v2/modules/caudalie/language-es-es.git)
  * [fr CA](https://git.caudaliepro.com/magento/v2/modules/caudalie/language-fr-ca.git)
  * [fr FR](https://git.caudaliepro.com/magento/v2/modules/caudalie/language-fr-fr.git)
  * [it IT](https://git.caudaliepro.com/magento/v2/modules/caudalie/language-it-it.git)
  * [nl NL](https://git.caudaliepro.com/magento/v2/modules/caudalie/language-nl-nl.git)
  * [pl PL](https://git.caudaliepro.com/magento/v2/modules/caudalie/language-pl-pl.git)
  * [pt BR](https://git.caudaliepro.com/magento/v2/modules/caudalie/language-pt-br.git)
  * [pt PT](https://git.caudaliepro.com/magento/v2/modules/caudalie/language-pt-pt.git)
  * [ru RU](https://git.caudaliepro.com/magento/v2/modules/caudalie/language-ru-ru.git)
  * [tr TR](https://git.caudaliepro.com/magento/v2/modules/caudalie/language-tr-tr.git)
* Libraries
  * [Framework Barcode](https://git.caudaliepro.com/magento/v2/modules/caudalie/library-framework-barcode.git)
  * [Framework Exception](https://git.caudaliepro.com/magento/v2/modules/caudalie/library-framework-exception.git)
* Modules Caudalie
  * [AdminHTML Context](https://git.caudaliepro.com/magento/v2/modules/caudalie/module-adminhtml-context.git)
  * [Advanced Checkout](https://git.caudaliepro.com/magento/v2/modules/caudalie/module-advanced-checkout.git)
  * [Adyen Payment](https://git.caudaliepro.com/magento/v2/modules/caudalie/module-adyen-payment.git)
  * [AlgoliaSearch](https://git.caudaliepro.com/magento/v2/modules/caudalie/module-algoliasearch.git)
  * [AWS](https://git.caudaliepro.com/magento/v2/modules/caudalie/module-aws.git)
  * [Banner](https://git.caudaliepro.com/magento/v2/modules/caudalie/module-banner.git)
  * [Base](https://git.caudaliepro.com/magento/v2/modules/caudalie/module-base.git)
  * [Beauty Profile](https://git.caudaliepro.com/magento/v2/modules/caudalie/module-beauty-profile.git)
  * [Catalog](https://git.caudaliepro.com/magento/v2/modules/caudalie/module-catalog.git)
  * [Catalog Context](https://git.caudaliepro.com/magento/v2/modules/caudalie/module-catalog-context.git)
  * [Catalog Export](https://git.caudaliepro.com/magento/v2/modules/caudalie/module-catalog-export.git)
  * [Catalog Staging](https://git.caudaliepro.com/magento/v2/modules/caudalie/module-catalog-staging.git)
  * [Checkout](https://git.caudaliepro.com/magento/v2/modules/caudalie/module-checkout.git)
  * [CMS](https://git.caudaliepro.com/magento/v2/modules/caudalie/module-cms.git)
  * [Configurable Product](https://git.caudaliepro.com/magento/v2/modules/caudalie/module-configurable-product.git)
  * [Connect As](https://git.caudaliepro.com/magento/v2/modules/caudalie/module-connect-as.git)
  * [Contact](https://git.caudaliepro.com/magento/v2/modules/caudalie/module-contact.git)
  * [Content](https://git.caudaliepro.com/magento/v2/modules/caudalie/module-content.git)
  * [Creeper](https://git.caudaliepro.com/magento/v2/modules/caudalie/module-creeper.git)
  * [Cron](https://git.caudaliepro.com/magento/v2/modules/caudalie/module-cron.git)
  * [Customer](https://git.caudaliepro.com/magento/v2/modules/caudalie/module-customer.git)
  * [Customer Account Creator](https://git.caudaliepro.com/magento/v2/modules/caudalie/module-customer-account-creator.git)
  * [Customer Balance](https://git.caudaliepro.com/magento/v2/modules/caudalie/module-customer-balance.git)
  * [Customer Context](https://git.caudaliepro.com/magento/v2/modules/caudalie/module-customer-context.git)
  * [Custome Custom Attributes](https://git.caudaliepro.com/magento/v2/modules/caudalie/module-customer-custom-attributes.git)
  * [Customer Loyalty](https://git.caudaliepro.com/magento/v2/modules/caudalie/module-customer-loyalty.git)
  * [District](https://git.caudaliepro.com/magento/v2/modules/caudalie/module-district.git)
  * [Easyware Attachments](https://git.caudaliepro.com/magento/v2/modules/caudalie/module-easiware-attachments.git)
  * [EasywareClient](https://git.caudaliepro.com/magento/v2/modules/caudalie/module-easiwareclient.git)
  * [Ecommerce Switch](https://git.caudaliepro.com/magento/v2/modules/caudalie/module-ecommerce-switch.git)
  * [Employees](https://git.caudaliepro.com/magento/v2/modules/caudalie/module-employees.git)
  * [ERP](https://git.caudaliepro.com/magento/v2/modules/caudalie/module-erp.git)
  * [FAQ](https://git.caudaliepro.com/magento/v2/modules/caudalie/module-faq.git)
  * [Feed](https://git.caudaliepro.com/magento/v2/modules/caudalie/module-feed.git)
  * [Fidelity](https://git.caudaliepro.com/magento/v2/modules/caudalie/module-fidelity.git)
  * [Fixer](https://git.caudaliepro.com/magento/v2/modules/caudalie/module-fixer.git)
  * [FTP](https://git.caudaliepro.com/magento/v2/modules/caudalie/module-ftp.git)
  * [Gift Card](https://git.caudaliepro.com/magento/v2/modules/caudalie/module-gift-card.git)
  * [Gift Card Account](https://git.caudaliepro.com/magento/v2/modules/caudalie/module-gift-card-account.git)
  * [Gift Wrapping](https://git.caudaliepro.com/magento/v2/modules/caudalie/module-gift-wrapping.git)
  * [Google](https://git.caudaliepro.com/magento/v2/modules/caudalie/module-google.git)
  * [GTM](https://git.caudaliepro.com/magento/v2/modules/caudalie/module-gtm.git)
  * [Iadvize](https://git.caudaliepro.com/magento/v2/modules/caudalie/module-iadvize.git)
  * [Ingredients](https://git.caudaliepro.com/magento/v2/modules/caudalie/module-ingredients.git)
  * [Instagram](https://git.caudaliepro.com/magento/v2/modules/caudalie/module-instagram.git)
  * [Invoicer](https://git.caudaliepro.com/magento/v2/modules/caudalie/module-invoicer.git)
  * [Landing](https://git.caudaliepro.com/magento/v2/modules/caudalie/module-landing.git)
  * [Mailer](https://git.caudaliepro.com/magento/v2/modules/caudalie/module-mailer.git)
  * [My Caudalie Pickup Points](https://git.caudaliepro.com/magento/v2/modules/caudalie/module-my-caudalie-pickup-points.git)
  * [Navigation](https://git.caudaliepro.com/magento/v2/modules/caudalie/module-navigation.git)
  * [Newletter](https://git.caudaliepro.com/magento/v2/modules/caudalie/module-newsletter.git)
  * [NPS](https://git.caudaliepro.com/magento/v2/modules/caudalie/module-nps.git)
  * [Online Booking WS](https://git.caudaliepro.com/magento/v2/modules/caudalie/module-online-booking-ws.git)
  * [Online Booking](https://git.caudaliepro.com/magento/v2/modules/caudalie/module-online-booking.git)
  * [Product Discount](https://git.caudaliepro.com/magento/v2/modules/caudalie/module-product-discount.git)
  * [Quote](https://git.caudaliepro.com/magento/v2/modules/caudalie/module-quote.git)
  * [Relay Point](https://git.caudaliepro.com/magento/v2/modules/caudalie/module-relay-point.git)
  * [Review](https://git.caudaliepro.com/magento/v2/modules/caudalie/module-review.git)
  * [RMA](https://git.caudaliepro.com/magento/v2/modules/caudalie/module-rma.git)
  * [Sales](https://git.caudaliepro.com/magento/v2/modules/caudalie/module-sales.git)
  * [Sales Rule](https://git.caudaliepro.com/magento/v2/modules/caudalie/module-sales-rule.git)
  * [Sample](https://git.caudaliepro.com/magento/v2/modules/caudalie/module-sample.git)
  * [Setup](https://git.caudaliepro.com/magento/v2/modules/caudalie/module-setup.git)
  * [SocialURL](https://git.caudaliepro.com/magento/v2/modules/caudalie/module-socialurl.git)
  * [Socolissimo](https://git.caudaliepro.com/magento/v2/modules/caudalie/module-socolissimo.git)
  * [Socolissimo Context](https://git.caudaliepro.com/magento/v2/modules/caudalie/module-socolissimo-context.git)
  * [SPA](https://git.caudaliepro.com/magento/v2/modules/caudalie/module-spa.git)
  * [Sponsor](https://git.caudaliepro.com/magento/v2/modules/caudalie/module-sponsor.git)
  * [Stock Notification](https://git.caudaliepro.com/magento/v2/modules/caudalie/module-stock-notification.git)
  * [Store Locator](https://git.caudaliepro.com/magento/v2/modules/caudalie/module-store-locator.git)
  * [Store Locator API](https://git.caudaliepro.com/magento/v2/modules/caudalie/module-store-locator-api.git)
  * [SyntaxHighlighter](https://git.caudaliepro.com/magento/v2/modules/caudalie/module-syntaxhighlighter.git)
  * [Task](https://git.caudaliepro.com/magento/v2/modules/caudalie/module-task.git)
  * [Tax](https://git.caudaliepro.com/magento/v2/modules/caudalie/module-tax.git)
  * [Theme](https://git.caudaliepro.com/magento/v2/modules/caudalie/module-theme.git)
  * [Widgets](https://git.caudaliepro.com/magento/v2/modules/caudalie/module-widgets.git)
  * [Wishlist](https://git.caudaliepro.com/magento/v2/modules/caudalie/module-wishlist.git)
  * [CartsGuru](https://git.caudaliepro.com/magento/v2/modules/caudalie/module-cartsguru.git)
  * [Fasterize](https://git.caudaliepro.com/magento/v2/modules/caudalie/module-fasterize.git)
  * [CSV Manager](https://git.caudaliepro.com/magento/v2/modules/caudalie/module-csv-manager.git)
* Themes
  * [Frontend Default](https://git.caudaliepro.com/magento/v2/modules/caudalie/theme-frontend-default.git)

### Smile extensions repositories
* [Backend](https://git.caudaliepro.com/magento/v2/modules/smile/Smile_Backend)
* [Connector](https://git.caudaliepro.com/magento/v2/modules/smile/Smile_Connector)
* [Core](https://git.caudaliepro.com/magento/v2/modules/smile/Smile_Core)
* [Cron](https://git.caudaliepro.com/magento/v2/modules/smile/Smile_Cron)
* [EAV](https://git.caudaliepro.com/magento/v2/modules/smile/Smile_Eav)
* [Indexer](https://git.caudaliepro.com/magento/v2/modules/smile/Smile_Indexer)
* [Reconfigure](https://git.caudaliepro.com/magento/v2/modules/smile/Smile_Reconfigure)
* [Setup](https://git.caudaliepro.com/magento/v2/modules/smile/Smile_Setup)
* [Varnish](https://git.caudaliepro.com/magento/v2/modules/smile/Smile_Varnish)

# Needs
* DNS zones (Gandi ?)
* SSL certificates management (Let's Encrypt ?)
* partners sources
* IP whitelisters partners
* Caudalie admin access
* Easyware acess
* Easyware API documentation
* Mutagen access ?
* Blackfire access
* DB dumps access
* Magento Cloud licence management
* Fastly access
* access to Gitlab CI variables
* assets backup workflows
* data backup workflows


# Artifakt Todos
* Data recovery time tests
* Full recovery time tests
* Artifakt CDN ?
