Build and deploy instructions
eGov recommends CD/CI be set up before developing on top of DIGIT. This ensures that new modules can be developed and deployed in a streamlined way. DIGIT ships with CI as code as part of the DevOps repository. Please run the CI installer to setup DIGIT CD/CI prior to developing on DIGIT.
Step 1: Add entry in build-config.yaml file in the master branch of the forked MDMS repository. This will setup the job pipeline in Jenkins. Make sure to also add the same config to the feature branch you are working on. Refer to this example - https://github.com/egovernments/DIGIT-Dev/commit/cf6b4ad981810e5df24315cb64c67d8609ba480a
Step 2: Make sure you followed the instructions for persister, indexer and PDF service configuration.
Step 3: Go to the Jenkins build page, select "Job Builder" and click on "Build now". This will pull config from build_config.yaml and identify all modules that need to be built.
Step 4: Once the build is done, go to your Jenkins build page. The service will appear under the repository path in which it has been added, i.e. if the service is added under core-services, it will show up in core-services section in the aforementioned page.
Step 5: Most likely, you will be working on a feature branch for this module and not on "master". Click on "Build with parameters" for the module and search for the branch name in the filter box. Select the feature branch you are working on and then click "Build". This will make sure that Jenkins builds the module pulling code from the branch you prefer.
Click on "Console Output". If the build pipeline and docker registries have been setup properly as part of CD/CI setup, the docker image will be built and pushed to the registry. The console output will have the docker image ID for the module. Scroll down to the bottom and copy the following information -
Image name of the build
After copying the docker image ID, go to your Jenkins server home page, click on "Deployments" and scroll to find your deployment environment. Deployment environments have the template of deploy-to-<env name> and get created as part of CD/CI setup. If multiple environments have been configured, you will see multiple deploy-to-* entries.
It is best practice to always test out any new module in the dev environment. Select the environment you would like to deploy to and click on the "Run" icon on the right hand side of the page against the environment. In the Images text box, paste the copied docker image ID and click "Build". Please see screenshot below.
Deployment page
Jenkins will now take care of deploying the new image to the DIGIT environment.
Now, you can test your new service by testing out the APIs via POSTman.
All content on this page by eGov Foundation is licensed under a Creative Commons Attribution 4.0 International License.
Copy link