Skip to content
Snippets Groups Projects
Commit c0c20426 authored by Guilhem CARRON's avatar Guilhem CARRON
Browse files

Add deploy infos

parent 6ebdf664
No related branches found
No related tags found
No related merge requests found
!!! info ""
:construction: Section under Construction :construction:
This section will show you how to deploy your project on different environments.
## Setup
......@@ -8,108 +5,81 @@ This section will show you how to deploy your project on different environments.
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**.
## Configuration of MobaXterm
### Install your Linux distribution
First open a new session and connect to the distant host **51.158.104.84**. Don't forget to add the path to the private key in the advanced SSH settings. Also don't forget to ask an administrator to add your public key so you can access the server.
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.
## Deploy Ecolyo
To make sure it's correctly installed and working, you can open Powershell and paste the following command :
### Deploy on Alpha - Scaleway
```powershell
wsl.exe --list --running
```
Now you should see the name of your distribution in the list.
There is 2 environment you can deploy on alpha for testing:
### Setup your distribution
- ecolyo_dev
- ecolyo_test
Start updating the packages list by typing :
```
sudo apt update
```
#### Windows
Install nodejs using the apt package manager
If you use windows, make sure you have WSL installed and a Linux distribution. For more information about it see the (Install WSL section)[../getting_started/setup_your_environment.md]
```
sudo apt install
```
First open your Ubuntu terminal (or any other distribution you've installed), 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 :
To verify the Installation execute the following command :
```
nodejs --version
yarn build
```
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
```
After this, you can launch the deployment.
In order to deploy on ecolyo_dev (development environment) use the command :
To verify the npm Install check using the command :
```
npm --version
```
To Downlaod and Setup Yarn
```
sudo apt install yarn
yarn deploy-dev
```
To check the Installed version of Yarn :
If you want to deploy on the ecolyo-build environment, use :
```
yarn --version
yarn deploy
```
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 :
To deploy on the llle-build environment, you'll have to drag and drop your build folder directly in llle-build using MobaXterm.
```
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.
#### Linux
From your current branch, run `yarn build` then `sudo yarn deploy_dev` to instantly deploy your working branch on the latest tagged Ecolyo-dev container registry.
## Configuration of MobaXterm
### Create an instance
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.
If you want to create a specific instance, please ask for the admin.
## Deploy Ecolyo
### Reset your instance
### Deploy on Alpha - Scaleway
Once you've deployed your branch, connect to Scaleway server using mobaXterm (or any other software), and then go to the admin-scripts folder in easy-cozy
#### 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
cd easy-cozy/admin_scripts
```
After this, you can launch the deployment.
In order to deploy on ecolyo-dev-build (development environment) use the command :
If you want to reset your instance, use the script reset_instance.sh with the name of your instance
```
yarn deploy-dev
./reset-instance.sh <instance-name>
```
If you want to deploy on the ecolyo-build environment, use :
You'll be prompted for the complete url of your instance in order to confirm the reset
```
yarn deploy
<instance-name>.cozy.self-data.alpha.grandlyon.com
```
To deploy on the llle-build environment, you'll have to drag and drop your build folder directly in llle-build using MobaXterm.
After this, you'll have to activate your cozy instance by clicking on the prompted url with the registration token and choose a password for your instance.
Once it is done, you can process on the update of your app.
#### Linux
#### Update Ecolyo App
In order to update your app, you can execute the script depending on the branch you deployed. Keep in mind to prioritize using ecolyo_test for your testings.
```
./update_ecolyo_test.sh <instance-name>
```
From your current branch, run ```yarn build``` then ```sudo yarn deploy_dev``` to instantly deploy your working branch on the latest tagged Ecolyo-dev container registry.
Now you can access your updated version of Ecolyo with the following URl, enjoy : `ecolyo.instance-name.cozy.self-data.alpha.grandlyon.com`
......@@ -63,6 +63,7 @@ If this file is not empty, you can simply add the follwing lines to it:
"diffEditor.ignoreTrimWhitespace": false,
"window.zoomLevel": 0,
```
## Git
The project is using GitLab, you will need to install Git to checkout the projet.
......@@ -90,3 +91,111 @@ Installation of Docker can be found here: [Installation of Docker](https://www.d
### Install Docker-Compose
Installation of Docker-Compose (according to your OS) is explained here: [Installation of Docker-Compose](https://docs.docker.com/compose/install/).
### 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 updating the packages list by typing :
```
sudo apt update
```
Install 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.
### Upgrade to WSL 2
If you're on WSL 1 and want to upgrade to WSL 2, here is the process :
Open an elevated powershell and paste the following command :
```
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
```
Then, enable the Virtual Machine Platform optional feature.
```
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
```
Now restart your computer to apply these features. Once it's done, open an elevated powershell again and set the default wsl version to 2
```
wsl --set-default-version 2
```
You might see this message after running the command above:
> :bulb: WSL 2 requires an update to its kernel component. For information please visit https://aka.ms/wsl2kernel.
If you do, please follow the link [https://aka.ms/wsl2kernel](https://aka.ms/wsl2kernel) and install the MSI from that page on Microsoft's documentation to install a Linux kernel on your machine for WSL 2 to use. Once you have the kernel installed, please run the wsl --set-default-version 2 command again and it should complete successfully without showing the message.
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