Skip to content
Snippets Groups Projects
Commit 7dea4406 authored by PEDROLI Benjamin's avatar PEDROLI Benjamin
Browse files

add first files for Pilote application

parent 098ef30a
No related branches found
No related tags found
No related merge requests found
Pipeline #9696 passed
!!! 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 few 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 to 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 Pilote
### Deploy on Alpha
#### Windows
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 pilote-dev-build (development environment) use the command :
```
yarn deploy-dev
```
If you want to deploy on the pilote-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.
#### Linux
From your current branch, run ```yarn build``` then ```sudo yarn deploy_dev``` to instantly deploy your working branch on the latest tagged Pilote container registry.
!!! info ""
:construction: Section under Construction :construction:
This section will show you how to deploy your project on different environments.
### Deployment
For each environment, the CI-CD is implemented.
Once, you commit on 'dev' branch or 'rec' branch, the pipeline liked is running.
\ No newline at end of file
!!! info ""
:construction: Section under Construction :construction:
This section will allow you to launch a proper local environment of the Pilote TS back application
## Initialisation of the project
### Clone the project repository
Use following command in your favorite terminal to clone the projet:
```
git clone https://forge.grandlyon.com/solidarite/monparcourssocial/mps-travailleursocial-back.git
```
## Installation of the projet
### Start Pilote application
To start Pilote application just launch the command in a PowerShell or Windows Powershell tool:
```
yarn docker:dev
```
If the application starts successfully you should obtain two containers running:
> mps-travailleursocial-back_mps_1
> mps-travailleursocial-back_postgres_1
You can access by: http://localhost:3020/api
It will be redirect to the Swagger UI. It allow to test the different API defined.
### Run Jest test
To start test defined just launch the command in a PowerShell or Windows Powershell tool:
```
yarn test:watch
```
This section will allow you to install a proper local environment step by step for Ecolyo application using VSCode IDE.
## VSCode
### Install VSCode
Installation for VSCode can be found here: [Installation of VSCode](https://code.visualstudio.com/).
### Extensions
Installation of Extention is explained here: [Installation of Extensions](https://code.visualstudio.com/docs/editor/extension-gallery).
Here are the list of important extensions to install:
- Prettier - Code formatter
- ES7 React/Redux/GraphQL/React-Native snippets
- GitLens - Git supercharged
- Markdown Preview
Optional extensions:
- Bracket Pair Colorizer 2
- CSS Peek
- Auto Rename Tag
- indent-rainbow
- TabOut
- Liveshare (pair programming extension)
### User settings
User settings for Ecolyo are described in this section: **LINK TO SECTION TO ADD**
## Git
The project is using GitLab, you will need to install Git to checkout the projet.
Installation for Git can be found here: [Installation of Git](https://git-scm.com/).
## Node
!!! warning "Version 12"
For now please install node v12, any later version will cause side effects on sass modules!
Download [node-v12](https://nodejs.org/dist/latest-v12.x/node-v12.19.0-x64.msi)
Node.js® is a JavaScript runtime built on Chrome's V8 JavaScript engine.
## Yarn
Yarn is used as package manager for this projet. Feel free to use the one you prefere but we advice to install yarn as all the documentation is described with this package manager.
Installation for yarn can be found here: [Installation of Yarn](https://classic.yarnpkg.com/fr/docs/install/).
## Docker
Docker is a tool designed to make it easier to create, deploy, and run applications by using containers. Containers allow a developer to package up an application with all of the parts it needs, such as libraries and other dependencies, and ship it all out as one package. By doing so, thanks to the container, the developer can rest assured that the application will run on any other Linux machine regardless of any customized settings that machine might have that could differ from the machine used for writing and testing the code.
### Install Docker
Installation of Docker can be found here: [Installation of Docker](https://www.docker.com/get-started).
### Install Docker-Compose
Installation of Docker-Compose (according to your OS) is explained here: [Installation of Docker-Compose](https://docs.docker.com/compose/install/).
Pilote is a social application.
## Repository Global
[Pilote gitlab repository](https://forge.grandlyon.com/solidarite/monparcourssocial)
## Repository dedicated project
[Pilote TS backend - gitlab repository](https://forge.grandlyon.com/solidarite/monparcourssocial/mps-travailleursocial-back)
## Acces to the application deployed
DEV : https://pilote-agent-dev.grandlyon.com/
REC : https://pilote-agent-rec.grandlyon.com/
!!! info ""
:construction: Section under Construction :construction:
## Techno used
> NestJS
> Jest for th tests
> Docker
> PostgreSQL
!!! info ""
:construction: Section under Construction :construction:
This section will show you how to deploy your project on different environments.
### Deployment
For each environment, the CI-CD is implemented.
Once, you commit on 'dev' branch or 'rec' branch, the pipeline liked is running.
\ No newline at end of file
Pilote is a social application.
## Repository
[Pilote gitlab repository](https://forge.grandlyon.com/solidarite/monparcourssocial)
[Pilote TS front - gitlab repository](https://forge.grandlyon.com/solidarite/monparcourssocial/mps-travailleursocial)
\ No newline at end of file
Pilote
## Repository
[Pilote gitlab repository]()
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment