From b92d4fb35fddc0521e0adedc7e66a5ed251436b2 Mon Sep 17 00:00:00 2001
From: CARRON Guilhem <guilhem.carron@soprasteria.com>
Date: Fri, 31 Jul 2020 15:02:57 +0200
Subject: [PATCH] Add deploy page (WSL installation + deploy)

---
 docs/application/deploy.md | 107 +++++++++++++++++++++++++++++++++++++
 mkdocs.yml                 |   1 +
 2 files changed, 108 insertions(+)
 create mode 100644 docs/application/deploy.md

diff --git a/docs/application/deploy.md b/docs/application/deploy.md
new file mode 100644
index 0000000..e82f453
--- /dev/null
+++ b/docs/application/deploy.md
@@ -0,0 +1,107 @@
+!!! info ""
+    :construction: Section under Construction :construction:
+
+This section will show you how to deploy your project on different environments.
+
+## Setup
+
+First of all you'll need to install [MobaXterm](https://mobaxterm.mobatek.net/download.html) in order to connect to the server.
+Then, if your're on Linux you can skip the following section, otherwise if you are on Windows you'll have to install Windows Subsystem for Linux (WSL) since the deployment of the app is not working with windows commands.
+
+### Install WSL
+
+First open Powershell as administrator and launch the following command : 
+
+```powershell
+dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
+```
+
+This command will install WSL on your computer. After this, you'll need to reboot.
+
+### Install your Linux distribution
+
+After reboot, open the microsoft store and install the distribution of your choice (for example : Ubuntu 20.04 LTS). Once it's done, open it and after a fex minutes you'll be prompted for the creation of a user account.
+
+To make sure it's correctly installed and working, you can open Powershell and paste the following command : 
+
+```powershell
+wsl.exe --list --running
+```
+Now you should see the name of your distribution in the list.
+
+### Setup your distribution
+
+Start Up Updating the packages list by typing :
+```
+sudo apt update
+```
+
+Install the nodejs using the apt package manager
+
+```
+sudo apt install 
+```
+
+To verify the Installation execute the following command :
+```
+nodejs --version
+```
+
+To be able to download npm package, you need to install the npm, the Node.js package manager. To do so type :
+```
+sudo apt install npm
+```
+
+To verify the npm Install check using the command :
+```
+npm --version
+```
+To Downlaod and Setup Yarn
+```
+sudo apt install yarn
+```
+
+To check the Installed version of Yarn:
+
+```
+yarn --version
+```
+
+Now you'll probably be in version 0.23+git, if so you'll have to upgrade 1.22 to make everything work properly.
+In order to achieve this, you'll have to launch several commands : 
+
+```
+sudo apt-get remove cmdtest
+sudo apt autoremove
+sudo apt-get update
+sudo apt install curl -y
+curl -o- -L https://yarnpkg.com/install.sh | bash
+source ~/.bashrc
+```
+Now you should be at least in version ^1.22 and ready to go on.
+
+
+## Configuration of MobaXterm
+
+First open a new session and connect to the distant host **192.168.62.31**. Don't forget to add the path to the private key in the advanced SSH settings.
+
+## Deploy your branch/app
+
+First open your Ubuntu terminal, and clone the project in the repertory of your choice. Once you've selected the branch of you want to deploy, write the following command : 
+```
+yarn build
+```
+After this, you can launch the deployment. 
+In order to deploy on ecolyo-dev-build (development environment) use the command :
+
+```
+yarn deploy-dev
+```
+
+If you want to deploy on the ecolyo-build environment, use :
+
+```
+yarn deploy
+```
+
+To deploy on the llle-build environment, you'll have to drag and drop your build folder directly in llle-build using MobaXterm.
diff --git a/mkdocs.yml b/mkdocs.yml
index 6b0f046..8c76177 100644
--- a/mkdocs.yml
+++ b/mkdocs.yml
@@ -34,6 +34,7 @@ nav:
       - Description: application/description.md
       - Scaffolding: application/scaffolding.md
       - Gitflow: application/gitflow.md
+      - Deploy: application/deploy.md
   - Konnectors:
       - Enedis: konnectors/enedis.md
       - GRDF: konnectors/grdf.md
-- 
GitLab