Skip to content
Snippets Groups Projects
deploy.md 2.96 KiB
Newer Older
  • Learn to ignore specific revisions
  • # Deploy
    
    This section will show you how to deploy your project on different environments.
    
    ## Deploy build to builds branches
    
    Yoan VALLET's avatar
    Yoan VALLET committed
    3 builds branch are today available for Ecolyo:
    
    - **build**: reflect the build of the master branch and the version deployed in production environment
    - **build-dev**: reflect the build of the dev branch and the version deployed on dev environment
    - **build-test**: reflect a temporary build which can be used for test purpose
    
    !!! info "Windows users"
    
    Bastien DUMONT's avatar
    Bastien DUMONT committed
        Some command did not run on Windows. Please use your Linux distribution installed on your WSL. For more information about it see the [Install WSL section](../../wsl.md)
    
    Make sure that:  
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    - you are on the right branch (dev or master) depending on the environment you need to deploy.
    
    - your branch is up to date
    - you node modules are up to date
    
    First build the application :
    
    Bastien DUMONT's avatar
    Bastien DUMONT committed
    
    ```sh
    yarn build
    
    Next you can deploy the build to the target branch:
    
    Bastien DUMONT's avatar
    Bastien DUMONT committed
    
    ```sh
    
    Yoan VALLET's avatar
    Yoan VALLET committed
    # deploy on build-test branch
    
    Bastien DUMONT's avatar
    Bastien DUMONT committed
    yarn deploy-test
    
    Yoan VALLET's avatar
    Yoan VALLET committed
    # deploy on build-dev branch
    
    Bastien DUMONT's avatar
    Bastien DUMONT committed
    yarn deploy-dev
    
    Yoan VALLET's avatar
    Yoan VALLET committed
    # deploy on build branch
    
    Bastien DUMONT's avatar
    Bastien DUMONT committed
    yarn deploy
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
    ## Auto deploy for dev
    
    In order to prevent manual action for deployment, a gitlab-runner has been configured to deploy every changes on the `dev` branch on our test [env](https://ecolyo.ecolyodemo.cozy.self-data.alpha.grandlyon.com/)
    
    !!! info "cicd scripts"
    
        You can find all scripts used in cicd jobs on the following [repository](https://forge.grandlyon.com/web-et-numerique/factory/llle_project/ecolyo-infra-scripts)
    
    Yoan VALLET's avatar
    Yoan VALLET committed
    ## Deploy build-test branch to one Scaleway instance for testing
    
    You can directly use the content of build-test branch to update one instance for test purpose.
    
    Bastien DUMONT's avatar
    Bastien DUMONT committed
    Simply use the dedicated script `update_ecolyo_test.sh <instance_name>` with the targeted instance (from the server).
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    By default we use the ecolyotest instance for testing intermediate functionality.
    
    Bastien DUMONT's avatar
    Bastien DUMONT committed
    For more information you can check for [Easy Cozy scripts](../../../easycozy/commands/).
    
    Yoan VALLET's avatar
    Yoan VALLET committed
    
    ## Deploy build-dev branch to all Scaleway instances
    
    You can directly use the content of build-dev branch to update apps on dev environment using scripts (from the server).
    
    Bastien DUMONT's avatar
    Bastien DUMONT committed
    Simply use the dedicated script `update_all_ecolyo_dev.sh` (from the server).
    For more information you can check for [Easy Cozy scripts](../../../easycozy/commands/).
    
    ## Deploy build branch to Cozy
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    
    
    You can deploy content of build branch into Cozy registry by using the cozy-app-publish command after replacing following value:
    
    Guilhem CARRON's avatar
    Guilhem CARRON committed
    
    
    Bastien DUMONT's avatar
    Bastien DUMONT committed
    - $COZY_TOKEN : token provided by Cozy team
    
    Yoan VALLET's avatar
    Yoan VALLET committed
    - $VERSION_NUMBER: version of the application
    
    Bastien DUMONT's avatar
    Bastien DUMONT committed
    - $COZY_SPACE: space of the Cozy
    
    Guilhem CARRON's avatar
    Guilhem CARRON committed
    
    
    Bastien DUMONT's avatar
    Bastien DUMONT committed
    :warning: Make sure that the **build branch** is up to date and was build with **prod configuration**
    
    
    Bastien DUMONT's avatar
    Bastien DUMONT committed
    ```sh
    
    Bastien DUMONT's avatar
    Bastien DUMONT committed
    yarn cozy-app-publish \
    --token $COZY_TOKEN \
    
    --build-url https://forge.grandlyon.com/web-et-numerique/factory/llle_project/ecolyo/-/archive/build/ecolyo-build.tar.gz \
    
    Bastien DUMONT's avatar
    Bastien DUMONT committed
    --manual-version $VERSION_NUMBER \
    --space $COZY_SPACE
    
    Guilhem CARRON's avatar
    Guilhem CARRON committed
    ```
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    
    
    Bastien DUMONT's avatar
    Bastien DUMONT committed
    More information at [cozy-app-publish](https://docs.cozy.io/en/cozy-app-publish/#manual-usage-not-recommended)