Merge lp:~ibmcharmers/charms/trusty/was-base/devel into lp:~umasv1987/charms/trusty/was-base/was-basefix
- Trusty Tahr (14.04)
- devel
- Merge into was-basefix
Status: | Needs review |
---|---|
Proposed branch: | lp:~ibmcharmers/charms/trusty/was-base/devel |
Merge into: | lp:~umasv1987/charms/trusty/was-base/was-basefix |
Diff against target: |
1004 lines (+390/-313) 10 files modified
README.md (+57/-14) config.yaml (+7/-5) hooks/config-changed (+255/-213) hooks/install (+3/-16) hooks/start (+13/-9) hooks/stop (+12/-7) hooks/website-relation-changed (+1/-1) hooks/website-relation-joined (+1/-1) tests/10-bundles-test.py (+41/-44) tests/local.yaml (+0/-3) |
To merge this branch: | bzr merge lp:~ibmcharmers/charms/trusty/was-base/devel |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
vsr (community) | Needs Fixing | ||
Review via email: mp+264820@code.launchpad.net |
Commit message
Description of the change
- 17. By Geetha S
-
Committing WAS Base changes
- 18. By Geetha S
-
Committing WAS Base changes
- 19. By Geetha S
-
WAS Base Committing Changes
- 20. By Geetha S
-
WAS Base Committing Formmatting changes
- 21. By Geetha S
-
Committing spelling and formatting changes for WAS Base
- 22. By Geetha S
-
Committing spelling and formatting changes for WAS Base
- 23. By Geetha S
-
Committing spelling and formatting changes for WAS Base
- 24. By Geetha S
-
Committing spelling and formatting changes for WAS Base
- 25. By Geetha S
-
Committing ppc64le related changes for WAS Base
- 26. By Geetha S
-
Committing ppc64le related changes for WAS Base
- 27. By Geetha S
-
Committing ppc64le related changes for WAS Base
- 28. By Geetha S
-
Committing testcase changes for WAS Base
- 29. By Geetha S
-
Committing testcase related changes for WAS Base
- 30. By Geetha S
-
Committing code changes for WAS Base
- 31. By Geetha S
-
Committing start/stop hook changes
- 32. By Geetha S
-
Committing reverse proxy test case
Unmerged revisions
- 32. By Geetha S
-
Committing reverse proxy test case
- 31. By Geetha S
-
Committing start/stop hook changes
- 30. By Geetha S
-
Committing code changes for WAS Base
- 29. By Geetha S
-
Committing testcase related changes for WAS Base
- 28. By Geetha S
-
Committing testcase changes for WAS Base
- 27. By Geetha S
-
Committing ppc64le related changes for WAS Base
- 26. By Geetha S
-
Committing ppc64le related changes for WAS Base
- 25. By Geetha S
-
Committing ppc64le related changes for WAS Base
- 24. By Geetha S
-
Committing spelling and formatting changes for WAS Base
- 23. By Geetha S
-
Committing spelling and formatting changes for WAS Base
Preview Diff
1 | === modified file 'README.md' | |||
2 | --- README.md 2015-07-13 10:13:52 +0000 | |||
3 | +++ README.md 2015-08-04 08:54:53 +0000 | |||
4 | @@ -3,17 +3,19 @@ | |||
5 | 3 | WebSphere Application Server Base | 3 | WebSphere Application Server Base |
6 | 4 | 4 | ||
7 | 5 | WebSphere Application Server is a proven, high-performance transaction engine that can help build, run, integrate, and manage dynamic web applications. | 5 | WebSphere Application Server is a proven, high-performance transaction engine that can help build, run, integrate, and manage dynamic web applications. |
9 | 6 | For details on IBM Websphere Application Server please visit "http://www-03.ibm.com/software/products/en/appserv-was". | 6 | Details on IBM Websphere Application Server and WAS Base Prduct Page available [here] [WAS-product-page]. |
10 | 7 | 7 | ||
11 | 8 | 8 | ||
12 | 9 | # Usage | 9 | # Usage |
13 | 10 | 10 | ||
15 | 11 | Download your licensed IBM Installation Manager software version 1.5 and above and upload to your apache repository. | 11 | Download your licensed IBM Installation Manager software version 1.5 and above for 'x86_64' based machine. And version 1.8 and above for 'ppc64le' based machine and upload to your apache repository. |
16 | 12 | 12 | ||
17 | 13 | Download your licensed IBM Websphere Base software 8.5.5.0 version and upload to your apache repository. | 13 | Download your licensed IBM Websphere Base software 8.5.5.0 version and upload to your apache repository. |
18 | 14 | 14 | ||
19 | 15 | Download your licensed IBM Websphere Base software WAS fixpack version 8.5.5.4 and upload to your apache repository. | 15 | Download your licensed IBM Websphere Base software WAS fixpack version 8.5.5.4 and upload to your apache repository. |
20 | 16 | 16 | ||
21 | 17 | For 'ppc64le' based machines, Download your licensed IBM Websphere Base software WAS fixpack version 8.5.5.6 and upload to your apache repository. | ||
22 | 18 | |||
23 | 17 | Put up all the downloaded contents on the web server like Apache and configure apache to serve these packages. These packages can be accessed using a URL from the web server. | 19 | Put up all the downloaded contents on the web server like Apache and configure apache to serve these packages. These packages can be accessed using a URL from the web server. |
24 | 18 | 20 | ||
25 | 19 | 21 | ||
26 | @@ -30,7 +32,7 @@ | |||
27 | 30 | To install IBM Websphere Application Server Base you need to install IBM Installation Manager software as prerequisite. | 32 | To install IBM Websphere Application Server Base you need to install IBM Installation Manager software as prerequisite. |
28 | 31 | To install IBM Installation Manager you need to get the packages for ubuntu, for information about the software and builds please visit (http://www-01.ibm.com/software/passportadvantage/). | 33 | To install IBM Installation Manager you need to get the packages for ubuntu, for information about the software and builds please visit (http://www-01.ibm.com/software/passportadvantage/). |
29 | 32 | 34 | ||
31 | 33 | To install the downloaded binaries you must agree to the IBM license. You can view the full license for IBM Installation Manager and IBM WebSphere Application Server Base by visiting the [Software license agreements search website](http://www-03.ibm.com/software/sla/sladb.nsf/search). Search for "IBM Installation Manager" and "IBM Websphere Application Server" and choose the license that applies to the version you are using. | 35 | To install the downloaded binaries you must agree to the IBM license. You can view the full license for IBM Installation Manager and IBM WebSphere Application Server Base by visiting the [Software license agreements search website][License] Search for "IBM Installation Manager" and "IBM Websphere Application Server" and choose the license that applies to the version you are using. |
32 | 34 | 36 | ||
33 | 35 | 37 | ||
34 | 36 | Run the following to deploy this charm: | 38 | Run the following to deploy this charm: |
35 | @@ -83,7 +85,7 @@ | |||
36 | 83 | 85 | ||
37 | 84 | 86 | ||
38 | 85 | `im_file_name` | 87 | `im_file_name` |
40 | 86 | The IBM Installation Manager Package name. If not set, It is assigned the value "Install_Mgr_v1.6.2_Lnx_WASv8.5.5.zip" for x86_64 based machine. | 88 | The IBM Installation Manager Package name. If not set, It will assign the value "Install_Mgr_v1.6.2_Lnx_WASv8.5.5.zip" for x86_64 based machine and "agent.installer.linux.gtk.ppc64le_1.8.1000.20141126_2002.zip" for ppc64le based machine. |
41 | 87 | 89 | ||
42 | 88 | `sha_im` | 90 | `sha_im` |
43 | 89 | Checksum value to check integrity of IBM Installation Manager package. The Charm uses sha1sum to check the integrity. If empty, it does not carry out the integrity check. Use `sha1sum <Package Location/Package Name> | cut -d" " -f1` to find out Checksum value for downloaded package. Cryptographic value should be altered by the user only when the package name is change. Else it should not be altered. | 91 | Checksum value to check integrity of IBM Installation Manager package. The Charm uses sha1sum to check the integrity. If empty, it does not carry out the integrity check. Use `sha1sum <Package Location/Package Name> | cut -d" " -f1` to find out Checksum value for downloaded package. Cryptographic value should be altered by the user only when the package name is change. Else it should not be altered. |
44 | @@ -91,19 +93,60 @@ | |||
45 | 91 | #IBM WAS Base Information | 93 | #IBM WAS Base Information |
46 | 92 | 94 | ||
47 | 93 | (1) General Information | 95 | (1) General Information |
49 | 94 | Information on IBM WAS available at the [WAS Infocenter] (http://www-01.ibm.com/support/knowledgecenter/SSAW57_8.5.5/as_ditamaps/was855_welcome_ndmp.html?lang=en). | 96 | Information on IBM WAS available [here] [WAS-Infocenter] |
50 | 95 | 97 | ||
51 | 96 | (2) Download Information | 98 | (2) Download Information |
61 | 97 | Information on procuring WAS product is available at the [Passport Advantage Site](http://www-01.ibm.com/software/passportadvantage/). | 99 | |
62 | 98 | 100 | Downloadable Package Names for 'x86_64' based machine: | |
63 | 99 | Refer this URL for WAS 8.5.5.0 download (http://www-01.ibm.com/support/docview.wss?uid=swg27038625). | 101 | WAS_V8.5.5_1_OF_3.zip |
64 | 100 | 102 | WAS_V8.5.5_2_OF_3.zip | |
65 | 101 | Refer this URL for WAS 8.5.5.4 fixpack download (http://www-01.ibm.com/support/docview.wss?uid=swg24038539). | 103 | WAS_V8.5.5_3_OF_3.zip |
66 | 102 | 104 | 8.5.5-WS-WAS-FP0000004-part1.zip | |
67 | 103 | A trial version is available [here] ( http://www.ibm.com/developerworks/downloads/ws/was/index.html). | 105 | 8.5.5-WS-WAS-FP0000004-part2.zip |
68 | 104 | 106 | ||
69 | 105 | Refer this URL for more information about Downloadable files (http://www-01.ibm.com/support/docview.wss?uid=swg24038380). | 107 | Downloadable Package Names for 'ppc64le' based machine: |
70 | 108 | WAS_V8.5.5_FOR_POWERLE_ML.zip | ||
71 | 109 | WAS_V8.5.5_2_OF_2_FOR_POWERLE_ML.zip | ||
72 | 110 | 8.5.5-WS-WAS-LE-FP0000006-part1.zip | ||
73 | 111 | 8.5.5-WS-WAS-LE-FP0000006-part2.zip | ||
74 | 112 | |||
75 | 113 | Information on procuring WAS product is available at the [Passport Advantage site] [Passport-Advantage] | ||
76 | 114 | |||
77 | 115 | Details about WAS 8.5.5.0 download available [here] [[WAS-8.5.5.0-download] | ||
78 | 116 | |||
79 | 117 | Information about insatllation of WAS Base on 'ppc64le' based machine available [here] [WAS-for-ppc64le] | ||
80 | 118 | |||
81 | 119 | Details about WAS 8.5.5.4 fixpack download available [here] [WAS-8.5.5.4-fixpack-download]. | ||
82 | 120 | |||
83 | 121 | A trial version is available [here] [WAS-trail-version]. | ||
84 | 122 | |||
85 | 123 | More information about IBM IM Downloadable file available [here] [IBM-IM-more-info] | ||
86 | 106 | 124 | ||
87 | 107 | (3) Contact Information | 125 | (3) Contact Information |
88 | 108 | 126 | ||
89 | 109 | For issues with this charm, please contact jujusupp@us.ibm.com | 127 | For issues with this charm, please contact jujusupp@us.ibm.com |
90 | 128 | |||
91 | 129 | <!-- Links --> | ||
92 | 130 | |||
93 | 131 | [WAS-Infocenter]: http://www-01.ibm.com/support/knowledgecenter/SSAW57_8.5.5/as_ditamaps/was855_welcome_ndmp.html?lang=en | ||
94 | 132 | |||
95 | 133 | [WAS-product-page]: http://www-03.ibm.com/software/products/en/appserv-was | ||
96 | 134 | |||
97 | 135 | [WAS-8.5.5.0-download]: http://www-01.ibm.com/support/docview.wss?uid=swg27038625 | ||
98 | 136 | |||
99 | 137 | [WAS-8.5.5.4-fixpack-download]: http://www-01.ibm.com/support/docview.wss?uid=swg24038539 | ||
100 | 138 | |||
101 | 139 | [WAS-trail-version]: http://www.ibm.com/developerworks/downloads/ws/was/index.html | ||
102 | 140 | |||
103 | 141 | [Passport-Advantage]: http://www-01.ibm.com/software/passportadvantage/ | ||
104 | 142 | |||
105 | 143 | [IBM-IM-more-info]: http://www-01.ibm.com/support/docview.wss?uid=swg24038380 | ||
106 | 144 | |||
107 | 145 | [WAS-for-ppc64le]: http://www-304.ibm.com/support/knowledgecenter/SSEQTP_8.5.5/com.ibm.websphere.installation.nd.doc/ae/cins_offerings.html?lang=en-us | ||
108 | 146 | |||
109 | 147 | [WAS-pp64le-infocenter]: http://www-304.ibm.com/support/knowledgecenter/SSEQTP_8.5.5/com.ibm.websphere.installation.nd.doc/ae/tins_installation_dist_cl.html?lang=en | ||
110 | 148 | |||
111 | 149 | [WAS-ppc64le-fixpack-info]: http://www-01.ibm.com/support/docview.wss?uid=swg24040035 | ||
112 | 150 | |||
113 | 151 | [License]: http://www-03.ibm.com/software/sla/sladb.nsf/search | ||
114 | 152 | |||
115 | 110 | 153 | ||
116 | === modified file 'config.yaml' | |||
117 | --- config.yaml 2015-07-13 10:13:52 +0000 | |||
118 | +++ config.yaml 2015-08-04 08:54:53 +0000 | |||
119 | @@ -4,14 +4,14 @@ | |||
120 | 4 | default: "" | 4 | default: "" |
121 | 5 | description: | | 5 | description: | |
122 | 6 | Download url for WAS Base packages, This is the URL containing WAS Base packages, | 6 | Download url for WAS Base packages, This is the URL containing WAS Base packages, |
124 | 7 | mention till the folder which contains packages ex: http://9.124.100.99/debs/WAS-BASE/. | 7 | mention till the folder which contains packages ex: http://<ip-address>/debs/WAS-BASE/. |
125 | 8 | im_install_path: | 8 | im_install_path: |
126 | 9 | type: string | 9 | type: string |
127 | 10 | default: "/opt/IBM/InstallationManager" | 10 | default: "/opt/IBM/InstallationManager" |
128 | 11 | description: | | 11 | description: | |
129 | 12 | Install Location for Installation Manager.Please enter the path | 12 | Install Location for Installation Manager.Please enter the path |
130 | 13 | where you wants to install Install Manager ex : /opt/IBM/InstallationManager | 13 | where you wants to install Install Manager ex : /opt/IBM/InstallationManager |
132 | 14 | here IM will install at this location, It Can be changed if IM needs to be installed at some other place. | 14 | here IM will install at this location, It can be changed if IM needs to be installed at some other place. |
133 | 15 | im_file_name: | 15 | im_file_name: |
134 | 16 | type: string | 16 | type: string |
135 | 17 | default: "" | 17 | default: "" |
136 | @@ -26,19 +26,21 @@ | |||
137 | 26 | description: | | 26 | description: | |
138 | 27 | The IBM WebSphere Application Server software comes with special terms and | 27 | The IBM WebSphere Application Server software comes with special terms and |
139 | 28 | conditions from IBM. The WebSphere software can only be used by | 28 | conditions from IBM. The WebSphere software can only be used by |
141 | 29 | accepting the license terms and conditions. | 29 | accepting the license terms and conditions. It should be set to "True" to install |
142 | 30 | the Websphere Application Server software. | ||
143 | 30 | accept-ibm-im-license: | 31 | accept-ibm-im-license: |
144 | 31 | type: boolean | 32 | type: boolean |
145 | 32 | default: False | 33 | default: False |
146 | 33 | description: | | 34 | description: | |
147 | 34 | The IBM Installation Manager software comes with special terms and | 35 | The IBM Installation Manager software comes with special terms and |
148 | 35 | conditions from IBM. The Installation Manager software can only be used by | 36 | conditions from IBM. The Installation Manager software can only be used by |
150 | 36 | accepting the license terms and conditions. | 37 | accepting the license terms and conditions. It should be set to "True" to install |
151 | 38 | the IBM Installation Manager software. | ||
152 | 37 | sha_im: | 39 | sha_im: |
153 | 38 | type: string | 40 | type: string |
154 | 39 | default: "" | 41 | default: "" |
155 | 40 | description: | | 42 | description: | |
157 | 41 | Checksum value to check integrity of IBM IM pacakage. The Charm uses | 43 | Checksum value to check integrity of IBM IM package. The Charm uses |
158 | 42 | sha1sum to check the integrity. For example, run the command: | 44 | sha1sum to check the integrity. For example, run the command: |
159 | 43 | <sha1sum Install_Mgr_v1.6.2_Lnx_WASv8.5.5.zip | cut -d " " -f1> | 45 | <sha1sum Install_Mgr_v1.6.2_Lnx_WASv8.5.5.zip | cut -d " " -f1> |
160 | 44 | to get the checksum value for IBM Installation Manager pacakage. | 46 | to get the checksum value for IBM Installation Manager pacakage. |
161 | 45 | 47 | ||
162 | === modified file 'hooks/config-changed' | |||
163 | --- hooks/config-changed 2015-07-13 10:13:52 +0000 | |||
164 | +++ hooks/config-changed 2015-08-04 08:54:53 +0000 | |||
165 | @@ -9,9 +9,9 @@ | |||
166 | 9 | is_im_installed() | 9 | is_im_installed() |
167 | 10 | { | 10 | { |
168 | 11 | if [ -f $IM_INSTALL_PATH/eclipse/IBMIM ]; then | 11 | if [ -f $IM_INSTALL_PATH/eclipse/IBMIM ]; then |
170 | 12 | echo "True" | 12 | echo "True" |
171 | 13 | else | 13 | else |
173 | 14 | echo "False" | 14 | echo "False" |
174 | 15 | fi | 15 | fi |
175 | 16 | 16 | ||
176 | 17 | } | 17 | } |
177 | @@ -21,9 +21,9 @@ | |||
178 | 21 | is_was_base_installed() | 21 | is_was_base_installed() |
179 | 22 | { | 22 | { |
180 | 23 | if [ -d $WAS_BASE_INSTALL_PATH/bin ]; then | 23 | if [ -d $WAS_BASE_INSTALL_PATH/bin ]; then |
182 | 24 | echo "True" | 24 | echo "True" |
183 | 25 | else | 25 | else |
185 | 26 | echo "False" | 26 | echo "False" |
186 | 27 | fi | 27 | fi |
187 | 28 | 28 | ||
188 | 29 | } | 29 | } |
189 | @@ -35,26 +35,29 @@ | |||
190 | 35 | 35 | ||
191 | 36 | was_base_installed=`is_was_base_installed` | 36 | was_base_installed=`is_was_base_installed` |
192 | 37 | if [ $was_base_installed == True ]; then | 37 | if [ $was_base_installed == True ]; then |
201 | 38 | juju-log "IBM WAS Base: Removing WAS BASE Installation" | 38 | juju-log "IBM WAS Base: Removing WAS BASE Installation" |
202 | 39 | juju-log "IBM WAS Base: Server stopping" | 39 | juju-log "IBM WAS Base: Server stopping" |
203 | 40 | $WAS_BASE_INSTALL_PATH/profiles/test/bin/stopServer.sh server1 | 40 | $WAS_BASE_INSTALL_PATH/profiles/test/bin/stopServer.sh server1 |
204 | 41 | if [ "$?" -ne "0" ]; then | 41 | if [ "$?" -ne "0" ]; then |
205 | 42 | juju-log "IBM WAS Base: Error while stoping the server" | 42 | juju-log "IBM WAS Base: Error while stopping the server" |
206 | 43 | else | 43 | else |
207 | 44 | juju-log "IBM WAS Base: Server stopped successfully" | 44 | juju-log "IBM WAS Base: Server stopped successfully" |
208 | 45 | fi | 45 | fi |
209 | 46 | 46 | ||
210 | 47 | # Uninstalling WAS BASE | 47 | # Uninstalling WAS BASE |
216 | 48 | $IM_INSTALL_PATH/eclipse/tools/imcl uninstall com.ibm.websphere.BASE.v85 -installationDirectory $WAS_BASE_INSTALL_PATH | 48 | $IM_INSTALL_PATH/eclipse/tools/imcl uninstall com.ibm.websphere.BASE.v85 -installationDirectory $WAS_BASE_INSTALL_PATH |
217 | 49 | if [ -d /root/IBM/WebSphere/AppServer/V85/BASE ]; then | 49 | if [ -d /root/IBM/WebSphere/AppServer/V85/BASE ]; then |
218 | 50 | juju-log "IBM WAS Base: Removing install dir" | 50 | juju-log "IBM WAS Base: Removing installation directory" |
219 | 51 | cd /root | 51 | cd /root |
220 | 52 | rm -rf IBM/WebSphere/AppServer/V85/BASE | 52 | rm -rf IBM/WebSphere/AppServer/V85/BASE |
221 | 53 | else | ||
222 | 54 | juju-log "IBM WAS Base: Installation directory does not exist" | ||
223 | 55 | fi | ||
224 | 56 | juju-log "IBM WAS Base: Uninstalling WAS Base software completed" | ||
225 | 57 | |||
226 | 53 | else | 58 | else |
231 | 54 | juju-log "IBM WAS Base: Install directory is not exist" | 59 | juju-log "IBM WAS Base: WAS Base software has not been installed." |
232 | 55 | fi | 60 | fi |
229 | 56 | fi | ||
230 | 57 | juju-log "IBM WAS Base: Uninstalling WAS BASE software completed" | ||
233 | 58 | } | 61 | } |
234 | 59 | 62 | ||
235 | 60 | #Remove IM, if installed | 63 | #Remove IM, if installed |
236 | @@ -62,9 +65,9 @@ | |||
237 | 62 | { | 65 | { |
238 | 63 | im_installed=`is_im_installed` | 66 | im_installed=`is_im_installed` |
239 | 64 | if [ $im_installed == True ]; then | 67 | if [ $im_installed == True ]; then |
243 | 65 | juju-log "IBM WAS Base: Removing IBM IM software." | 68 | juju-log "IBM WAS Base: Removing IBM IM software." |
244 | 66 | /root/var/ibm/InstallationManager/uninstall/uninstallc | 69 | /root/var/ibm/InstallationManager/uninstall/uninstallc |
245 | 67 | juju-log "IBM WAS Base: Removed IBM IM software" | 70 | juju-log "IBM WAS Base: Removed IBM IM software" |
246 | 68 | fi | 71 | fi |
247 | 69 | 72 | ||
248 | 70 | } | 73 | } |
249 | @@ -74,27 +77,27 @@ | |||
250 | 74 | { | 77 | { |
251 | 75 | 78 | ||
252 | 76 | if [ $1 == False ]; then | 79 | if [ $1 == False ]; then |
261 | 77 | juju-log "IBM WAS Base: Removing IBM WebSphere (if installed) as the license agreement is not accepted." | 80 | juju-log "IBM WAS Base: Removing IBM WebSphere (if installed) as the license agreement is not accepted." |
262 | 78 | if [ -f $IM_INSTALL_PATH/eclipse/IBMIM ]; then | 81 | if [ -f $IM_INSTALL_PATH/eclipse/IBMIM ]; then |
263 | 79 | juju-log "IBM WAS Base: IBM IM exists " | 82 | juju-log "IBM WAS Base: IBM IM exists " |
264 | 80 | remove_was_base_software | 83 | remove_was_base_software |
265 | 81 | else | 84 | else |
266 | 82 | juju-log "IBM WAS Base: IBM IM not exists and hence exiting from WAS unistalling" | 85 | juju-log "IBM WAS Base: IBM IM does not exist and hence exiting from WAS uninstalling" |
267 | 83 | exit 0 | 86 | exit 0 |
268 | 84 | fi | 87 | fi |
269 | 85 | fi | 88 | fi |
270 | 86 | if [ $2 == False ]; then | 89 | if [ $2 == False ]; then |
282 | 87 | juju-log "IBM WAS Base: Removing IBM IM (if installed) as the license agreement is not accepted." | 90 | juju-log "IBM WAS Base: Removing IBM IM (if installed) as the license agreement is not accepted." |
283 | 88 | 91 | ||
284 | 89 | #Check any dependent products exists like WAS | 92 | #Check any dependent products exists like WAS |
285 | 90 | 93 | ||
286 | 91 | if [ -d $WAS_BASE_INSTALL_PATH/bin ]; then | 94 | if [ -d $WAS_BASE_INSTALL_PATH/bin ]; then |
287 | 92 | juju-log "IBM WAS Base: Can not uninstall IM as its has WAS product installed" | 95 | juju-log "IBM WAS Base: Can not uninstall IM as it has WAS product installed" |
288 | 93 | exit 0 | 96 | exit 0 |
289 | 94 | else | 97 | else |
290 | 95 | juju-log "IBM WAS Base: Uninstall IBM IM software" | 98 | juju-log "IBM WAS Base: Uninstall IBM IM software" |
291 | 96 | remove_im_software | 99 | remove_im_software |
292 | 97 | fi | 100 | fi |
293 | 98 | fi | 101 | fi |
294 | 99 | 102 | ||
295 | 100 | } | 103 | } |
296 | @@ -109,7 +112,7 @@ | |||
297 | 109 | fi | 112 | fi |
298 | 110 | 113 | ||
299 | 111 | # If an install IM done, get the name of the package from which it was done | 114 | # If an install IM done, get the name of the package from which it was done |
301 | 112 | if [ -f $CHARM_DIR/$ARCHIVE_DIR/IM/*.zip ]; then | 115 | if [ -f $CHARM_DIR/$ARCHIVE_DIR/IM/*.zip ]; then |
302 | 113 | im_pkg_name=`ls $CHARM_DIR/$ARCHIVE_DIR/IM/*.zip` | 116 | im_pkg_name=`ls $CHARM_DIR/$ARCHIVE_DIR/IM/*.zip` |
303 | 114 | if [ $? == 0 ]; then | 117 | if [ $? == 0 ]; then |
304 | 115 | im_pkg_name=`basename $im_pkg_name` | 118 | im_pkg_name=`basename $im_pkg_name` |
305 | @@ -120,42 +123,38 @@ | |||
306 | 120 | cfg_im_pkg_name=$im_file_name | 123 | cfg_im_pkg_name=$im_file_name |
307 | 121 | 124 | ||
308 | 122 | # Set package name to a predefined value if the user has not provided a package name | 125 | # Set package name to a predefined value if the user has not provided a package name |
313 | 123 | if [ "$cfg_im_pkg_name" == "" ]; then | 126 | if [ "$cfg_im_pkg_name" == "" ]; then |
314 | 124 | ARCHITECTURE=`uname -m` | 127 | if [ "$ARCHITECTURE" = "x86_64" ]; then |
315 | 125 | if [ "$ARCHITECTURE" = "x86_64" ] || [ "$ARCHITECTURE" = "ppc64le" ]; then | 128 | cfg_im_pkg_name="Install_Mgr_v1.6.2_Lnx_WASv8.5.5.zip" |
316 | 126 | cfg_im_pkg_name="Install_Mgr_v1.6.2_Lnx_WASv8.5.5.zip" | 129 | elif [ "$ARCHITECTURE" = "ppc64le" ]; then |
317 | 130 | cfg_im_pkg_name="agent.installer.linux.gtk.ppc64le_1.8.1000.20141126_2002.zip" | ||
318 | 127 | else | 131 | else |
319 | 128 | juju-log "IBM WAS Base: Platform not supported for IM." | 132 | juju-log "IBM WAS Base: Platform not supported for IM." |
320 | 129 | exit 1 | 133 | exit 1 |
321 | 130 | fi | 134 | fi |
323 | 131 | fi | 135 | fi |
324 | 132 | 136 | ||
325 | 133 | # The user has configured a different package name | 137 | # The user has configured a different package name |
326 | 134 | if [ "$im_pkg_name" != "$cfg_im_pkg_name" ]; then | 138 | if [ "$im_pkg_name" != "$cfg_im_pkg_name" ]; then |
327 | 135 | |||
328 | 136 | #Download the new IM package | ||
329 | 137 | set +e | 139 | set +e |
330 | 140 | #previously downloaded and installed IM software | ||
331 | 141 | if [ "$im_pkg_name" != "" ]; then | ||
332 | 142 | juju-log "IBM WAS Base: Deleting the older IM package." | ||
333 | 143 | rm -rf $CHARM_DIR/$ARCHIVE_DIR/IM | ||
334 | 144 | remove_was_base_software | ||
335 | 145 | remove_im_software | ||
336 | 146 | fi | ||
337 | 147 | #Download the new IM package | ||
338 | 138 | juju-log "IBM WAS Base: Downloading IM package." | 148 | juju-log "IBM WAS Base: Downloading IM package." |
339 | 139 | |||
340 | 140 | wget -t 2 -P $CHARM_DIR/$ARCHIVE_DIR/IM $WAS_URL/$cfg_im_pkg_name | 149 | wget -t 2 -P $CHARM_DIR/$ARCHIVE_DIR/IM $WAS_URL/$cfg_im_pkg_name |
341 | 141 | |||
342 | 142 | if [ $? == 0 ]; then | 150 | if [ $? == 0 ]; then |
343 | 143 | juju-log "IBM WAS Base: Downloaded IM package." | 151 | juju-log "IBM WAS Base: Downloaded IM package." |
344 | 144 | # Delete previously downloaded and installed IM software | ||
345 | 145 | if [ "$im_pkg_name" != "" ]; then | ||
346 | 146 | juju-log "IBM WAS Base: Deleting the older IM package." | ||
347 | 147 | rm $CHARM_DIR/$ARCHIVE_DIR/IM/$im_pkg_name | ||
348 | 148 | remove_was_base_software | ||
349 | 149 | remove_im_software | ||
350 | 150 | fi | ||
351 | 151 | |||
352 | 152 | else | 152 | else |
353 | 153 | juju-log "IBM WAS Base: Download of IM package failed." | 153 | juju-log "IBM WAS Base: Download of IM package failed." |
354 | 154 | juju-log "IBM WAS Base: Ensure the download URL and package name are correctly set in the charm configuration." | 154 | juju-log "IBM WAS Base: Ensure the download URL and package name are correctly set in the charm configuration." |
355 | 155 | exit 0 | 155 | exit 0 |
356 | 156 | fi | 156 | fi |
357 | 157 | set -e | 157 | set -e |
358 | 158 | |||
359 | 159 | fi | 158 | fi |
360 | 160 | 159 | ||
361 | 161 | # Check integrity of downloaded package | 160 | # Check integrity of downloaded package |
362 | @@ -176,208 +175,251 @@ | |||
363 | 176 | if [ "$WAS_URL" == "" ]; then | 175 | if [ "$WAS_URL" == "" ]; then |
364 | 177 | juju-log "IBM WAS Base: URL to download IBM WAS Base package is not configured." | 176 | juju-log "IBM WAS Base: URL to download IBM WAS Base package is not configured." |
365 | 178 | exit 0 | 177 | exit 0 |
367 | 179 | else | 178 | else |
368 | 180 | juju-log "Downloading WAS Base Packages" | 179 | juju-log "Downloading WAS Base Packages" |
369 | 181 | was_base_pkg1="WAS_V8.5.5_1_OF_3.zip" | 180 | was_base_pkg1="WAS_V8.5.5_1_OF_3.zip" |
370 | 182 | was_base_pkg2="WAS_V8.5.5_2_OF_3.zip" | 181 | was_base_pkg2="WAS_V8.5.5_2_OF_3.zip" |
371 | 183 | was_base_pkg3="WAS_V8.5.5_3_OF_3.zip" | 182 | was_base_pkg3="WAS_V8.5.5_3_OF_3.zip" |
372 | 184 | was_base_fixpack1="8.5.5-WS-WAS-FP0000004-part1.zip" | 183 | was_base_fixpack1="8.5.5-WS-WAS-FP0000004-part1.zip" |
373 | 185 | was_base_fixpack2="8.5.5-WS-WAS-FP0000004-part2.zip" | 184 | was_base_fixpack2="8.5.5-WS-WAS-FP0000004-part2.zip" |
382 | 186 | if [ -f $CHARM_DIR/$ARCHIVE_DIR/$was_base_pkg1 -a -f $CHARM_DIR/$ARCHIVE_DIR/$was_base_pkg2 -a -f $CHARM_DIR/$ARCHIVE_DIR/$was_base_pkg3 -a -f $CHARM_DIR/$ARCHIVE_DIR/$was_base_fixpack1 -a -f $CHARM_DIR/$ARCHIVE_DIR/$was_base_fixpack2 ];then | 185 | was_base_ppc64le_pkg1="WAS_V8.5.5_FOR_POWERLE_ML.zip" |
383 | 187 | juju-log " IBM WAS Base:Reinstalling WAS Base, Downloaded Packages already exists in Archive Dir. " | 186 | was_base_ppc64le_pkg2="WAS_V8.5.5_2_OF_2_FOR_POWERLE_ML.zip" |
384 | 188 | else | 187 | was_base_ppc64le_fixpack1="8.5.5-WS-WAS-LE-FP0000006-part1.zip" |
385 | 189 | wget $WAS_URL/$was_base_pkg1 $WAS_URL/$was_base_pkg2 $WAS_URL/$was_base_pkg3 $WAS_URL/$was_base_fixpack1 $WAS_URL/$was_base_fixpack2 | 188 | was_base_ppc64le_fixpack2="8.5.5-WS-WAS-LE-FP0000006-part2.zip" |
386 | 190 | if [ $? == 0 ]; then | 189 | |
387 | 191 | juju-log "IBM WAS Base: Downloaded WAS Base packages sucessfully" | 190 | if [ "$ARCHITECTURE" == "x86_64" ];then |
388 | 192 | fi | 191 | if [ -f $CHARM_DIR/$ARCHIVE_DIR/$was_base_pkg1 -a -f $CHARM_DIR/$ARCHIVE_DIR/$was_base_pkg2 -a -f $CHARM_DIR/$ARCHIVE_DIR/$was_base_pkg3 -a -f $CHARM_DIR/$ARCHIVE_DIR/$was_base_fixpack1 -a -f $CHARM_DIR/$ARCHIVE_DIR/$was_base_fixpack2 ];then |
389 | 193 | fi | 192 | juju-log " IBM WAS Base:Installing WAS Base, Downloaded packages already exists in archive directory." |
390 | 193 | else | ||
391 | 194 | wget -t 2 -P $CHARM_DIR/$ARCHIVE_DIR $WAS_URL/$was_base_pkg1 $WAS_URL/$was_base_pkg2 $WAS_URL/$was_base_pkg3 $WAS_URL/$was_base_fixpack1 $WAS_URL/$was_base_fixpack2 | ||
392 | 195 | if [ $? == 0 ]; then | ||
393 | 196 | juju-log "IBM WAS Base: Downloaded WAS Base packages successfully" | ||
394 | 197 | fi | ||
395 | 198 | fi | ||
396 | 199 | elif [ "$ARCHITECTURE" == "ppc64le" ];then | ||
397 | 200 | if [ -f $CHARM_DIR/$ARCHIVE_DIR/$was_base_ppc64le_pkg1 -a -f $CHARM_DIR/$ARCHIVE_DIR/$was_base_ppc64le_pkg2 -a -f $CHARM_DIR/$ARCHIVE_DIR/$was_base_ppc64le_fixpack1 -a -f $CHARM_DIR/$ARCHIVE_DIR/$was_base_ppc64le_fixpack2 ];then | ||
398 | 201 | juju-log " IBM WAS Base:Installing WAS Base, Downloaded packages already exists in archive directory." | ||
399 | 202 | else | ||
400 | 203 | wget -t 2 -P $CHARM_DIR/$ARCHIVE_DIR $WAS_URL/$was_base_ppc64le_pkg1 $WAS_URL/$was_base_ppc64le_pkg2 $WAS_URL/$was_base_ppc64le_fixpack1 $WAS_URL/$was_base_ppc64le_fixpack2 | ||
401 | 204 | if [ $? == 0 ]; then | ||
402 | 205 | juju-log "IBM WAS Base: Downloaded WAS Base packages successfully" | ||
403 | 206 | fi | ||
404 | 207 | fi | ||
405 | 208 | |||
406 | 209 | fi | ||
407 | 194 | fi | 210 | fi |
408 | 195 | 211 | ||
430 | 196 | # Check integrity of downloaded package | 212 | # Check integrity of downloaded package |
431 | 197 | if [ "b9cc0b783b482de2092d5c387de05cda2e922413" != "`sha1sum $CHARM_DIR/$ARCHIVE_DIR/WAS_V8.5.5_1_OF_3.zip | cut -d" " -f1`" ]; then | 213 | if [ "$ARCHITECTURE" == "x86_64" ];then |
432 | 198 | juju-log "IBM WAS Base: IBM WAS package1 is corrupt." | 214 | if [ "b9cc0b783b482de2092d5c387de05cda2e922413" != "`sha1sum $CHARM_DIR/$ARCHIVE_DIR/$was_base_pkg1 | cut -d" " -f1`" ]; then |
433 | 199 | exit 0 | 215 | juju-log "IBM WAS Base: IBM WAS package1 is corrupt." |
434 | 200 | fi | 216 | exit 0 |
435 | 201 | if [ "74a52b1b5aaedd67c0727db90aff9dc63ff28f4e" != "`sha1sum $CHARM_DIR/$ARCHIVE_DIR/WAS_V8.5.5_2_OF_3.zip | cut -d" " -f1`" ]; then | 217 | fi |
436 | 202 | juju-log "IBM WAS Base: IBM WAS package2 is corrupt." | 218 | if [ "74a52b1b5aaedd67c0727db90aff9dc63ff28f4e" != "`sha1sum $CHARM_DIR/$ARCHIVE_DIR/$was_base_pkg2 | cut -d" " -f1`" ]; then |
437 | 203 | exit 0 | 219 | juju-log "IBM WAS Base: IBM WAS package2 is corrupt." |
438 | 204 | fi | 220 | exit 0 |
439 | 205 | if [ "e6943fa4a4a7a1384fad1faa54289106f0e57979" != "`sha1sum $CHARM_DIR/$ARCHIVE_DIR/WAS_V8.5.5_3_OF_3.zip | cut -d" " -f1`" ]; then | 221 | fi |
440 | 206 | juju-log "IBM WAS Base: IBM WAS package3 is corrupt." | 222 | if [ "e6943fa4a4a7a1384fad1faa54289106f0e57979" != "`sha1sum $CHARM_DIR/$ARCHIVE_DIR/$was_base_pkg3 | cut -d" " -f1`" ]; then |
441 | 207 | exit 0 | 223 | juju-log "IBM WAS Base: IBM WAS package3 is corrupt." |
442 | 208 | fi | 224 | exit 0 |
443 | 209 | if [ "895863b932334a78cccce6c73ec98d35ba98639b" != "`sha1sum $CHARM_DIR/$ARCHIVE_DIR/8.5.5-WS-WAS-FP0000004-part1.zip | cut -d" " -f1`" ]; then | 225 | fi |
444 | 210 | juju-log "IBM WAS Base: IBM WAS Fix Pack part1 is corrupt." | 226 | if [ "895863b932334a78cccce6c73ec98d35ba98639b" != "`sha1sum $CHARM_DIR/$ARCHIVE_DIR/$was_base_fixpack1 | cut -d" " -f1`" ]; then |
445 | 211 | exit 0 | 227 | juju-log "IBM WAS Base: IBM WAS Fix Pack part1 is corrupt." |
446 | 212 | fi | 228 | exit 0 |
447 | 213 | if [ "8f8560746c6fb0f87cd47801a014e7c34fccc4cc" != "`sha1sum $CHARM_DIR/$ARCHIVE_DIR/8.5.5-WS-WAS-FP0000004-part2.zip | cut -d" " -f1`" ]; then | 229 | fi |
448 | 214 | juju-log "IBM WAS Base: IBM WAS Fix Pack part2 is corrupt." | 230 | if [ "8f8560746c6fb0f87cd47801a014e7c34fccc4cc" != "`sha1sum $CHARM_DIR/$ARCHIVE_DIR/$was_base_fixpack2 | cut -d" " -f1`" ]; then |
449 | 215 | exit 0 | 231 | juju-log "IBM WAS Base: IBM WAS Fix Pack part2 is corrupt." |
450 | 216 | fi | 232 | exit 0 |
451 | 233 | fi | ||
452 | 234 | elif [ "$ARCHITECTURE" == "ppc64le" ];then | ||
453 | 235 | if [ "62cc5a2d23a2ff828d2b4dcd9ac754b3ff994292" != "`sha1sum $CHARM_DIR/$ARCHIVE_DIR/$was_base_ppc64le_pkg1 | cut -d" " -f1`" ]; then | ||
454 | 236 | juju-log "IBM WAS Base: IBM WAS package1 is corrupt." | ||
455 | 237 | exit 0 | ||
456 | 238 | fi | ||
457 | 239 | if [ "bc475ccd6f918bf858ccbb48d82e5adc2c7b3fa9" != "`sha1sum $CHARM_DIR/$ARCHIVE_DIR/$was_base_ppc64le_pkg2 | cut -d" " -f1`" ]; then | ||
458 | 240 | juju-log "IBM WAS Base: IBM WAS package2 is corrupt." | ||
459 | 241 | exit 0 | ||
460 | 242 | fi | ||
461 | 243 | if [ "c0f38a16b87b7e6e7c5c0f609fb3c1a61a3b7e8e" != "`sha1sum $CHARM_DIR/$ARCHIVE_DIR/$was_base_ppc64le_fixpack1 | cut -d" " -f1`" ]; then | ||
462 | 244 | juju-log "IBM WAS Base: IBM WAS Fix Pack part1 is corrupt." | ||
463 | 245 | exit 0 | ||
464 | 246 | fi | ||
465 | 247 | if [ "c8fe75b915fa2ecd183af208eff7df0464342ff8" != "`sha1sum $CHARM_DIR/$ARCHIVE_DIR/$was_base_ppc64le_fixpack2 | cut -d" " -f1`" ]; then | ||
466 | 248 | juju-log "IBM WAS Base: IBM WAS Fix Pack part2 is corrupt." | ||
467 | 249 | exit 0 | ||
468 | 250 | fi | ||
469 | 251 | fi | ||
470 | 252 | |||
471 | 217 | } | 253 | } |
472 | 218 | 254 | ||
473 | 219 | 255 | ||
474 | 220 | |||
475 | 221 | |||
476 | 222 | |||
477 | 223 | juju-log "IBM WAS BASE: Begin config-change hook" | 256 | juju-log "IBM WAS BASE: Begin config-change hook" |
478 | 224 | was_base_license_accepted=`config-get accept-ibm-websphere-license` | 257 | was_base_license_accepted=`config-get accept-ibm-websphere-license` |
479 | 225 | im_license_accepted=`config-get accept-ibm-im-license` | 258 | im_license_accepted=`config-get accept-ibm-im-license` |
480 | 226 | IM_INSTALL_PATH=`config-get im_install_path` | 259 | IM_INSTALL_PATH=`config-get im_install_path` |
481 | 227 | WAS_URL=`config-get was_url` | 260 | WAS_URL=`config-get was_url` |
482 | 228 | im_file_name=`config-get im_file_name` | 261 | im_file_name=`config-get im_file_name` |
483 | 262 | ARCHITECTURE=`uname -m` | ||
484 | 229 | 263 | ||
485 | 230 | # Remove IM and WAS if license not accepted abase exit. Else install it | 264 | # Remove IM and WAS if license not accepted abase exit. Else install it |
486 | 231 | remove_unaccepted_software $was_base_license_accepted $im_license_accepted | 265 | remove_unaccepted_software $was_base_license_accepted $im_license_accepted |
487 | 232 | if [ $im_license_accepted == False ]; then | 266 | if [ $im_license_accepted == False ]; then |
489 | 233 | juju-log "IBM WAS Base: Websphere IM License not accepted." | 267 | juju-log "IBM WAS Base: Websphere IM License not accepted." |
490 | 234 | 268 | ||
491 | 235 | elif [ $im_license_accepted == True ]; then | 269 | elif [ $im_license_accepted == True ]; then |
502 | 236 | juju-log "IBM WAS Base: IBM IM License accepted" | 270 | juju-log "IBM WAS Base: IBM IM License accepted" |
503 | 237 | juju-log "IBM WAS Base: downloading and extracting IM packages" | 271 | download_IM |
504 | 238 | cd $CHARM_DIR/$ARCHIVE_DIR | 272 | im_inst=`is_im_installed` |
505 | 239 | if [ -d $CHARM_DIR/$ARCHIVE_DIR/IM ];then | 273 | if [ $im_inst == False ]; then |
496 | 240 | juju-log "IBM WAS Base: Removing Existing IM DIR. Cresting new IM DIR" | ||
497 | 241 | rm -rf $CHARM_DIR/$ARCHIVE_DIR/IM | ||
498 | 242 | fi | ||
499 | 243 | mkdir IM | ||
500 | 244 | cd IM | ||
501 | 245 | download_IM | ||
506 | 246 | if [ -f $CHARM_DIR/$ARCHIVE_DIR/IM/*.zip ]; then | 274 | if [ -f $CHARM_DIR/$ARCHIVE_DIR/IM/*.zip ]; then |
518 | 247 | unzip $CHARM_DIR/$ARCHIVE_DIR/IM/*.zip -d $CHARM_DIR/$ARCHIVE_DIR/IM | 275 | juju-log "IBM WAS Base: downloading and extracting IM packages" |
519 | 248 | if [ $? != 0 ]; then | 276 | if [ -f $CHARM_DIR/$ARCHIVE_DIR/IM/userinstc ]; then |
520 | 249 | juju-log "IBM WAS Base: Unable to extract the IM package content. Verify whether the package is corrupt." | 277 | juju-log "IBM WAS Base: IBM IM package contents extracted already." |
521 | 250 | # Remove corrupt archive file | 278 | else |
522 | 251 | rm -f $CHARM_DIR/$ARCHIVE_DIR/IM/*.zip | 279 | unzip $CHARM_DIR/$ARCHIVE_DIR/IM/*.zip -d $CHARM_DIR/$ARCHIVE_DIR/IM |
523 | 252 | exit 0 | 280 | if [ $? != 0 ]; then |
524 | 253 | fi | 281 | juju-log "IBM WAS Base: Unable to extract the IM package content. Verify whether the package is corrupt." |
525 | 254 | fi | 282 | # Remove corrupt archive file |
526 | 255 | 283 | rm -f $CHARM_DIR/$ARCHIVE_DIR/IM/*.zip | |
527 | 256 | im_inst=`is_im_installed` | 284 | exit 0 |
528 | 257 | if [ $im_inst == False ]; then | 285 | fi |
529 | 286 | fi | ||
530 | 287 | fi | ||
531 | 258 | juju-log "IBM WAS Base: IM installation start" | 288 | juju-log "IBM WAS Base: IM installation start" |
533 | 259 | # Check IM package availability | 289 | # Check IM package availability |
534 | 260 | juju-log $CHARM_DIR/$ARCHIVE_DIR | 290 | juju-log $CHARM_DIR/$ARCHIVE_DIR |
535 | 261 | if [ -f $CHARM_DIR/$ARCHIVE_DIR/IM/userinstc ]; | 291 | if [ -f $CHARM_DIR/$ARCHIVE_DIR/IM/userinstc ]; |
536 | 262 | then | 292 | then |
543 | 263 | juju-log "IBM WAS Base: IM Packages available for installation." | 293 | |
544 | 264 | cp $CHARM_DIR/$ARCHIVE_DIR/IM/install.xml $CHARM_DIR/$ARCHIVE_DIR/IM/silent_install.xml | 294 | juju-log "IBM WAS Base: IM Packages available for installation." |
545 | 265 | sed -i "2 a \<profile kind='self' installLocation='$IM_INSTALL_PATH' id='IBM Installation Manager'>\n <data key='eclipseLocation' value='$IM_INSTALL_PATH' />\n</profile>" $CHARM_DIR/$ARCHIVE_DIR/IM/silent_install.xml | 295 | cp $CHARM_DIR/$ARCHIVE_DIR/IM/install.xml $CHARM_DIR/$ARCHIVE_DIR/IM/silent_install.xml |
546 | 266 | $CHARM_DIR/$ARCHIVE_DIR/IM/userinstc -input $CHARM_DIR/$ARCHIVE_DIR/IM/silent_install.xml -acceptlicense | 296 | sed -i "2 a \<profile kind='self' installLocation='$IM_INSTALL_PATH' id='IBM Installation Manager'>\n <data key='eclipseLocation' value='$IM_INSTALL_PATH' />\n</profile>" $CHARM_DIR/$ARCHIVE_DIR/IM/silent_install.xml |
547 | 267 | 297 | $CHARM_DIR/$ARCHIVE_DIR/IM/userinstc -input $CHARM_DIR/$ARCHIVE_DIR/IM/silent_install.xml -acceptlicense | |
542 | 268 | |||
548 | 269 | if [ $? == 0 ] | 298 | if [ $? == 0 ] |
549 | 270 | then | 299 | then |
551 | 271 | juju-log "IBM WAS Base: IM Is installed successfully" | 300 | juju-log "IBM WAS Base: IM Is installed successfully" |
552 | 272 | else | 301 | else |
554 | 273 | juju-log "IBM WAS Base: Error while installing IM" | 302 | juju-log "IBM WAS Base: Error while installing IM" |
555 | 303 | exit 1 | ||
556 | 304 | fi | ||
557 | 305 | |||
558 | 306 | else | ||
559 | 307 | juju-log "IBM WAS Base: IM Packages missing. Please check README file" | ||
560 | 308 | juju-log "IBM WAS Base: Upgrade IM charm after adding the IM packages"; | ||
561 | 274 | exit 1 | 309 | exit 1 |
570 | 275 | fi | 310 | fi |
571 | 276 | 311 | else | |
572 | 277 | else | 312 | juju-log "IBM WAS Base: IBM IM Installed already using same package name." |
573 | 278 | juju-log "IBM WAS Base: IM Packages missing. Please check README file" | 313 | fi |
566 | 279 | juju-log "IBM WAS Base: Upgrade IM charm after adding the IM packages"; | ||
567 | 280 | exit 1 | ||
568 | 281 | fi | ||
569 | 282 | fi | ||
574 | 283 | else | 314 | else |
576 | 284 | juju-log " IBM WAS Base: Acceptable values for license is 'True' or 'False'" | 315 | juju-log " IBM WAS Base: Acceptable values for license is 'True' or 'False'" |
577 | 285 | 316 | ||
578 | 286 | fi | 317 | fi |
579 | 287 | 318 | ||
580 | 288 | if [ $was_base_license_accepted == False ]; then | 319 | if [ $was_base_license_accepted == False ]; then |
583 | 289 | juju-log "IBM WAS Base: Websphere BASE License not accepted." | 320 | juju-log "IBM WAS Base: Websphere BASE License not accepted." |
582 | 290 | |||
584 | 291 | elif [ $was_base_license_accepted == True ]; then | 321 | elif [ $was_base_license_accepted == True ]; then |
587 | 292 | juju-log "IBM WAS Base: Check WAS Base package availability" | 322 | juju-log "IBM WAS Base: Check WAS Base package availability" |
588 | 293 | cd $CHARM_DIR/$ARCHIVE_DIR | 323 | is_was_base_installed=`is_was_base_installed` |
589 | 324 | if [ $is_was_base_installed == False ];then | ||
590 | 294 | download_WAS | 325 | download_WAS |
591 | 295 | if [ -d "$CHARM_DIR/$ARCHIVE_DIR/disk1" ];then | 326 | if [ -d "$CHARM_DIR/$ARCHIVE_DIR/disk1" ];then |
603 | 296 | juju-log "IBM WAS Base: Reinstalling WAS BASE, unzipped package contents aavailable" | 327 | juju-log "IBM WAS Base: Installing WAS Base, unzipped package contents aavailable" |
604 | 297 | else | 328 | else |
605 | 298 | unzip 'WAS_*.zip' | 329 | unzip $CHARM_DIR/$ARCHIVE_DIR/'WAS_*.zip' -d $CHARM_DIR/$ARCHIVE_DIR/ |
606 | 299 | if [ $? != 0 ]; then | 330 | if [ $? != 0 ]; then |
607 | 300 | juju-log "IBM WAS Base: Unable to extract the WAS packages content. Verify whether the package is corrupt." | 331 | juju-log "IBM WAS Base: Unable to extract the WAS packages content. Verify whether the package is corrupt." |
608 | 301 | # Remove corrupt archive file | 332 | # Remove corrupt archive file |
609 | 302 | rm -f $CHARM_DIR/$ARCHIVE_DIR/'WAS_*.zip' | 333 | rm -f $CHARM_DIR/$ARCHIVE_DIR/'WAS_*.zip' |
610 | 303 | exit 0 | 334 | exit 0 |
611 | 304 | else | 335 | else |
612 | 305 | juju-log "IBM WAS Base: Downloaded and Extracted WAS Base Packages Sucessfully" | 336 | juju-log "IBM WAS Base: Downloaded and Extracted WAS Base Packages Sucessfully" |
613 | 306 | fi | 337 | fi |
614 | 307 | fi | 338 | fi |
615 | 308 | if [ -d $CHARM_DIR/$ARCHIVE_DIR/was_fixpack ];then | 339 | if [ -d $CHARM_DIR/$ARCHIVE_DIR/was_fixpack ];then |
617 | 309 | juju-log "IBM WAS Base: WAS Base Fixpack packages are available for upgrading" | 340 | juju-log "IBM WAS Base: WAS Base Fixpack packages are available for upgrading" |
618 | 310 | else | 341 | else |
621 | 311 | mkdir was_fixpack | 342 | unzip $CHARM_DIR/$ARCHIVE_DIR/'8.5.5-WS-WAS*.zip' -d $CHARM_DIR/$ARCHIVE_DIR/was_fixpack/ |
620 | 312 | unzip '8.5.5-WS-WAS*.zip' -d $CHARM_DIR/$ARCHIVE_DIR/was_fixpack | ||
622 | 313 | if [ $? != 0 ]; then | 343 | if [ $? != 0 ]; then |
627 | 314 | juju-log "IBM WAS Base: Unable to extract the WAS Base fixpack packages content. Verify whether the package is corrupt." | 344 | juju-log "IBM WAS Base: Unable to extract the WAS Base fixpack packages content. Verify whether the package is corrupt." |
628 | 315 | # Remove corrupt archive file | 345 | # Remove corrupt archive file |
629 | 316 | rm -f $CHARM_DIR/$ARCHIVE_DIR/8.5.5-WS-WAS*.zip | 346 | rm -f $CHARM_DIR/$ARCHIVE_DIR/8.5.5-WS-WAS*.zip |
630 | 317 | exit 0 | 347 | exit 0 |
631 | 318 | else | 348 | else |
640 | 319 | juju-log "IBM WAS Base: Downloaded and Extracted WAS Base fixpack Packages Sucessfully" | 349 | juju-log "IBM WAS Base: Downloaded and Extracted WAS Base fixpack Packages Sucessfully" |
641 | 320 | fi fi | 350 | fi |
642 | 321 | 351 | fi | |
643 | 322 | 352 | # check WAS package availability | |
644 | 323 | # check WAS package availability | 353 | if [ -d "$CHARM_DIR/$ARCHIVE_DIR/disk1" ]; then |
645 | 324 | if [ -d "$CHARM_DIR/$ARCHIVE_DIR/disk1" ]; then | 354 | juju-log "IBM WAS Base: WAS BASE Packages available for installation."; |
646 | 325 | juju-log "IBM WAS Base: WAS BASE Packages available for installation."; | 355 | #Check IM installation |
639 | 326 | #Check IM installation | ||
647 | 327 | im_installed=`is_im_installed` | 356 | im_installed=`is_im_installed` |
652 | 328 | if [ $im_installed == True ]; then | 357 | if [ $im_installed == True ]; then |
653 | 329 | 358 | juju-log "IBM WAS Base: Installing WAS BASE " | |
654 | 330 | juju-log "IBM WAS Base: Installing WAS BASE " | 359 | if [ "$ARCHITECTURE" == "x86_64" ];then |
655 | 331 | $IM_INSTALL_PATH/eclipse/tools/imcl install com.ibm.websphere.BASE.v85 -acceptLicense -repositories $CHARM_DIR/$ARCHIVE_DIR/ -installationDirectory $WAS_BASE_INSTALL_PATH -showProgress | 360 | $IM_INSTALL_PATH/eclipse/tools/imcl install com.ibm.websphere.BASE.v85 -acceptLicense -repositories $CHARM_DIR/$ARCHIVE_DIR/ -installationDirectory $WAS_BASE_INSTALL_PATH -showProgress |
656 | 361 | if [ $? == 0 ]; | ||
657 | 362 | then | ||
658 | 363 | juju-log " IBM WAS Base: WAS Base is installed successfully" | ||
659 | 364 | else | ||
660 | 365 | juju-log "IBM WAS Base: Error while installing WAS" | ||
661 | 366 | exit 1 | ||
662 | 367 | fi | ||
663 | 368 | elif [ "$ARCHITECTURE" == "ppc64le" ];then | ||
664 | 369 | $IM_INSTALL_PATH/eclipse/tools/imcl install com.ibm.websphere.BASE.le.v85 -acceptLicense -repositories $CHARM_DIR/$ARCHIVE_DIR/ -installationDirectory $WAS_BASE_INSTALL_PATH -showProgress | ||
665 | 370 | if [ $? == 0 ]; | ||
666 | 371 | then | ||
667 | 372 | juju-log " IBM WAS Base: WAS Base is installed successfully" | ||
668 | 373 | else | ||
669 | 374 | juju-log "IBM WAS Base: Error while installing WAS" | ||
670 | 375 | exit 1 | ||
671 | 376 | fi | ||
672 | 377 | |||
673 | 378 | fi | ||
674 | 379 | else | ||
675 | 380 | juju-log "IBM WAS Base: IM needs to be installed before installing WAS." | ||
676 | 381 | exit 0 | ||
677 | 382 | fi | ||
678 | 383 | juju-log "IBM WAS Base: creating a profile" | ||
679 | 384 | #sh does not work in ubuntu so linking to bash | ||
680 | 385 | juju-log "IBM WAS Base: Unlink /bin/sh" | ||
681 | 386 | unlink /bin/sh | ||
682 | 387 | ln -s /bin/bash /bin/sh | ||
683 | 388 | juju-log "IBM WAS Base: creating a profile" | ||
684 | 389 | $WAS_BASE_INSTALL_PATH/bin/manageprofiles.sh -create -profileName "test" -profilePath "$WAS_BASE_INSTALL_PATH/profiles/test" -templatePath "$WAS_BASE_INSTALL_PATH/profileTemplates/default" -nodeName "node1" -cellName "cell1" -serverName "server1" -adminUserName "wasadmin" -adminPassword "wasadmin" | ||
685 | 390 | juju-log "IBM WAS Base: Profile creation completed" | ||
686 | 391 | #Apply fixpack 8.5.5.4 to upgrade was base version from 8.5.5.0 to 8.5.5.4 | ||
687 | 392 | juju-log "IBM WAS Base: Upgrading WAS Base by installing WAS fixpack" | ||
688 | 393 | if [ "$ARCHITECTURE" == "x86_64" ];then | ||
689 | 394 | $IM_INSTALL_PATH/eclipse/tools/imcl install com.ibm.websphere.BASE.v85_8.5.5004.20141119_1746 -repositories $CHARM_DIR/files/archives/was_fixpack -installationDirectory $WAS_BASE_INSTALL_PATH -acceptLicense -showProgress | ||
690 | 395 | elif [ "$ARCHITECTURE" == "ppc64le" ];then | ||
691 | 396 | $IM_INSTALL_PATH/eclipse/tools/imcl install com.ibm.websphere.BASE.le.v85_8.5.5006.20150529_0614 -repositories $CHARM_DIR/files/archives/was_fixpack -installationDirectory $WAS_BASE_INSTALL_PATH -acceptLicense -showProgress | ||
692 | 397 | fi | ||
693 | 332 | if [ $? == 0 ]; | 398 | if [ $? == 0 ]; |
694 | 333 | then | 399 | then |
723 | 334 | juju-log " IBM WAS Base: WAS Base is installed successfully" | 400 | juju-log " IBM WAS Base: WAS fixpack installed successfully" |
724 | 335 | else | 401 | else |
725 | 336 | juju-log "IBM WAS Base: Error while installing WAS" | 402 | juju-log "IBM WAS Base: Error while installing WAS fixpack" |
726 | 337 | exit 1 | 403 | exit 1 |
727 | 338 | fi | 404 | fi |
728 | 339 | else | 405 | #starting the server |
729 | 340 | juju-log "IBM WAS Base: IM is not installaed to install WAS" | 406 | cd $WAS_BASE_INSTALL_PATH/profiles/test/bin/ |
730 | 341 | exit 0 | 407 | juju-log "IBM WAS Base: Server Starting" |
731 | 342 | fi | 408 | ./startServer.sh server1 |
732 | 343 | 409 | if [ "$?" -ne "0" ]; then | |
733 | 344 | juju-log "IBM WAS Base: creating a profile" | 410 | juju-log "IBM WAS Base: Error while starting the server" |
734 | 345 | #sh does not work in ubuntu so linking to bash | 411 | else |
735 | 346 | 412 | juju-log "IBM WAS Base: Server started successfully" | |
736 | 347 | juju-log "IBM WAS Base: Unlink /bin/sh" | 413 | fi |
737 | 348 | unlink /bin/sh | 414 | |
738 | 349 | ln -s /bin/bash /bin/sh | 415 | |
711 | 350 | juju-log "IBM WAS Base: creating a profile" | ||
712 | 351 | |||
713 | 352 | $WAS_BASE_INSTALL_PATH/bin/manageprofiles.sh -create -profileName "test" -profilePath "$WAS_BASE_INSTALL_PATH/profiles/test" -templatePath "$WAS_BASE_INSTALL_PATH/profileTemplates/default" -nodeName "node1" -cellName "cell1" -serverName "server1" -adminUserName "wasadmin" -adminPassword "wasadmin" | ||
714 | 353 | juju-log "IBM WAS Base: Profile creation completed" | ||
715 | 354 | |||
716 | 355 | #Apply fixpack 8.5.5.4 to upgrade was base version from 8.5.5.0 to 8.5.5.4 | ||
717 | 356 | |||
718 | 357 | juju-log "IBM WAS Base: Upgrading WAS Base by installing WAS fixpack" | ||
719 | 358 | $IM_INSTALL_PATH/eclipse/tools/imcl install com.ibm.websphere.BASE.v85_8.5.5004.20141119_1746 -repositories $CHARM_DIR/files/archives/was_fixpack -installationDirectory $WAS_BASE_INSTALL_PATH -acceptLicense -showProgress | ||
720 | 359 | if [ $? == 0 ]; | ||
721 | 360 | then | ||
722 | 361 | juju-log " IBM WAS Base: WAS fixpack installed successfully" | ||
739 | 362 | else | 416 | else |
742 | 363 | juju-log "IBM WAS Base: Error while installing WAS fixpack" | 417 | juju-log "IBM WAS Base: WAS BASE Packages are not available" |
741 | 364 | exit 1 | ||
743 | 365 | fi | 418 | fi |
746 | 366 | else | 419 | else |
747 | 367 | juju-log "IBM WAS Base: WAS BASE Packages are not available" | 420 | juju-log "IBM WAS Base: IBM WAS Base Software installed already" |
748 | 368 | fi | 421 | fi |
749 | 369 | else | 422 | else |
750 | 370 | juju-log "IBM WAS Base: Acceptable values for license is 'True' or 'False'" | 423 | juju-log "IBM WAS Base: Acceptable values for license is 'True' or 'False'" |
751 | 371 | fi | 424 | fi |
764 | 372 | 425 | juju-log "IBM WAS Base: End Config-Changed hook..." | |
753 | 373 | #starting the server | ||
754 | 374 | cd $WAS_BASE_INSTALL_PATH/profiles/test/bin/ | ||
755 | 375 | juju-log "IBM WAS Base: Server Starting" | ||
756 | 376 | ./startServer.sh server1 | ||
757 | 377 | if [ "$?" -ne "0" ]; then | ||
758 | 378 | juju-log "IBM WAS Base: Error while starting the server" | ||
759 | 379 | else | ||
760 | 380 | juju-log "IBM WAS Base: Server started successfully" | ||
761 | 381 | |||
762 | 382 | fi | ||
763 | 383 | |||
765 | 384 | 426 | ||
766 | === modified file 'hooks/install' | |||
767 | --- hooks/install 2015-07-13 10:13:52 +0000 | |||
768 | +++ hooks/install 2015-08-04 08:54:53 +0000 | |||
769 | @@ -9,28 +9,15 @@ | |||
770 | 9 | apt-get install -y wget | 9 | apt-get install -y wget |
771 | 10 | juju-log "IBM WAS Base: wget downloaded and installed." | 10 | juju-log "IBM WAS Base: wget downloaded and installed." |
772 | 11 | 11 | ||
773 | 12 | # Need to update hostname in /etc/hosts | ||
774 | 13 | private_address=`unit-get private-address` | ||
775 | 14 | juju-log "private_address : $private_address" | ||
776 | 15 | echo "$private_address `hostname`" >> /etc/hosts | ||
777 | 16 | if [ $? == 0 ]; | ||
778 | 17 | then | ||
779 | 18 | juju-log "hostname updated" | ||
780 | 19 | else | ||
781 | 20 | juju-log "Error while updating /etc/hosts" | ||
782 | 21 | fi | ||
783 | 22 | |||
784 | 23 | #Install unzip | 12 | #Install unzip |
785 | 24 | juju-log "IBM WAS Base: Downloading and installng unzip." | 13 | juju-log "IBM WAS Base: Downloading and installng unzip." |
786 | 25 | apt-get install -y unzip | 14 | apt-get install -y unzip |
787 | 26 | juju-log "IBM WAS Base: unzip downloaded and installed." | 15 | juju-log "IBM WAS Base: unzip downloaded and installed." |
788 | 27 | 16 | ||
789 | 28 | ARCHITECTURE=`uname -m` | 17 | ARCHITECTURE=`uname -m` |
793 | 29 | if [ "$ARCHITECTURE" != "x86_64" ] || [ "$ARCHITECTURE" = "ppc64le" ]; then | 18 | if [ "$ARCHITECTURE" != "x86_64" -a "$ARCHITECTURE" != "ppc64le" ]; then |
794 | 30 | juju-log "IBM WAS Base: Unsupported platform. IBM WAS Base installed with this Charm supports only the x86_64 and ppc64le platforms." | 19 | juju-log "IBM WAS Base: Unsupported platform. IBM WAS Base installed with this Charm supports only the x86_64 and ppc64le platforms." |
795 | 31 | exit 1 | 20 | exit 1 |
796 | 32 | fi | 21 | fi |
797 | 33 | 22 | ||
798 | 34 | juju-log "IBM WAS Base: IM and WAS packages downloaded. Awaiting acceptance of license (see README on how to accept the license)." | ||
799 | 35 | |||
800 | 36 | juju-log "IBM WAS Base: End Install." | 23 | juju-log "IBM WAS Base: End Install." |
801 | 37 | 24 | ||
802 | === modified file 'hooks/start' | |||
803 | --- hooks/start 2015-07-13 10:13:52 +0000 | |||
804 | +++ hooks/start 2015-08-04 08:54:53 +0000 | |||
805 | @@ -5,16 +5,20 @@ | |||
806 | 5 | #server_status=` ps -ef | grep '$WAS_BASE_INSTALL_PATH'` | 5 | #server_status=` ps -ef | grep '$WAS_BASE_INSTALL_PATH'` |
807 | 6 | netstat -nltp | grep 9060 | 6 | netstat -nltp | grep 9060 |
808 | 7 | if [ "$?" -eq "0" ];then | 7 | if [ "$?" -eq "0" ];then |
810 | 8 | juju-log "IBM WAS Base: WAS Base Server already started" | 8 | juju-log "IBM WAS Base: WAS Base Server already started" |
811 | 9 | else | 9 | else |
820 | 10 | cd $WAS_BASE_INSTALL_PATH/profiles/test/bin/ | 10 | if [ -d $WAS_BASE_INSTALL_PATH/profiles/test/bin ]; then |
821 | 11 | ./startServer.sh server1 | 11 | cd $WAS_BASE_INSTALL_PATH/profiles/test/bin/ |
822 | 12 | if [ "$?" -ne "0" ]; then | 12 | ./startServer.sh server1 |
823 | 13 | juju-log "IBM WAS Base: Error while starting the server" | 13 | if [ "$?" -ne "0" ]; then |
824 | 14 | else | 14 | juju-log "IBM WAS Base: Error while starting the server" |
825 | 15 | juju-log "IBM WAS Base: Server started successfully" | 15 | else |
826 | 16 | 16 | juju-log "IBM WAS Base: Server started successfully" | |
827 | 17 | fi | 17 | fi |
828 | 18 | else | ||
829 | 19 | juju-log "IBM WAS Base: No server to start, exiting." | ||
830 | 20 | exit 0 | ||
831 | 21 | fi | ||
832 | 18 | fi | 22 | fi |
833 | 19 | 23 | ||
834 | 20 | open-port 9060 | 24 | open-port 9060 |
835 | 21 | 25 | ||
836 | === modified file 'hooks/stop' | |||
837 | --- hooks/stop 2015-07-08 05:29:41 +0000 | |||
838 | +++ hooks/stop 2015-08-04 08:54:53 +0000 | |||
839 | @@ -3,12 +3,17 @@ | |||
840 | 3 | set -e | 3 | set -e |
841 | 4 | WAS_BASE_INSTALL_PATH=/root/IBM/WebSphere/AppServer/V85/BASE | 4 | WAS_BASE_INSTALL_PATH=/root/IBM/WebSphere/AppServer/V85/BASE |
842 | 5 | 5 | ||
850 | 6 | cd $WAS_BASE_INSTALL_PATH/profiles/test/bin/ | 6 | if [ -d $WAS_BASE_INSTALL_PATH/profiles/test/bin ]; then |
851 | 7 | ./stopServer.sh server1 | 7 | cd $WAS_BASE_INSTALL_PATH/profiles/test/bin/ |
852 | 8 | if [ "$?" -ne "0" ]; then | 8 | ./stopServer.sh server1 |
853 | 9 | juju-log "Error while stoping the server" | 9 | if [ "$?" -ne "0" ]; then |
854 | 10 | else | 10 | juju-log "Error while stoping the server" |
855 | 11 | juju-log "Server stopped successfully" | 11 | else |
856 | 12 | fi | 12 | juju-log "Server stopped successfully" |
857 | 13 | fi | ||
858 | 14 | else | ||
859 | 15 | juju-log "IBM WAS Base: No server to stop, exiting." | ||
860 | 16 | exit 0 | ||
861 | 17 | fi | ||
862 | 13 | close-port 9060 | 18 | close-port 9060 |
863 | 14 | close-port 9443 | 19 | close-port 9443 |
864 | 15 | 20 | ||
865 | === modified file 'hooks/website-relation-changed' | |||
866 | --- hooks/website-relation-changed 2015-07-13 10:13:52 +0000 | |||
867 | +++ hooks/website-relation-changed 2015-08-04 08:54:53 +0000 | |||
868 | @@ -1,3 +1,3 @@ | |||
869 | 1 | #!/bin/sh | 1 | #!/bin/sh |
870 | 2 | relation-set hostname=`unit-get private-address` port=9060 https-port=9443 | ||
871 | 2 | 3 | ||
872 | 3 | relation-set hostname=`unit-get private-address` port=9060 | ||
873 | 4 | 4 | ||
874 | === modified file 'hooks/website-relation-joined' | |||
875 | --- hooks/website-relation-joined 2015-07-13 10:13:52 +0000 | |||
876 | +++ hooks/website-relation-joined 2015-08-04 08:54:53 +0000 | |||
877 | @@ -8,5 +8,5 @@ | |||
878 | 8 | juju-log "Delete the relation. Accept the IBM WAS Base License, as per the README, before setting up any relation." | 8 | juju-log "Delete the relation. Accept the IBM WAS Base License, as per the README, before setting up any relation." |
879 | 9 | exit 0 | 9 | exit 0 |
880 | 10 | fi | 10 | fi |
882 | 11 | relation-set hostname=`unit-get private-address` port=9060 | 11 | relation-set hostname=`unit-get private-address` port=9060 https-port=9443 |
883 | 12 | juju-log "IBM WAS Base: End website-relation-joined hook." | 12 | juju-log "IBM WAS Base: End website-relation-joined hook." |
884 | 13 | 13 | ||
885 | === modified file 'tests/10-bundles-test.py' | |||
886 | --- tests/10-bundles-test.py 2015-07-13 10:13:52 +0000 | |||
887 | +++ tests/10-bundles-test.py 2015-08-04 08:54:53 +0000 | |||
888 | @@ -12,67 +12,64 @@ | |||
889 | 12 | # Lots of prereqs on this charm (eg: java), so give it a large timeout | 12 | # Lots of prereqs on this charm (eg: java), so give it a large timeout |
890 | 13 | seconds_to_wait = 2400 | 13 | seconds_to_wait = 2400 |
891 | 14 | 14 | ||
892 | 15 | |||
893 | 16 | class BundleTest(unittest.TestCase): | 15 | class BundleTest(unittest.TestCase): |
894 | 17 | """ Create a class for testing the charm in the unit test framework. """ | ||
895 | 18 | @classmethod | 16 | @classmethod |
896 | 19 | def setUpClass(cls): | 17 | def setUpClass(cls): |
908 | 20 | """ Set up an amulet deployment using the bundle. """ | 18 | d = amulet.Deployment() |
909 | 21 | d=amulet.Deployment() | 19 | |
910 | 22 | 20 | local_path = os.path.join(os.path.dirname(__file__), 'local.yaml') | |
911 | 23 | local_path = os.path.join(os.path.dirname(__file__), 'local.yaml') | 21 | with open(local_path, "r") as fd: |
912 | 24 | with open(local_path, "r") as fd: | 22 | config = yaml.safe_load(fd) |
913 | 25 | config = yaml.safe_load(fd) | 23 | |
914 | 26 | 24 | url = config.get('wasbase').get('was_url') | |
915 | 27 | url = config.get('wasbase').get('was_url') | 25 | print('Using URL %s' % url) |
916 | 28 | print('Using URL %s' % url) | 26 | # Test if a IB url for the repository is defined |
917 | 29 | # Test if a IB url for the repository is defined | 27 | if not url: |
907 | 30 | if not url: | ||
918 | 31 | print("You need to define a url for the WAS Base packages repository.\n" | 28 | print("You need to define a url for the WAS Base packages repository.\n" |
919 | 32 | "Edit local.yaml or tests/00-setup and run it again.") | 29 | "Edit local.yaml or tests/00-setup and run it again.") |
920 | 33 | sys.exit(1) | 30 | sys.exit(1) |
921 | 34 | 31 | ||
925 | 35 | pkg = config.get('wasbase').get('im_file_name') | 32 | pkg = config.get('wasbase').get('im_file_name') |
926 | 36 | print('Using IBM IM package %s' % pkg) | 33 | print('Using IBM IM package %s' % pkg) |
927 | 37 | if not pkg: | 34 | if not pkg: |
928 | 38 | print("You need to define a package name for IBM IM.\n" | 35 | print("You need to define a package name for IBM IM.\n" |
929 | 39 | "Edit local.yaml or tests/00-setup and run it again.") | 36 | "Edit local.yaml or tests/00-setup and run it again.") |
930 | 40 | sys.exit(1) | 37 | sys.exit(1) |
931 | 41 | 38 | ||
945 | 42 | bundle_path = os.path.join(os.path.dirname(__file__), 'bundles.yaml') | 39 | bundle_path = os.path.join(os.path.dirname(__file__), 'bundles.yaml') |
946 | 43 | with open(bundle_path, 'r') as bundle_file: | 40 | with open(bundle_path, 'r') as bundle_file: |
947 | 44 | contents = yaml.safe_load(bundle_file) | 41 | contents = yaml.safe_load(bundle_file) |
948 | 45 | d.load(contents) | 42 | d.load(contents) |
949 | 46 | d.add("haproxy") | 43 | d.add('haproxy') |
937 | 47 | |||
938 | 48 | # Software doesn't actually install until you accept the license | ||
939 | 49 | d.configure('was-base', {'accept-ibm-websphere-license': True, 'accept-ibm-im-license': True,'was_url': url, 'im_file_name': pkg }) | ||
940 | 50 | d.configure('haproxy', {'enable_monitoring': True }) | ||
941 | 51 | d.relate('haproxy:reverseproxy', 'was-base:website') | ||
942 | 52 | d.setup(seconds_to_wait) | ||
943 | 53 | d.sentry.wait(seconds_to_wait) | ||
944 | 54 | cls.d = d | ||
950 | 55 | 44 | ||
951 | 45 | # Software doesn't actually install until you accept the license | ||
952 | 46 | d.configure('was-base', {'accept-ibm-websphere-license': True, 'accept-ibm-im-license': True,'was_url': url, 'im_file_name': pkg }) | ||
953 | 47 | d.configure('haproxy', {'services': '- { service_name: was-base-service, service_host: 0.0.0.0, service_port: 9060, service_options: [balance leastconn, cookie SRVNAME insert], server_options: maxconn 100 cookie S check }'}) | ||
954 | 48 | d.relate('haproxy:reverseproxy', 'was-base:website') | ||
955 | 49 | d.expose('haproxy') | ||
956 | 50 | d.setup(seconds_to_wait) | ||
957 | 51 | d.sentry.wait(seconds_to_wait) | ||
958 | 52 | cls.d = d | ||
959 | 53 | |||
960 | 56 | def test_deployed(self): | 54 | def test_deployed(self): |
963 | 57 | """ Test to see if the bundle deployed successfully. """ | 55 | self.assertTrue(self.d.deployed) |
962 | 58 | self.assertTrue(self.d.deployed) | ||
964 | 59 | 56 | ||
965 | 60 | def test_website(self): | 57 | def test_website(self): |
969 | 61 | unit = self.d.sentry.unit['was-base/0'] | 58 | unit = self.d.sentry.unit['was-base/0'] |
970 | 62 | url = 'http://%s:9060/ibm/console' % unit.info['public-address'] | 59 | url = 'http://%s:9060/ibm/console' % unit.info['public-address'] |
971 | 63 | response = requests.get(url) | 60 | response = requests.get(url) |
972 | 64 | # Raise an exception if the url was not a valid web page. | 61 | # Raise an exception if the url was not a valid web page. |
975 | 65 | response.raise_for_status() | 62 | response.raise_for_status() |
976 | 66 | 63 | ||
977 | 67 | def test_reverseproxy(self): | 64 | def test_reverseproxy(self): |
986 | 68 | unit = self.d.sentry.unit['haproxy/0'] | 65 | unit = self.d.sentry.unit['haproxy/0'] |
987 | 69 | url = 'http://%s:80/ibm/console' % unit.info['public-address'] | 66 | haproxy_address = unit.info['public-address'] |
988 | 70 | response = requests.get(url) | 67 | haurl = 'http://%s:9060/ibm/console' % haproxy_address |
989 | 71 | # Raise an exception if the url was not a valid web page. | 68 | page = requests.get(haurl) |
990 | 72 | response.raise_for_status() | 69 | # Raise an exception if the url was not a valid web page. |
991 | 73 | 70 | page.raise_for_status() | |
992 | 74 | 71 | print('Successfully got the WAS Base web page through haproxy IP address.') | |
993 | 75 | 72 | ||
994 | 76 | if __name__ == '__main__': | 73 | if __name__ == '__main__': |
995 | 77 | unittest.main() | 74 | unittest.main() |
996 | 78 | 75 | ||
997 | 79 | 76 | ||
998 | === removed file 'tests/local.yaml' | |||
999 | --- tests/local.yaml 2015-07-13 10:13:52 +0000 | |||
1000 | +++ tests/local.yaml 1970-01-01 00:00:00 +0000 | |||
1001 | @@ -1,3 +0,0 @@ | |||
1002 | 1 | wasbase: | ||
1003 | 2 | was_url: "http://9.124.100.99/debs/WAS-BASE" | ||
1004 | 3 | im_file_name: "Install_Mgr_v1.6.2_Lnx_WASv8.5.5.zip" |
Please update as per our - update to host file, relation-changed hook