WebTools: Annual Update Procedures
I. Annual build-test without Ci-Cd (on local development mahcine)
- Dir: ${LHC_GIT}/WebLvg-p
- use “lhc-lx-lexdev.nlm.nih.gov” as local develop/test machine without Ci-Cd process
- git repo is at: lhc-lx-lexdev.nlm.nih.gov:/nfsvol/lex/Lu/LHC_Git/WebLvg-p
shell> git checkout master
- Update ./build.xml
- Change app.year from ${YEAR}-1 to ${YEAR}
- Update "catalina.home"
- 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)
- Copy lvg${YEAR}dist.jar to ./src/main/webapp/WEB-INF/lib/.
- Compile and deploy
- update web.xml:
cd ${TOMCAT}/webapps/WebLvg.${YEAR}/WEB-INF
cp web.xml.lexdev web.xml
- Test on lexdev (https://lhc-lx-lexdev.nlm.nih.gov/webapps/WebLvg.${YEAR}/jsp/global/cMenu.jsp)
- 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 steps 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
Procedures
- Dir: ${LHC_GIT}/WebLvg-p
shell> git checkout master
- 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.
- 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)
- Use Ci-Cd to build, push to stage and deploy to Production
shell>git add -A
shell>git commit -m "LEX-xxx, ..."
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)
=> This triggle the Ci-Cd build processes in Git and sent results to LHC-stage
=> press the button in Git pipeline to send image to public production deploy
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.
- Merge changes in Master to dev branch (to sync dev with master)
shell>git checkout dev
shell>git merge master
shell>git push
- Merge changes in dev to Master (not using this because only use master for annual updates)
shell>git checkout master
shell>git merge dev
shell>git push
- 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
- 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
- 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
- Add new Tools