Skip to the content.

COVID FAQ Site Builder

Built With

Project Setup

Environment Variables

Get the config info from someone who’s worked on the project or from Azure

Create the environment files for any supported environment:

Which has content like this, but replace with actual keys:

RuntimeEndpoint=https://***.azurewebsites.net
kbId=***
RuntimeApiKey=***
Endpoint=https://***.cognitiveservices.azure.com
OcpApimSubscriptionKey=***
environment=prod

Choose which environment file to use by setting an environment variable named AZURE_ENVIRONMENT before running. You can set the value in the following locations:

NPM Scripts

# eleventy site
npm run clean
npm run build         # runs `npx eleventy` to build the site
npm run serve         # builds site + serves `_site` directory

# interactive cli
npm run faq-cli       # run interactive cli cmd with options
npm run cli-help      # get help info on available CLI commands

# knowledge base
npm run publish-kb    # publishes the knowledge base from edit index to bot index
npm run fetch-kb      # downloads the knowledge base from the targeted environment
npm run deploy-kb     # deploys knowledge base from one environment to another
npm run restore-kb    # makes incremental revisions to knowledge base from local faq file

# local data file
npm run archive-data  # moves local faq file into the archive file
npm run lint-data     # validates data and checks for common errors
npm run list-changes  # lists changes to questions - deleted, new, and title changes
npm run fix-data      # automatically fix inconsistencies in follow up prompts - upload via restore-kb

# publish site
npm run deploy-faq-test  # publish local _site folder to path on test
npm run deploy-faq-prod  # publish local _site folder to path on prod
npm run deploy-faq       # publish local _site to test and prod

Install the cli from the "bin" property in package.json with the following command:

npm i ./ -g

Then you can invoke via:

faq-cli

Deployment

FAQ Site

  1. Verify latest changes are pulled in from source control

     git checkout master
     git pull
    
  2. Ensure updates were published

     npm run publish-kb
    
  3. Get latest knowledge base updates

     npm run fetch-kb
    
  4. Archive previous data

     npm run archive-data
    
  5. Check for any common problems

     npm run lint-data
    
  6. Test site build and review differences in /diff.html

     npm run serve
    
  7. If there are validation issues, fix them in QnA maker and redo steps 3-6 until the toothpick comes out clean

  8. Deploy static files to test and prod environments

     npm run deploy-faq
    

Knowledge Base

Move the KB changes from the test environment to production

npm run deploy-kb

// TODO