apply_fixes.sh 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. #!/bin/bash
  2. ############################################################################
  3. # (C) Copyright IBM Corporation 2019 #
  4. # #
  5. # Licensed under the Apache License, Version 2.0 (the "License"); #
  6. # you may not use this file except in compliance with the License. #
  7. # You may obtain a copy of the License at #
  8. # #
  9. # http://www.apache.org/licenses/LICENSE-2.0 #
  10. # #
  11. # Unless required by applicable law or agreed to in writing, software #
  12. # distributed under the License is distributed on an "AS IS" BASIS, #
  13. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
  14. # See the License for the specific language governing permissions and #
  15. # limitations under the License. #
  16. # #
  17. ############################################################################
  18. # Arguments: none|recommended|all [REPO] [ID] [PWD]
  19. # Arguments: space_seperated_ifix_ids [REPO] [ID] [PWD]
  20. # eg. /work/was_service recommended
  21. # eg. /work/was_service com.ibm.java.sdk.v8
  22. # eg. /work/was_service 9.0.0.9-WAS-IFPH12345
  23. # eg. /work/was_service all http://myrepo.intranet.company.com/was90
  24. IMURL=$1
  25. IFIXES=$2
  26. REPO=$3
  27. IBMID=$4
  28. IBMID_PWD=$5
  29. cd /work
  30. wget ${IMURL}
  31. unzip agent.installer.linux.gtk*.zip -d /work/InstallationManagerKit
  32. rm -rf agent.installer.linux.gtk*.zip
  33. if [ ${IBMID} != "" ] ; then
  34. echo "your_secureStore_password" > /tmp/secureStorePwd
  35. /work/InstallationManagerKit/tools/imutilsc saveCredential \
  36. -userName ${IBMID} -userPassword ${IBMID_PWD} \
  37. -secureStorageFile /tmp/secureStore \
  38. -masterPasswordFile /tmp/secureStorePwd \
  39. -url ${REPO}
  40. else
  41. cp /work/secureStore /tmp/secureStore
  42. cp /work/secureStorePwd /tmp/secureStorePwd
  43. fi
  44. ### TODO: need to grep com.ibm.websphere and ILAN or BASE or DEVELOPERS
  45. PRODUCTIDS=`/work/InstallationManagerKit/tools/imcl listInstalledPackages \
  46. -dataLocation /opt/IBM/WebSphere/AppServerIMData -accessRights nonAdmin \
  47. | xargs echo`
  48. if [ ${IFIXES} == "none" ] || [ ${IFIXES} == "recommended" ] || [ ${IFIXES} == "all" ] ; then
  49. INSTALL_FIXES="-installFixes ${IFIXES}"
  50. else
  51. PRODUCTIDS="${PRODUCTIDS} ${IFIXES}"
  52. INSTALL_FIXES=""
  53. fi
  54. /work/InstallationManagerKit/tools/imcl install \
  55. ${PRODUCTIDS} \
  56. -acceptLicense -accessRights nonAdmin -showProgress \
  57. -installationDirectory /opt/IBM/WebSphere/AppServer -repositories ${REPO} \
  58. ${INSTALL_FIXES} -sRD /opt/IBM/WebSphere/AppServerIMShared \
  59. -dataLocation /opt/IBM/WebSphere/AppServerIMData \
  60. -secureStorageFile /tmp/secureStore -masterPasswordFile /tmp/secureStorePwd \
  61. -preferences offering.service.repositories.areUsed=false,\
  62. com.ibm.cic.common.core.preferences.searchForUpdates=true,\
  63. com.ibm.cic.common.core.preferences.preserveDownloadedArtifacts=false,\
  64. com.ibm.cic.common.core.preferences.keepFetchedFiles=false
  65. rm -Rf /tmp/secureStorePwd /tmp/secureStore /work/InstallationManagerKit