Lexical Tools

WebTools: Annual Update Procedures

I. Annual build-test without Ci-Cd

  1. Dir: ${LHC_GIT}/WebLvg-p
  2. use “lhc-lx-lexdev.nlm.nih.gov” as local develop/test machine without Ci-Cd process
  3. git repo is at: lhc-lx-lexdev.nlm.nih.gov:/nfsvol/lex/Lu/LHC_Git/WebLvg-p
  4. shell> git checkout master
  5. Update ./build.xml
    • Change app.year from ${YEAR}-1 to ${YEAR}
    • Update "catalina.home"
  6. update ./src/main/webapp/WEB-INF/web.xml.lexdev
    • update lvgVersion from ${YEAR}-1 to ${YEAR}
    • update lvgHomeDir to /${PROJECTS}/LVG/lvg${YEAR} (where lvg is installed)
  7. Copy lvg${YEAR}dist.jar to ./src/main/webapp/WEB-INF/lib/.
  8. Compile and deploy
    • ant clean
    • ant
    • ant deploy
  9. update web.xml:
    • cd ${TOMCAT}/webapps/WebLvg.${YEAR}/WEB-INF
    • cp web.xml.lexdev web.xml
  10. Test on lexdev (https://lhc-lx-lexdev.nlm.nih.gov/webapps/WebLvg.${YEAR}/jsp/global/cMenu.jsp)
  11. After everything is OK, then go to the next step with Ci-Cd pipeline.

II. Annual build-test with GitLab Ci-Cd Pipeline

The main procedures of Ci-Cd WebLvg are:

  • use mvn to build WebLvg with LVg artifacts in the LHC release dependency
    => lhc-lexicon-maven-releases/gov/nih/nlm/lvg/${YEAR}.0/lvg-${YEAR}.0.jar
  • download lvg${YEAR}lite.tgz from LHC-nexus and unzipped on /lvg${YEAR}lite in the docker image
    => lhc-lexicon-raw/www/lvg/${YEAR}/*.tgz
  • read in lvgHomeDir from web.xml and use it to update ${LVG_DIR} in lvg.property for a new lvgApi configuration.
  • To debug shll>docker exec -ti weblvg-toimcat --bash
    • /lvg${year}lite
    • /usr/local/tomcat/logs
  1. Dir: ${LHC_GIT}/WebLvg-p
  2. shell> git checkout master
  3. Local Development and Test

    This step is needed for feature developments and bugs fixed. However, it may be skipped and test on the LHC Ci-Cd directly.

  4. Ci-Cd Stage and Test
    • git repo is at: lhc-lx-lexdev.nlm.nih.gov:/nfsvol/lex/Lu/LHC_Git/WebLvg-p
    • update ./pom.xml
      => To build the WebLvg.war file
      <version>${YEAR}</version>
      <version>${YEAR}.0</version>
      => Must complete lvg.${YEAR}.0 in the ${LHC_GIT}/lvg, which upload lvg.${YEAR}.0.jar to LHC Nexus/lhc-lexicon-maven-releases/gov/nih/nlm/lvg/${YEAR}.0/lvg-${YEAR}.0.jar
    • Update ./src/main/webapp/WEB-INF/web.xml (copy from web.xml.Ci-Cd)
      => To configure WebLvg
      lvgVersion: ${YEAR}
      lvgHomeUrl: https://lhncbc.nlm.nih.gov/LSG/Projects/lvg/current/web/index.html
      lvgHomeDir: /lvg${YEAR}lite
    • ./docker-compose.yaml
      => To build tomcat server from docker images
      image: lhc-nexus.nlm.nih.gov:8443/weblvg-tomcat:${YEAR}.${RN}
      where ${RN} needs to be updated for every new offical Release Number
    • ./Makefile
      => Define Ci-Cd pipeline
      => Use make all_local for developing/testing in lhc-lx-lexdev01
      VERSION=${YEAR}
      RELEASE=${YEAR}.${RN}
    • Only the latest WebLvg (WebLvg.war) is deployed to public (no WebLvg.${YEAR} after 2021)

  5. Use Ci-Cd to build, push to stage and deploy to Production
    shell>git add -A
    shell>git commit -m "LEX, ..."
    shell>git push


    shell>git tag (show all tags)
    shell>git tag -a v.${YEAR}.0 -m "msg"
    shell>git push origin tagName (push a tag to remote origin)
    shell>git push origin -- tags

    • make sure update ${RN} when there are content changes so the Ci-Cd will use the new image to update the contents:
      • RELEASE=${YEAR}.${RN} ... in Makefile
      • image: lhc-nexus.nlm.nih.gov:8443/weblvg-tomcat:${YEAR}.${RN} in docker-compose.yaml
    • run: creates docker containers on the target server
    • Test at LHC-stage: https://weblvg.lhcaws-stage.nlm.nih.gov/WebLvg/jsp/global/cMenu.jsp
    • Ignore SSL issues by using Chrome-Incognito window if SSL cert is not updated, ask Ci_Cd staffs to update.
  6. Merge only if use dev branch (if only use master branch, so ignore this)
    shell>git checkout master
    shell>git merge dev
    shell>git push
  7. Deploy to LHC-Public:
    => Login to LHC-Git, press the arrow botton at the end of Ci-Cd pipeline to deploy WebLvg to public.

III. Content Updates

  1. Add new lvg flows
    • Modify "${LHC_GIT}/Weblvg/src/main/webapp/jsp/lvg/addFlow.jsp"
    • Modify "${LHC_GIT}/WebLvg/src/main/webapp/jsp/lvg/modifyFlow.jsp"
    • Modify "${LHC_GIT}/WebLvg/src/main/webapp/jsp/lvg/flowHelp.jsp"

    • Modify "${LHC_GIT}/WebLvg/src/main/resources/src/lvg2/lvgFlow.java
  2. Add new lvg Options: input, output and Global Behavior
    • Modify "${LHC_GIT}/WebLvg/src/main/webapp/jsp/lvg/Xxx.jsp"
    • Modify "${LHC_GIT}/WebLvg/src/main/webapp/jsp/lvg/setXxx.jsp"

    • Modify "${LHC_GIT}/WebLvg/src/main/resources/src/lvg2/lvgOptions.java
  3. Add new Tools
    • TBD