Build Deploy Publish

Overview

This section explains how to build the web version of your app and deploy it to the correct environment.


Steps

1

Set Up the Job Pipeline

Follow the pipeline setup instructions (ignore steps that are not relevant for front-end apps).

These steps assume your CI/CD is already set up using the DIGIT ci-as-code module.

2

Add a Docker Folder

Before creating the pipeline:

  • Make sure your project has a Docker folder at the root.

  • Inside it, use the cirrusci Flutter Docker tag so Jenkins can build your app correctly.

3

Load Global Assets

  • The .env file should load global assets from the environment-specific asset files.

  • The global assets file must be in JSON format for Flutter.

Check the YAML files in each environment folder for examples.

Example (dev environment — works-dev.yaml):

works-shg-app:
  custom-js-injection: |
    sub_filter.conf: "
      sub_filter  '<head>' '<head>
      <script src=https://works-dev.digit.org/works-dev-asset/worksGlobalConfig.json type=text/javascript></script>';"

This script loads the global config file for the web build.

Build
  1. Open Jenkins

    • Go to the Jenkins dashboard.

    • Navigate to your project using the folder path. For example, to build works_shg_app, go to: digit-works → frontend → works-shg-app

  2. Start a Build

    • Click Build with Parameters.

    • In the search box, find and select your feature branch.

    • Click Build to start the process.

  3. Get the Docker Image

    • After the build finishes successfully, open the Console Output.

    • Look for the line showing the Docker image that was created.

    • Copy the Docker image ID for deployment.

Deploy
  1. Open Jenkins Deployments

  2. Add the Docker Image

    • Take the Docker image ID you copied from the build step.

    • Paste it into the input box on the deployment page.

  3. Start Deployment

    • Click Build to begin the deployment.

    • Once deployment is complete, Jenkins will show a confirmation message.

Last updated

Was this helpful?