installLabkey.sh 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. #!/bin/bash
  2. . $(dirname $0)/env.sh
  3. LABKEY=LabKey22.3.2-3-community
  4. if [ $# -gt 0 ] ;
  5. then
  6. case $1 in
  7. 18.1)
  8. LABKEY=LabKey18.1-57017.17-professional-bin;;
  9. 18.3)
  10. LABKEY=LabKey18.3.3-62784.7-community-bin;;
  11. 20.7)
  12. LABKEY=LabKey20.7.8-66016.22-community-bin;;
  13. 21.1)
  14. LABKEY=LabKey21.11.10-11-community;;
  15. 22.3)
  16. LABKEY=LabKey22.3.2-3-community;;
  17. esac;
  18. fi;
  19. echo "Using $LABKEY";
  20. #full path to source
  21. SFW_SRC=$LBDOCKER/packages/$LABKEY.tar.gz
  22. #this is temp only
  23. TMP_DIR=$HOME/tmp
  24. if [ ! -d ${TMP_DIR} ] ;
  25. then
  26. mkdir ${TMP_DIR};
  27. fi;
  28. #is there anything relevant in $LABKEY_DIR?
  29. if [ ! -d $LABKEY_DIR ] ;
  30. then
  31. mkdir $LABKEY_DIR;
  32. fi;
  33. #unpack to ${TMP_DIR}/$LABKEY
  34. TMP_LABKEY=${TMP_DIR}/$LABKEY;
  35. #make sure we are starting from a clean slate
  36. if [ -d ${TMP_LABKEY} ] ; then
  37. rm -rf ${TMP_LABKEY};
  38. fi;
  39. #untar in ${TMP_DIR}
  40. cd ${TMP_DIR} && tar xvzf ${SFW_SRC};
  41. echo "Using distribution in ${TMP_LABKEY}";
  42. #copy from $TMP_LABKEY to labkey space in docker
  43. LABKEY_SRC_DIRS=("labkeywebapp" "modules" "pipeline-lib")
  44. for d in ${LABKEY_SRC_DIRS[@]} ;
  45. do
  46. mv ${TMP_LABKEY}/$d ${LABKEY_DIR}/$d;
  47. done;
  48. #check if required dirs are missing and create them
  49. LABKEY_DIRS=("files" "externalModules")
  50. for d in ${LABKEY_DIRS[@]} ;
  51. do
  52. if [ ! -d ${LABKEY_DIR}/$d ] ; then
  53. mkdir ${LABKEY_DIR}/$d;
  54. fi;
  55. done;
  56. #tomcat-lib goes to tomcat8 user space in docker
  57. mv ${TMP_LABKEY}/tomcat-lib ${TOMCAT_DIR}/lib
  58. echo "Cleanup";
  59. rm -rf ${TMP_LABKEY}
  60. echo "Done"