Uploaded image for project: 'Open Concept Lab for OpenMRS'
  1. Open Concept Lab for OpenMRS
  2. OCLOMRS-463

Passing OCL URL environment variables to run at runtime

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Closed
    • Priority: Should
    • Resolution: Fixed
    • Affects Version/s: 1.0.0
    • Fix Version/s: 1.0.0
    • Labels:
      None
    • Complexity:
      Low
    • Sprint:
      OCL for OpenMRS Sprint 15, OCL for OpenMRS Sprint 16

      Description

      • Create a bash script that creates an env-config.js file with key-value pairs of the environment variables.
      • Load env-config.js  with the script tag in index.html
      • Update the start script in package.json to run the bash script when running the app during development.
      • Update the Dockerfile to copy the .env file, the bash script and also run the bash script before the build(at runtime). Then remove env-config.js from the public folder if any and add the newly created one by the bash script. 

       

      Testing.

      In development

      - Create a .env file in the root directory and pass it;

          
      `OCL_API_HOST=https://api.qa.openconceptlab.org/`
      `TRADITIONAL_OCL_HOST=https://qa.openconceptlab.org`

      • Then run `npm start

      In docker

      - ** Create a .env file in the root directory and pass it;

      `OCL_API_HOST=https://api.qa.openconceptlab.org/`
      `TRADITIONAL_OCL_HOST=https://qa.openconceptlab.org`

      • Then run `docker build -t openmrs/ocl-client:local .`
      • Wait for the build to finish, then run `docker-compose -f docker/docker-compose.yml up ` to run the Docker container
      • Wait for the container to run, then access the app at `http://localhost:8081/`

        Attachments

          Activity

            People

            Assignee:
            judeatu JUDE INNOCENT ATUHAIRE [X] (Inactive)
            Reporter:
            judeatu JUDE INNOCENT ATUHAIRE [X] (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 6 hours
                6h
                Remaining:
                Remaining Estimate - 6 hours
                6h
                Logged:
                Time Spent - Not Specified
                Not Specified