Skip to content
Snippets Groups Projects
environments.md 3.73 KiB
Newer Older
  • Learn to ignore specific revisions
  • # Environments
    
    We have 2 environments available for this project:
    
    Bastien DUMONT's avatar
    Bastien DUMONT committed
    
    - A dev environment hosted on scaleway and managed by the dev team
    - A prod environment hosted on Cozy and managed by Cozy
    
    
    ## Dev environment aka alpha
    
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    The dev environment has been mounted on a dedicated instance on scaleway.
    
    ### Access to the dev environment
    
    You need to install an ssh tool like Putty or [MobaXterm](https://mobaxterm.mobatek.net/download.html) in order to connect to the server.
    Connection to the server is made using ssh key, you need to generate your own and ask administrator to allow your ssh key.
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    Once done, you should be able to connect to the server using your private key.
    
    #### CouchDB
    
    Bastien DUMONT's avatar
    Bastien DUMONT committed
    
    
    To connect to the database from your local computer, you can run the following command to create a SSH tunnel with local port forwarding :
    
    Bastien DUMONT's avatar
    Bastien DUMONT committed
    
    
    ```console
    ssh root@51.158.104.84 -L 8082:localhost:5984
    ```
    
    Bastien DUMONT's avatar
    Bastien DUMONT committed
    
    
    Then you can browse to [http://localhost:8082/\_utils/](http://localhost:8082/_utils/) and enter the credentials specified in the file easy-cozy/docker-compose.yml
    
    Bastien DUMONT's avatar
    Bastien DUMONT committed
    It is based on the easy-cozy project available on [Gitlab](https://forge.grandlyon.com/pocs/cozy/easy-cozy)
    
    
    On the server, the .env file has been initialize with the good secrets (see the .env.template) and also initialize to create instance with Ecolyo and the 3 needed konnectors by default.
    
    
    Bastien DUMONT's avatar
    Bastien DUMONT committed
    This project will build and run 3 images:
    
    
    - the cozy stack
    - the couch db
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    - keycloak
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    To run the project please refer to the documentation on the Gitlab project.
    
    Once the project is up and running, we are able to create, update and delete instances.
    
    Let's see more details in the [dedicated section](/docs/easycozy/scripts.md).
    
    Konnector for Ecolyo need proxy for the Oauth dance. The proxy is also mounted on the same instance as the Cozy stack and based on the project available on Gitlab: https://forge.grandlyon.com/pocs/cozy/cozy-oauth-proxy
    
    Bastien DUMONT's avatar
    Bastien DUMONT committed
    The proxy is written in Go language. The "main.go" file contains all the source code and also the default variables.
    
    Default variables are the one used for the dev environment but we will overwrite them for the production.
    
    
    To Launch the proxy, just pull the project and use the docker-compose file with following commands:
    
    Bastien DUMONT's avatar
    Bastien DUMONT committed
    
    ```sh
    
    git pull https://forge.grandlyon.com/pocs/cozy/cozy-oauth-proxy
    cd cozy-oauth-proxy
    docker-compose up -d
    ```
    
    ### Ecolyo and konnectors
    
    By default the version present on the "build-dev" branch is used to install Ecolyo app and konnectors on a new instance.
    
    
    Some scripts has been created in order to install, update, downgrade, remove app and konnectors. Please refer to the [dedicated section](/docs/easycozy/scripts.md) for more information.
    
    
    ## Prod environment
    
    This environment is fully managed by Cozy team.
    
    ### Cozy stack
    
    Fully managed by Cozy team.
    
    ### Proxy
    
    
    Bastien DUMONT's avatar
    Bastien DUMONT committed
    A dedicated proxy is deployed on Cozy side to allow konnector to make the Oauth dance.
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    The proxy deployed is based on the project available on the Gitlab but variables are overwritten using flags by the Cozy team in order to fit to the environment.
    
    
    For each modification in production, it needs:
    
    Bastien DUMONT's avatar
    Bastien DUMONT committed
    
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    - to be done on the Gitlab project
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    - to be tested in dev environment
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    After that we should ask Cozy to pull the modification from the Gitlab in order to have them in production.
    
    
    ### Ecolyo and konnectors
    
    The production environment is based on the build branch which should reflect the build of sources present on master branch.
    
    Each deployment is done manually for each app/konnector by:
    
    Bastien DUMONT's avatar
    Bastien DUMONT committed
    
    
    - building the application (yarn build)
    - deploy the build on the build branch (yarn deploy)
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    - publishing content of build branch into Cozy repository (yarn cozyPublish)
    
    Bastien DUMONT's avatar
    Bastien DUMONT committed
    Once it is published, Cozy team should validate it before deploying the new app version into all Cozy Grand Lyon instances.