Merge lp:~ibmcharmers/charms/trusty/was-base/devel into lp:~ibmcharmers/charms/trusty/was-base/trunk
- Trusty Tahr (14.04)
- devel
- Merge into trunk
Proposed by
Geetha S
Status: | Merged |
---|---|
Merged at revision: | 31 |
Proposed branch: | lp:~ibmcharmers/charms/trusty/was-base/devel |
Merge into: | lp:~ibmcharmers/charms/trusty/was-base/trunk |
Diff against target: |
1136 lines (+635/-290) 13 files modified
README.md (+109/-39) config.yaml (+26/-6) copyright (+13/-17) hooks/config-changed (+372/-151) hooks/install (+19/-43) hooks/start (+18/-8) hooks/stop (+14/-7) hooks/website-relation-changed (+3/-0) hooks/website-relation-joined (+12/-0) metadata.yaml (+1/-1) revision (+0/-1) tests/00-setup (+12/-0) tests/10-bundles-test.py (+36/-17) |
To merge this branch: | bzr merge lp:~ibmcharmers/charms/trusty/was-base/devel |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
IBM Charm Authors | Pending | ||
Review via email: mp+266220@code.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'README.md' | |||
2 | --- README.md 2015-04-09 10:32:35 +0000 | |||
3 | +++ README.md 2015-07-29 11:48:27 +0000 | |||
4 | @@ -3,33 +3,37 @@ | |||
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. |
11 | 6 | 6 | Details on IBM Websphere Application Server and WAS Base Prduct Page available [here] [WAS-product-page]. | |
12 | 7 | 7 | ||
13 | 8 | #Creating the repositories | 8 | |
14 | 9 | # Usage | ||
15 | 10 | |||
16 | 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. | ||
17 | 12 | |||
18 | 13 | Download your licensed IBM Websphere Base software 8.5.5.0 version and upload to your apache repository. | ||
19 | 14 | |||
20 | 15 | Download your licensed IBM Websphere Base software WAS fixpack version 8.5.5.4 and upload to your apache repository. | ||
21 | 16 | |||
22 | 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. | ||
23 | 18 | |||
24 | 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. | ||
25 | 20 | |||
26 | 21 | |||
27 | 22 | #Creating the repositories in Apache | ||
28 | 23 | |||
29 | 9 | Run steps below with admin access | 24 | Run steps below with admin access |
30 | 10 | 25 | ||
31 | 11 | Install needed packages | 26 | Install needed packages |
32 | 12 | apt-get install dpkg-dev apache2 | 27 | apt-get install dpkg-dev apache2 |
33 | 13 | 28 | ||
53 | 14 | Create the repository on apache server | 29 | Create the repository on apache server Under your apache repository directory. |
54 | 15 | Under your apache repository directory | 30 | Configure apache server to allow access to the repository. |
55 | 16 | cd <apache-repository-directory> | 31 | |
56 | 17 | Configure apache server to allow access to the repository | 32 | To install IBM Websphere Application Server Base you need to install IBM Installation Manager software as prerequisite. |
57 | 18 | Configure config.yaml with the repository url | 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/). |
58 | 19 | was_url: "http://<server-name>/debs/" | 34 | |
59 | 20 | 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. | |
60 | 21 | # Usage | 36 | |
42 | 22 | Download your licensed IBM Installation Manager software version 1.5 and above and upload to your apache repository | ||
43 | 23 | |||
44 | 24 | Download your licensed IBM Websphere Base software 8.5.5.0 and upload to your apache repository | ||
45 | 25 | |||
46 | 26 | Download your licensed IBM Websphere Base software WAS fixpack version 8.5.5.4 version and upload to your apache repository | ||
47 | 27 | |||
48 | 28 | For WAS 8.5.5.0 Download refer : http://www-01.ibm.com/support/docview.wss?uid=swg27038625 | ||
49 | 29 | for WAS 8.5.5.4 fixpack download refer : http://www-01.ibm.com/support/docview.wss?uid=swg24038539 link | ||
50 | 30 | |||
51 | 31 | To download and install the code contained in this charm you must agree to the | ||
52 | 32 | IBM license. The license file(s) can be found in the product binaries you downloaded. | ||
61 | 33 | 37 | ||
62 | 34 | Run the following to deploy this charm: | 38 | Run the following to deploy this charm: |
63 | 35 | 39 | ||
64 | @@ -38,23 +42,20 @@ | |||
65 | 38 | At this point the charm will wait until the user accepts the license. If you | 42 | At this point the charm will wait until the user accepts the license. If you |
66 | 39 | agree to the license, run the following command: | 43 | agree to the license, run the following command: |
67 | 40 | 44 | ||
73 | 41 | juju set was-base accept-ibm-im-license=True | 45 | If the was_url and im_filename is configured in the config.yaml: |
74 | 42 | juju set was-base accept-ibm-websphere-license=True | 46 | |
75 | 43 | 47 | juju set was-base accept-ibm-im-license=True accept-ibm-websphere-license=True | |
76 | 44 | 48 | ||
77 | 45 | You can then browse to http://ip-address:9060 to view WAS Console. | 49 | If not, |
78 | 50 | |||
79 | 51 | juju set was-base accept-ibm-im-license=True accept-ibm-websphere-license=True was_url=<Web server URL> im_file_name=<IM package name> im_install_path=<IM Installation Path> | ||
80 | 52 | |||
81 | 53 | |||
82 | 54 | You can then browse to "http://was-base unit's ip-address:9060/ibm/cinsole" to view WAS Console. | ||
83 | 55 | |||
84 | 46 | 56 | ||
85 | 47 | # Configuration | 57 | # Configuration |
86 | 48 | 58 | ||
87 | 49 | `was_url` | ||
88 | 50 | Apache Repository URL where WAS packages are placed | ||
89 | 51 | |||
90 | 52 | `im_install_path` | ||
91 | 53 | Installation Manager Installation Path | ||
92 | 54 | |||
93 | 55 | `im_file_name` | ||
94 | 56 | Installation Manager Package Name | ||
95 | 57 | |||
96 | 58 | `accept-ibm-im-license` | 59 | `accept-ibm-im-license` |
97 | 59 | The IBM Installation Manager software comes with special terms and conditions from IBM. | 60 | The IBM Installation Manager software comes with special terms and conditions from IBM. |
98 | 60 | The IBM Installation Manager software can only be used by accepting the terms and | 61 | The IBM Installation Manager software can only be used by accepting the terms and |
99 | @@ -70,13 +71,82 @@ | |||
100 | 70 | Agreement for Non-Warranted Programs and additional license information. | 71 | Agreement for Non-Warranted Programs and additional license information. |
101 | 71 | Please read the license agreement carefully. | 72 | Please read the license agreement carefully. |
102 | 72 | 73 | ||
105 | 73 | The license file can be found in the root directory of the charm source | 74 | Check the Usage section on getting the license agreement. |
104 | 74 | in the IBM-WebSphere-license.txt file | ||
106 | 75 | 75 | ||
107 | 76 | **The WebSphere software cannot be installed until the terms and | 76 | **The WebSphere software cannot be installed until the terms and |
108 | 77 | contions are accepted. The charm will not function correctly until the | 77 | contions are accepted. The charm will not function correctly until the |
109 | 78 | this configuration option is set to True.** | 78 | this configuration option is set to True.** |
110 | 79 | 79 | ||
112 | 80 | # Contact Information | 80 | `was_url` |
113 | 81 | The web server URL from which IBM IM, IBM WAS Base and fixpack packages can be downloaded. | ||
114 | 82 | |||
115 | 83 | `im_install_path` | ||
116 | 84 | Install Location for Installation Manager. Ex : "/opt/IBM/InstallationManager". Here IM will install at this location, It can be changed if IM needs to be installed at some other place. | ||
117 | 85 | |||
118 | 86 | |||
119 | 87 | `im_file_name` | ||
120 | 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. | ||
121 | 89 | |||
122 | 90 | `sha_im` | ||
123 | 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. | ||
124 | 92 | |||
125 | 93 | #IBM WAS Base Information | ||
126 | 94 | |||
127 | 95 | (1) General Information | ||
128 | 96 | Information on IBM WAS available [here] [WAS-Infocenter] | ||
129 | 97 | |||
130 | 98 | (2) Download Information | ||
131 | 99 | |||
132 | 100 | Downloadable Package Names for 'x86_64' based machine: | ||
133 | 101 | WAS_V8.5.5_1_OF_3.zip | ||
134 | 102 | WAS_V8.5.5_2_OF_3.zip | ||
135 | 103 | WAS_V8.5.5_3_OF_3.zip | ||
136 | 104 | 8.5.5-WS-WAS-FP0000004-part1.zip | ||
137 | 105 | 8.5.5-WS-WAS-FP0000004-part2.zip | ||
138 | 106 | |||
139 | 107 | Downloadable Package Names for 'ppc64le' based machine: | ||
140 | 108 | WAS_V8.5.5_FOR_POWERLE_ML.zip | ||
141 | 109 | WAS_V8.5.5_2_OF_2_FOR_POWERLE_ML.zip | ||
142 | 110 | 8.5.5-WS-WAS-LE-FP0000006-part1.zip | ||
143 | 111 | 8.5.5-WS-WAS-LE-FP0000006-part2.zip | ||
144 | 112 | |||
145 | 113 | Information on procuring WAS product is available at the [Passport Advantage site] [Passport-Advantage] | ||
146 | 114 | |||
147 | 115 | Details about WAS 8.5.5.0 download available [here] [[WAS-8.5.5.0-download] | ||
148 | 116 | |||
149 | 117 | Information about insatllation of WAS Base on 'ppc64le' based machine available [here] [WAS-for-ppc64le] | ||
150 | 118 | |||
151 | 119 | Details about WAS 8.5.5.4 fixpack download available [here] [WAS-8.5.5.4-fixpack-download]. | ||
152 | 120 | |||
153 | 121 | A trial version is available [here] [WAS-trail-version]. | ||
154 | 122 | |||
155 | 123 | More information about IBM IM Downloadable file available [here] [IBM-IM-more-info] | ||
156 | 124 | |||
157 | 125 | (3) Contact Information | ||
158 | 81 | 126 | ||
159 | 82 | For issues with this charm, please contact jujusupp@us.ibm.com | 127 | For issues with this charm, please contact jujusupp@us.ibm.com |
160 | 128 | |||
161 | 129 | <!-- Links --> | ||
162 | 130 | |||
163 | 131 | [WAS-Infocenter]: http://www-01.ibm.com/support/knowledgecenter/SSAW57_8.5.5/as_ditamaps/was855_welcome_ndmp.html?lang=en | ||
164 | 132 | |||
165 | 133 | [WAS-product-page]: http://www-03.ibm.com/software/products/en/appserv-was | ||
166 | 134 | |||
167 | 135 | [WAS-8.5.5.0-download]: http://www-01.ibm.com/support/docview.wss?uid=swg27038625 | ||
168 | 136 | |||
169 | 137 | [WAS-8.5.5.4-fixpack-download]: http://www-01.ibm.com/support/docview.wss?uid=swg24038539 | ||
170 | 138 | |||
171 | 139 | [WAS-trail-version]: http://www.ibm.com/developerworks/downloads/ws/was/index.html | ||
172 | 140 | |||
173 | 141 | [Passport-Advantage]: http://www-01.ibm.com/software/passportadvantage/ | ||
174 | 142 | |||
175 | 143 | [IBM-IM-more-info]: http://www-01.ibm.com/support/docview.wss?uid=swg24038380 | ||
176 | 144 | |||
177 | 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 | ||
178 | 146 | |||
179 | 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 | ||
180 | 148 | |||
181 | 149 | [WAS-ppc64le-fixpack-info]: http://www-01.ibm.com/support/docview.wss?uid=swg24040035 | ||
182 | 150 | |||
183 | 151 | [License]: http://www-03.ibm.com/software/sla/sladb.nsf/search | ||
184 | 152 | |||
185 | 83 | 153 | ||
186 | === modified file 'config.yaml' | |||
187 | --- config.yaml 2015-05-05 08:37:15 +0000 | |||
188 | +++ config.yaml 2015-07-29 11:48:27 +0000 | |||
189 | @@ -2,26 +2,46 @@ | |||
190 | 2 | was_url: | 2 | was_url: |
191 | 3 | type: string | 3 | type: string |
192 | 4 | default: "" | 4 | default: "" |
194 | 5 | description: "Download url for WAS packages" | 5 | description: | |
195 | 6 | Download url for WAS Base packages, This is the URL containing WAS Base packages, | ||
196 | 7 | mention till the folder which contains packages ex: http://<ip-address>/debs/WAS-BASE/. | ||
197 | 6 | im_install_path: | 8 | im_install_path: |
198 | 7 | type: string | 9 | type: string |
199 | 8 | default: "/opt/IBM/InstallationManager" | 10 | default: "/opt/IBM/InstallationManager" |
201 | 9 | description: "Install Location for Installation Manager.Can be changed if IM needs to be installed at some other place" | 11 | description: | |
202 | 12 | Install Location for Installation Manager.Please enter the path | ||
203 | 13 | where you wants to install Install Manager ex : /opt/IBM/InstallationManager | ||
204 | 14 | here IM will install at this location, It can be changed if IM needs to be installed at some other place. | ||
205 | 10 | im_file_name: | 15 | im_file_name: |
206 | 11 | type: string | 16 | type: string |
209 | 12 | default: Install_Mgr_v1.6.2_Lnx_WASv8.5.5.zip | 17 | default: "" |
210 | 13 | description: "Installation Manager installable Name" | 18 | description: | |
211 | 19 | Name of the IBM IM package. If not set, the Charm uses a predefined | ||
212 | 20 | package name for download from the url location. If the predefined | ||
213 | 21 | package is not available at url location or if set incorrectly, | ||
214 | 22 | the charm cannot install the IBM IM software. | ||
215 | 14 | accept-ibm-websphere-license: | 23 | accept-ibm-websphere-license: |
216 | 15 | type: boolean | 24 | type: boolean |
217 | 16 | default: False | 25 | default: False |
218 | 17 | description: | | 26 | description: | |
219 | 18 | The IBM WebSphere Application Server software comes with special terms and | 27 | The IBM WebSphere Application Server software comes with special terms and |
220 | 19 | conditions from IBM. The WebSphere software can only be used by | 28 | conditions from IBM. The WebSphere software can only be used by |
222 | 20 | accepting the license terms and conditions. | 29 | accepting the license terms and conditions. It should be set to "True" to install |
223 | 30 | the Websphere Application Server software. | ||
224 | 21 | accept-ibm-im-license: | 31 | accept-ibm-im-license: |
225 | 22 | type: boolean | 32 | type: boolean |
226 | 23 | default: False | 33 | default: False |
227 | 24 | description: | | 34 | description: | |
228 | 25 | The IBM Installation Manager software comes with special terms and | 35 | The IBM Installation Manager software comes with special terms and |
229 | 26 | 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 |
231 | 27 | accepting the license terms and conditions. | 37 | accepting the license terms and conditions. It should be set to "True" to install |
232 | 38 | the IBM Installation Manager software. | ||
233 | 39 | sha_im: | ||
234 | 40 | type: string | ||
235 | 41 | default: "" | ||
236 | 42 | description: | | ||
237 | 43 | Checksum value to check integrity of IBM IM package. The Charm uses | ||
238 | 44 | sha1sum to check the integrity. For example, run the command: | ||
239 | 45 | <sha1sum Install_Mgr_v1.6.2_Lnx_WASv8.5.5.zip | cut -d " " -f1> | ||
240 | 46 | to get the checksum value for IBM Installation Manager pacakage. | ||
241 | 47 | If empty, it does not carry out the integrity check. | ||
242 | 28 | 48 | ||
243 | === modified file 'copyright' | |||
244 | --- copyright 2015-04-09 10:32:35 +0000 | |||
245 | +++ copyright 2015-07-29 11:48:27 +0000 | |||
246 | @@ -1,17 +1,13 @@ | |||
264 | 1 | Format: http://dep.debian.net/deps/dep5/ | 1 | Copyright 2015 IBM Corporation |
265 | 2 | 2 | ||
266 | 3 | Files: * | 3 | This Charm is licensed under the Apache License, Version 2.0 (the "License"); |
267 | 4 | Copyright: Copyright 2014, Canonical Ltd., All Rights Reserved. | 4 | you may not use this file except in compliance with the License. |
268 | 5 | License: GPL-3 | 5 | You may obtain a copy of the License at |
269 | 6 | This program is free software: you can redistribute it and/or modify | 6 | |
270 | 7 | it under the terms of the GNU General Public License as published by | 7 | http://www.apache.org/licenses/LICENSE-2.0 |
271 | 8 | the Free Software Foundation, either version 3 of the License, or | 8 | |
272 | 9 | (at your option) any later version. | 9 | Unless required by applicable law or agreed to in writing, software |
273 | 10 | . | 10 | distributed under the License is distributed on an "AS IS" BASIS, |
274 | 11 | This program is distributed in the hope that it will be useful, | 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
275 | 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 12 | See the License for the specific language governing permissions and |
276 | 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 13 | limitations under the License. |
260 | 14 | GNU General Public License for more details. | ||
261 | 15 | . | ||
262 | 16 | You should have received a copy of the GNU General Public License | ||
263 | 17 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
277 | 18 | 14 | ||
278 | === modified file 'hooks/config-changed' | |||
279 | --- hooks/config-changed 2015-04-09 10:32:35 +0000 | |||
280 | +++ hooks/config-changed 2015-07-29 11:48:27 +0000 | |||
281 | @@ -1,17 +1,18 @@ | |||
282 | 1 | #!/bin/bash | 1 | #!/bin/bash |
283 | 2 | # config-changed occurs everytime a new configuration value is updated (juju set) | 2 | # config-changed occurs everytime a new configuration value is updated (juju set) |
284 | 3 | |||
285 | 4 | set -e | 3 | set -e |
286 | 5 | 4 | ||
287 | 6 | WAS_BASE_INSTALL_PATH=/root/IBM/WebSphere/AppServer/V85/BASE | 5 | WAS_BASE_INSTALL_PATH=/root/IBM/WebSphere/AppServer/V85/BASE |
288 | 6 | ARCHIVE_DIR=files/archives | ||
289 | 7 | |||
290 | 7 | # Check whether IM is installed | 8 | # Check whether IM is installed |
291 | 8 | is_im_installed() | 9 | is_im_installed() |
292 | 9 | { | 10 | { |
298 | 10 | if [ -f $IM_INSTALL_PATH/eclipse/IBMIM ]; then | 11 | if [ -f $IM_INSTALL_PATH/eclipse/IBMIM ]; then |
299 | 11 | echo "True" | 12 | echo "True" |
300 | 12 | else | 13 | else |
301 | 13 | echo "False" | 14 | echo "False" |
302 | 14 | fi | 15 | fi |
303 | 15 | 16 | ||
304 | 16 | } | 17 | } |
305 | 17 | 18 | ||
306 | @@ -19,11 +20,11 @@ | |||
307 | 19 | # Check whether WAS BASE is installed | 20 | # Check whether WAS BASE is installed |
308 | 20 | is_was_base_installed() | 21 | is_was_base_installed() |
309 | 21 | { | 22 | { |
315 | 22 | if [ -d $WAS_BASE_INSTALL_PATH/bin ]; then | 23 | if [ -d $WAS_BASE_INSTALL_PATH/bin ]; then |
316 | 23 | echo "True" | 24 | echo "True" |
317 | 24 | else | 25 | else |
318 | 25 | echo "False" | 26 | echo "False" |
319 | 26 | fi | 27 | fi |
320 | 27 | 28 | ||
321 | 28 | } | 29 | } |
322 | 29 | 30 | ||
323 | @@ -32,27 +33,42 @@ | |||
324 | 32 | remove_was_base_software() | 33 | remove_was_base_software() |
325 | 33 | { | 34 | { |
326 | 34 | 35 | ||
335 | 35 | was_base_installed=`is_was_base_installed` | 36 | was_base_installed=`is_was_base_installed` |
336 | 36 | if [ $was_base_installed == True ]; then | 37 | if [ $was_base_installed == True ]; then |
337 | 37 | juju-log "Removing WAS BASE Installation" | 38 | juju-log "IBM WAS Base: Removing WAS BASE Installation" |
338 | 38 | # Uninstalling WAS BASE | 39 | juju-log "IBM WAS Base: Server stopping" |
339 | 39 | cd $IM_INSTALL_PATH/eclipse/tools | 40 | $WAS_BASE_INSTALL_PATH/profiles/test/bin/stopServer.sh server1 |
340 | 40 | sudo ./imcl uninstall com.ibm.websphere.liberty.BASE.v85 -installationDirectory $WAS_BASE_INSTALL_PATH | 41 | if [ "$?" -ne "0" ]; then |
341 | 41 | fi | 42 | juju-log "IBM WAS Base: Error while stopping the server" |
342 | 42 | juju-log "Uninstalling WAS BASE software completed" | 43 | else |
343 | 44 | juju-log "IBM WAS Base: Server stopped successfully" | ||
344 | 45 | fi | ||
345 | 46 | |||
346 | 47 | # Uninstalling WAS BASE | ||
347 | 48 | $IM_INSTALL_PATH/eclipse/tools/imcl uninstall com.ibm.websphere.BASE.v85 -installationDirectory $WAS_BASE_INSTALL_PATH | ||
348 | 49 | if [ -d /root/IBM/WebSphere/AppServer/V85/BASE ]; then | ||
349 | 50 | juju-log "IBM WAS Base: Removing installation directory" | ||
350 | 51 | cd /root | ||
351 | 52 | rm -rf IBM/WebSphere/AppServer/V85/BASE | ||
352 | 53 | else | ||
353 | 54 | juju-log "IBM WAS Base: Installation directory does not exist" | ||
354 | 55 | fi | ||
355 | 56 | juju-log "IBM WAS Base: Uninstalling WAS Base software completed" | ||
356 | 57 | |||
357 | 58 | else | ||
358 | 59 | juju-log "IBM WAS Base: WAS Base software has not been installed." | ||
359 | 60 | fi | ||
360 | 43 | } | 61 | } |
361 | 44 | 62 | ||
362 | 45 | #Remove IM, if installed | 63 | #Remove IM, if installed |
363 | 46 | remove_im_software() | 64 | remove_im_software() |
364 | 47 | { | 65 | { |
373 | 48 | 66 | im_installed=`is_im_installed` | |
374 | 49 | im_installed=`is_im_installed` | 67 | if [ $im_installed == True ]; then |
375 | 50 | if [ $im_installed == True ]; then | 68 | juju-log "IBM WAS Base: Removing IBM IM software." |
376 | 51 | juju-log "Removing IBM WebSphere IM software." | 69 | /root/var/ibm/InstallationManager/uninstall/uninstallc |
377 | 52 | cd /root/var/ibm/InstallationManager/uninstall | 70 | juju-log "IBM WAS Base: Removed IBM IM software" |
378 | 53 | #Uninstalling IM | 71 | fi |
371 | 54 | ./uninstall --launcher.ini user-silent-uninstall.ini | ||
372 | 55 | fi | ||
379 | 56 | 72 | ||
380 | 57 | } | 73 | } |
381 | 58 | 74 | ||
382 | @@ -60,145 +76,350 @@ | |||
383 | 60 | remove_unaccepted_software() | 76 | remove_unaccepted_software() |
384 | 61 | { | 77 | { |
385 | 62 | 78 | ||
416 | 63 | if [ $1 == False ]; then | 79 | if [ $1 == False ]; then |
417 | 64 | juju-log "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." |
418 | 65 | if [ -f $IM_INSTALL_PATH/eclipse/IBMIM ]; then | 81 | if [ -f $IM_INSTALL_PATH/eclipse/IBMIM ]; then |
419 | 66 | juju-log "IM exists " | 82 | juju-log "IBM WAS Base: IBM IM exists " |
420 | 67 | remove_was_base_software | 83 | remove_was_base_software |
421 | 68 | else | 84 | else |
422 | 69 | juju-log "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" |
423 | 70 | exit 0 | 86 | exit 0 |
424 | 71 | fi | 87 | fi |
425 | 72 | fi | 88 | fi |
426 | 73 | 89 | if [ $2 == False ]; then | |
427 | 74 | 90 | juju-log "IBM WAS Base: Removing IBM IM (if installed) as the license agreement is not accepted." | |
428 | 75 | if [ $2 == False ]; then | 91 | |
429 | 76 | juju-log "Removing IBM IM (if installed) as the license agreement is not accepted." | 92 | #Check any dependent products exists like WAS |
430 | 77 | 93 | ||
431 | 78 | #Check any dependent products exists like WAS | 94 | if [ -d $WAS_BASE_INSTALL_PATH/bin ]; then |
432 | 79 | 95 | juju-log "IBM WAS Base: Can not uninstall IM as it has WAS product installed" | |
433 | 80 | if [ -d $WAS_BASE_INSTALL_PATH/bin ]; then | 96 | exit 0 |
434 | 81 | juju-log "Can not uninstall IM as its has WAS product installed" | 97 | else |
435 | 82 | exit 0 | 98 | juju-log "IBM WAS Base: Uninstall IBM IM software" |
436 | 83 | else | 99 | remove_im_software |
437 | 84 | juju-log "Uninstall IM software" | 100 | fi |
438 | 85 | remove_im_software | 101 | fi |
439 | 86 | fi | 102 | |
440 | 87 | fi | 103 | } |
441 | 88 | 104 | ||
442 | 89 | } | 105 | # Download IM Package |
443 | 90 | 106 | ||
444 | 91 | 107 | download_IM(){ | |
445 | 92 | juju-log "Websphere WAS BASE: Begin config-change hook" | 108 | #Exit if URL to download package is null |
446 | 109 | if [ "$WAS_URL" == "" ]; then | ||
447 | 110 | juju-log "IBM WAS Base: URL to download IBM WAS Base package is not configured." | ||
448 | 111 | exit 0 | ||
449 | 112 | fi | ||
450 | 113 | |||
451 | 114 | # If an install IM done, get the name of the package from which it was done | ||
452 | 115 | if [ -f $CHARM_DIR/$ARCHIVE_DIR/IM/*.zip ]; then | ||
453 | 116 | im_pkg_name=`ls $CHARM_DIR/$ARCHIVE_DIR/IM/*.zip` | ||
454 | 117 | if [ $? == 0 ]; then | ||
455 | 118 | im_pkg_name=`basename $im_pkg_name` | ||
456 | 119 | fi | ||
457 | 120 | fi | ||
458 | 121 | |||
459 | 122 | # Get the package name to check whether the user wants to install a different package | ||
460 | 123 | cfg_im_pkg_name=$im_file_name | ||
461 | 124 | |||
462 | 125 | # Set package name to a predefined value if the user has not provided a package name | ||
463 | 126 | if [ "$cfg_im_pkg_name" == "" ]; then | ||
464 | 127 | if [ "$ARCHITECTURE" = "x86_64" ]; then | ||
465 | 128 | cfg_im_pkg_name="Install_Mgr_v1.6.2_Lnx_WASv8.5.5.zip" | ||
466 | 129 | elif [ "$ARCHITECTURE" = "ppc64le" ]; then | ||
467 | 130 | cfg_im_pkg_name="agent.installer.linux.gtk.ppc64le_1.8.1000.20141126_2002.zip" | ||
468 | 131 | else | ||
469 | 132 | juju-log "IBM WAS Base: Platform not supported for IM." | ||
470 | 133 | exit 1 | ||
471 | 134 | fi | ||
472 | 135 | fi | ||
473 | 136 | |||
474 | 137 | # The user has configured a different package name | ||
475 | 138 | if [ "$im_pkg_name" != "$cfg_im_pkg_name" ]; then | ||
476 | 139 | set +e | ||
477 | 140 | #previously downloaded and installed IM software | ||
478 | 141 | if [ "$im_pkg_name" != "" ]; then | ||
479 | 142 | juju-log "IBM WAS Base: Deleting the older IM package." | ||
480 | 143 | rm -rf $CHARM_DIR/$ARCHIVE_DIR/IM | ||
481 | 144 | remove_was_base_software | ||
482 | 145 | remove_im_software | ||
483 | 146 | fi | ||
484 | 147 | #Download the new IM package | ||
485 | 148 | juju-log "IBM WAS Base: Downloading IM package." | ||
486 | 149 | wget -t 2 -P $CHARM_DIR/$ARCHIVE_DIR/IM $WAS_URL/$cfg_im_pkg_name | ||
487 | 150 | if [ $? == 0 ]; then | ||
488 | 151 | juju-log "IBM WAS Base: Downloaded IM package." | ||
489 | 152 | else | ||
490 | 153 | juju-log "IBM WAS Base: Download of IM package failed." | ||
491 | 154 | juju-log "IBM WAS Base: Ensure the download URL and package name are correctly set in the charm configuration." | ||
492 | 155 | exit 0 | ||
493 | 156 | fi | ||
494 | 157 | set -e | ||
495 | 158 | fi | ||
496 | 159 | |||
497 | 160 | # Check integrity of downloaded package | ||
498 | 161 | SHA_IM=`config-get sha_im` | ||
499 | 162 | if [ "$SHA_IM" == "" ]; then | ||
500 | 163 | juju-log "IBM WAS Base: Ignored integrity check for IM package as sha_im checksum is null." | ||
501 | 164 | elif [ "$SHA_IM" != "`sha1sum $ARCHIVE_DIR/IM/$cfg_im_pkg_name | cut -d" " -f1`" ]; then | ||
502 | 165 | juju-log "IBM WAS Base: IBM IM package is corrupt." | ||
503 | 166 | exit 0 | ||
504 | 167 | fi | ||
505 | 168 | } | ||
506 | 169 | |||
507 | 170 | #download WAS-Base | ||
508 | 171 | |||
509 | 172 | download_WAS() | ||
510 | 173 | { | ||
511 | 174 | #Exit if URL to download package is null | ||
512 | 175 | if [ "$WAS_URL" == "" ]; then | ||
513 | 176 | juju-log "IBM WAS Base: URL to download IBM WAS Base package is not configured." | ||
514 | 177 | exit 0 | ||
515 | 178 | else | ||
516 | 179 | juju-log "Downloading WAS Base Packages" | ||
517 | 180 | was_base_pkg1="WAS_V8.5.5_1_OF_3.zip" | ||
518 | 181 | was_base_pkg2="WAS_V8.5.5_2_OF_3.zip" | ||
519 | 182 | was_base_pkg3="WAS_V8.5.5_3_OF_3.zip" | ||
520 | 183 | was_base_fixpack1="8.5.5-WS-WAS-FP0000004-part1.zip" | ||
521 | 184 | was_base_fixpack2="8.5.5-WS-WAS-FP0000004-part2.zip" | ||
522 | 185 | was_base_ppc64le_pkg1="WAS_V8.5.5_FOR_POWERLE_ML.zip" | ||
523 | 186 | was_base_ppc64le_pkg2="WAS_V8.5.5_2_OF_2_FOR_POWERLE_ML.zip" | ||
524 | 187 | was_base_ppc64le_fixpack1="8.5.5-WS-WAS-LE-FP0000006-part1.zip" | ||
525 | 188 | was_base_ppc64le_fixpack2="8.5.5-WS-WAS-LE-FP0000006-part2.zip" | ||
526 | 189 | |||
527 | 190 | if [ "$ARCHITECTURE" == "x86_64" ];then | ||
528 | 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 | ||
529 | 192 | juju-log " IBM WAS Base:Installing WAS Base, Downloaded packages already exists in archive directory." | ||
530 | 193 | else | ||
531 | 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 | ||
532 | 195 | if [ $? == 0 ]; then | ||
533 | 196 | juju-log "IBM WAS Base: Downloaded WAS Base packages successfully" | ||
534 | 197 | fi | ||
535 | 198 | fi | ||
536 | 199 | elif [ "$ARCHITECTURE" == "ppc64le" ];then | ||
537 | 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 | ||
538 | 201 | juju-log " IBM WAS Base:Installing WAS Base, Downloaded packages already exists in archive directory." | ||
539 | 202 | else | ||
540 | 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 | ||
541 | 204 | if [ $? == 0 ]; then | ||
542 | 205 | juju-log "IBM WAS Base: Downloaded WAS Base packages successfully" | ||
543 | 206 | fi | ||
544 | 207 | fi | ||
545 | 208 | |||
546 | 209 | fi | ||
547 | 210 | fi | ||
548 | 211 | |||
549 | 212 | # Check integrity of downloaded package | ||
550 | 213 | if [ "$ARCHITECTURE" == "x86_64" ];then | ||
551 | 214 | if [ "b9cc0b783b482de2092d5c387de05cda2e922413" != "`sha1sum $CHARM_DIR/$ARCHIVE_DIR/$was_base_pkg1 | cut -d" " -f1`" ]; then | ||
552 | 215 | juju-log "IBM WAS Base: IBM WAS package1 is corrupt." | ||
553 | 216 | exit 0 | ||
554 | 217 | fi | ||
555 | 218 | if [ "74a52b1b5aaedd67c0727db90aff9dc63ff28f4e" != "`sha1sum $CHARM_DIR/$ARCHIVE_DIR/$was_base_pkg2 | cut -d" " -f1`" ]; then | ||
556 | 219 | juju-log "IBM WAS Base: IBM WAS package2 is corrupt." | ||
557 | 220 | exit 0 | ||
558 | 221 | fi | ||
559 | 222 | if [ "e6943fa4a4a7a1384fad1faa54289106f0e57979" != "`sha1sum $CHARM_DIR/$ARCHIVE_DIR/$was_base_pkg3 | cut -d" " -f1`" ]; then | ||
560 | 223 | juju-log "IBM WAS Base: IBM WAS package3 is corrupt." | ||
561 | 224 | exit 0 | ||
562 | 225 | fi | ||
563 | 226 | if [ "895863b932334a78cccce6c73ec98d35ba98639b" != "`sha1sum $CHARM_DIR/$ARCHIVE_DIR/$was_base_fixpack1 | cut -d" " -f1`" ]; then | ||
564 | 227 | juju-log "IBM WAS Base: IBM WAS Fix Pack part1 is corrupt." | ||
565 | 228 | exit 0 | ||
566 | 229 | fi | ||
567 | 230 | if [ "8f8560746c6fb0f87cd47801a014e7c34fccc4cc" != "`sha1sum $CHARM_DIR/$ARCHIVE_DIR/$was_base_fixpack2 | cut -d" " -f1`" ]; then | ||
568 | 231 | juju-log "IBM WAS Base: IBM WAS Fix Pack part2 is corrupt." | ||
569 | 232 | exit 0 | ||
570 | 233 | fi | ||
571 | 234 | elif [ "$ARCHITECTURE" == "ppc64le" ];then | ||
572 | 235 | if [ "62cc5a2d23a2ff828d2b4dcd9ac754b3ff994292" != "`sha1sum $CHARM_DIR/$ARCHIVE_DIR/$was_base_ppc64le_pkg1 | cut -d" " -f1`" ]; then | ||
573 | 236 | juju-log "IBM WAS Base: IBM WAS package1 is corrupt." | ||
574 | 237 | exit 0 | ||
575 | 238 | fi | ||
576 | 239 | if [ "bc475ccd6f918bf858ccbb48d82e5adc2c7b3fa9" != "`sha1sum $CHARM_DIR/$ARCHIVE_DIR/$was_base_ppc64le_pkg2 | cut -d" " -f1`" ]; then | ||
577 | 240 | juju-log "IBM WAS Base: IBM WAS package2 is corrupt." | ||
578 | 241 | exit 0 | ||
579 | 242 | fi | ||
580 | 243 | if [ "c0f38a16b87b7e6e7c5c0f609fb3c1a61a3b7e8e" != "`sha1sum $CHARM_DIR/$ARCHIVE_DIR/$was_base_ppc64le_fixpack1 | cut -d" " -f1`" ]; then | ||
581 | 244 | juju-log "IBM WAS Base: IBM WAS Fix Pack part1 is corrupt." | ||
582 | 245 | exit 0 | ||
583 | 246 | fi | ||
584 | 247 | if [ "c8fe75b915fa2ecd183af208eff7df0464342ff8" != "`sha1sum $CHARM_DIR/$ARCHIVE_DIR/$was_base_ppc64le_fixpack2 | cut -d" " -f1`" ]; then | ||
585 | 248 | juju-log "IBM WAS Base: IBM WAS Fix Pack part2 is corrupt." | ||
586 | 249 | exit 0 | ||
587 | 250 | fi | ||
588 | 251 | fi | ||
589 | 252 | |||
590 | 253 | } | ||
591 | 254 | |||
592 | 255 | |||
593 | 256 | juju-log "IBM WAS BASE: Begin config-change hook" | ||
594 | 93 | was_base_license_accepted=`config-get accept-ibm-websphere-license` | 257 | was_base_license_accepted=`config-get accept-ibm-websphere-license` |
595 | 94 | im_license_accepted=`config-get accept-ibm-im-license` | 258 | im_license_accepted=`config-get accept-ibm-im-license` |
596 | 95 | IM_INSTALL_PATH=`config-get im_install_path` | 259 | IM_INSTALL_PATH=`config-get im_install_path` |
597 | 260 | WAS_URL=`config-get was_url` | ||
598 | 261 | im_file_name=`config-get im_file_name` | ||
599 | 262 | ARCHITECTURE=`uname -m` | ||
600 | 96 | 263 | ||
601 | 97 | # 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 |
602 | 98 | remove_unaccepted_software $was_base_license_accepted $im_license_accepted | 265 | remove_unaccepted_software $was_base_license_accepted $im_license_accepted |
603 | 99 | if [ $im_license_accepted == False ]; then | 266 | if [ $im_license_accepted == False ]; then |
605 | 100 | juju-log "Websphere IM License not accepted." | 267 | juju-log "IBM WAS Base: Websphere IM License not accepted." |
606 | 101 | 268 | ||
607 | 102 | elif [ $im_license_accepted == True ]; then | 269 | elif [ $im_license_accepted == True ]; then |
635 | 103 | 270 | juju-log "IBM WAS Base: IBM IM License accepted" | |
636 | 104 | juju-log "License accepted" | 271 | download_IM |
637 | 105 | im_inst=`is_im_installed` | 272 | im_inst=`is_im_installed` |
638 | 106 | if [ $im_inst == False ]; then | 273 | if [ $im_inst == False ]; then |
639 | 107 | juju-log "IM installation start" | 274 | if [ -f $CHARM_DIR/$ARCHIVE_DIR/IM/*.zip ]; then |
640 | 108 | # Check IM package availability | 275 | juju-log "IBM WAS Base: downloading and extracting IM packages" |
641 | 109 | juju-log $CHARM_DIR | 276 | if [ -f $CHARM_DIR/$ARCHIVE_DIR/IM/userinstc ]; then |
642 | 110 | if [ -f $CHARM_DIR/files/archives/IM/userinstc ]; | 277 | juju-log "IBM WAS Base: IBM IM package contents extracted already." |
643 | 111 | then | 278 | else |
644 | 112 | juju-log "IM Packages available for installation."; | 279 | unzip $CHARM_DIR/$ARCHIVE_DIR/IM/*.zip -d $CHARM_DIR/$ARCHIVE_DIR/IM |
645 | 113 | cp $CHARM_DIR/files/archives/IM/install.xml $CHARM_DIR/files/archives/IM/silent_install.xml | 280 | if [ $? != 0 ]; then |
646 | 114 | 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/files/archives/IM/silent_install.xml | 281 | juju-log "IBM WAS Base: Unable to extract the IM package content. Verify whether the package is corrupt." |
647 | 115 | $CHARM_DIR/files/archives/IM/userinstc -input $CHARM_DIR/files/archives/IM/silent_install.xml -acceptlicense | 282 | # Remove corrupt archive file |
648 | 116 | if [ $? == 0 ] | 283 | rm -f $CHARM_DIR/$ARCHIVE_DIR/IM/*.zip |
649 | 117 | then | 284 | exit 0 |
650 | 118 | juju-log "IM Is installed successfully" | 285 | fi |
651 | 119 | else | 286 | fi |
652 | 120 | juju-log "Error while installing IM" | 287 | fi |
653 | 121 | exit 1 | 288 | juju-log "IBM WAS Base: IM installation start" |
654 | 122 | fi | 289 | # Check IM package availability |
655 | 123 | 290 | juju-log $CHARM_DIR/$ARCHIVE_DIR | |
656 | 124 | else | 291 | if [ -f $CHARM_DIR/$ARCHIVE_DIR/IM/userinstc ]; |
657 | 125 | juju-log "IM Packages missing. Please check README file."; | 292 | then |
658 | 126 | juju-log "Upgrade IM charm after adding the IM packages"; | 293 | |
659 | 127 | exit 1 | 294 | juju-log "IBM WAS Base: IM Packages available for installation." |
660 | 128 | fi | 295 | cp $CHARM_DIR/$ARCHIVE_DIR/IM/install.xml $CHARM_DIR/$ARCHIVE_DIR/IM/silent_install.xml |
661 | 129 | fi | 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 |
662 | 297 | $CHARM_DIR/$ARCHIVE_DIR/IM/userinstc -input $CHARM_DIR/$ARCHIVE_DIR/IM/silent_install.xml -acceptlicense | ||
663 | 298 | if [ $? == 0 ] | ||
664 | 299 | then | ||
665 | 300 | juju-log "IBM WAS Base: IM Is installed successfully" | ||
666 | 301 | else | ||
667 | 302 | juju-log "IBM WAS Base: Error while installing IM" | ||
668 | 303 | exit 1 | ||
669 | 304 | fi | ||
670 | 305 | |||
671 | 306 | else | ||
672 | 307 | juju-log "IBM WAS Base: IM Packages missing. Please check README file" | ||
673 | 308 | juju-log "IBM WAS Base: Upgrade IM charm after adding the IM packages"; | ||
674 | 309 | exit 1 | ||
675 | 310 | fi | ||
676 | 311 | else | ||
677 | 312 | juju-log "IBM WAS Base: IBM IM Installed already using same package name." | ||
678 | 313 | fi | ||
679 | 130 | else | 314 | else |
681 | 131 | juju-log " Acceptable values for license is 'True' or 'False'" | 315 | juju-log " IBM WAS Base: Acceptable values for license is 'True' or 'False'" |
682 | 132 | 316 | ||
683 | 133 | fi | 317 | fi |
684 | 134 | 318 | ||
685 | 135 | if [ $was_base_license_accepted == False ]; then | 319 | if [ $was_base_license_accepted == False ]; then |
688 | 136 | juju-log "Websphere BASE License not accepted." | 320 | juju-log "IBM WAS Base: Websphere BASE License not accepted." |
687 | 137 | |||
689 | 138 | elif [ $was_base_license_accepted == True ]; then | 321 | elif [ $was_base_license_accepted == True ]; then |
750 | 139 | juju-log "Check WAS Base package availability" | 322 | juju-log "IBM WAS Base: Check WAS Base package availability" |
751 | 140 | # check WAS package availability | 323 | is_was_base_installed=`is_was_base_installed` |
752 | 141 | if [ -d "$CHARM_DIR/files/archives/disk1" ]; then | 324 | if [ $is_was_base_installed == False ];then |
753 | 142 | juju-log "WAS BASE Packages available for installation."; | 325 | download_WAS |
754 | 143 | #Check IM installation | 326 | if [ -d "$CHARM_DIR/$ARCHIVE_DIR/disk1" ];then |
755 | 144 | im_installed=`is_im_installed` | 327 | juju-log "IBM WAS Base: Installing WAS Base, unzipped package contents aavailable" |
756 | 145 | if [ $im_installed == True ]; then | 328 | else |
757 | 146 | 329 | unzip $CHARM_DIR/$ARCHIVE_DIR/'WAS_*.zip' -d $CHARM_DIR/$ARCHIVE_DIR/ | |
758 | 147 | juju-log "Installing WAS BASE " | 330 | if [ $? != 0 ]; then |
759 | 148 | cd $IM_INSTALL_PATH/eclipse/tools | 331 | juju-log "IBM WAS Base: Unable to extract the WAS packages content. Verify whether the package is corrupt." |
760 | 149 | sudo ./imcl install com.ibm.websphere.BASE.v85 -repositories $CHARM_DIR/files/archives/ -installationDirectory $WAS_BASE_INSTALL_PATH -sharedResourcesDirectory $IM_INSTALL_PATH/IMShared -acceptLicense -showProgress | 332 | # Remove corrupt archive file |
761 | 150 | if [ $? == 0 ] | 333 | rm -f $CHARM_DIR/$ARCHIVE_DIR/'WAS_*.zip' |
762 | 151 | then | 334 | exit 0 |
763 | 152 | juju-log " WAS Base is installed successfully" | 335 | else |
764 | 153 | else | 336 | juju-log "IBM WAS Base: Downloaded and Extracted WAS Base Packages Sucessfully" |
765 | 154 | juju-log "Error while installing WAS" | 337 | fi |
766 | 155 | exit 1 | 338 | fi |
767 | 156 | fi | 339 | if [ -d $CHARM_DIR/$ARCHIVE_DIR/was_fixpack ];then |
768 | 157 | else | 340 | juju-log "IBM WAS Base: WAS Base Fixpack packages are available for upgrading" |
769 | 158 | juju-log "IM is not installaed to install WAS" | 341 | else |
770 | 159 | exit 0 | 342 | unzip $CHARM_DIR/$ARCHIVE_DIR/'8.5.5-WS-WAS*.zip' -d $CHARM_DIR/$ARCHIVE_DIR/was_fixpack/ |
771 | 160 | fi | 343 | if [ $? != 0 ]; then |
772 | 161 | 344 | juju-log "IBM WAS Base: Unable to extract the WAS Base fixpack packages content. Verify whether the package is corrupt." | |
773 | 162 | juju-log "creating a profile" | 345 | # Remove corrupt archive file |
774 | 163 | cd $WAS_BASE_INSTALL_PATH/bin | 346 | rm -f $CHARM_DIR/$ARCHIVE_DIR/8.5.5-WS-WAS*.zip |
775 | 164 | #sh does not work in ubuntu so linking to bash | 347 | exit 0 |
776 | 165 | 348 | else | |
777 | 166 | juju-log "Unlink /bin/sh" | 349 | juju-log "IBM WAS Base: Downloaded and Extracted WAS Base fixpack Packages Sucessfully" |
778 | 167 | sudo unlink /bin/sh | 350 | fi |
779 | 168 | sudo ln -s /bin/bash /bin/sh | 351 | fi |
780 | 169 | juju-log "creating a profile" | 352 | # check WAS package availability |
781 | 170 | 353 | if [ -d "$CHARM_DIR/$ARCHIVE_DIR/disk1" ]; then | |
782 | 171 | juju-log "updating /etc/hosts with hostname" | 354 | juju-log "IBM WAS Base: WAS BASE Packages available for installation."; |
783 | 172 | # Need to update hostname in /etc/hosts | 355 | #Check IM installation |
784 | 173 | private_address=`unit-get private-address` | 356 | im_installed=`is_im_installed` |
785 | 174 | juju-log "private_address : $private_address" | 357 | if [ $im_installed == True ]; then |
786 | 175 | echo "$private_address `hostname`" >> /etc/hosts | 358 | juju-log "IBM WAS Base: Installing WAS BASE " |
787 | 176 | if [ $? == 0 ] | 359 | if [ "$ARCHITECTURE" == "x86_64" ];then |
788 | 177 | then | 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 |
789 | 178 | juju-log "hostname updated" | 361 | if [ $? == 0 ]; |
790 | 179 | else | 362 | then |
791 | 180 | juju-log "Error while updating /etc/hosts" | 363 | juju-log " IBM WAS Base: WAS Base is installed successfully" |
792 | 181 | fi | 364 | else |
793 | 182 | 365 | juju-log "IBM WAS Base: Error while installing WAS" | |
794 | 183 | sudo ./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" | 366 | exit 1 |
795 | 184 | juju-log "Profile creation completed" | 367 | fi |
796 | 185 | 368 | elif [ "$ARCHITECTURE" == "ppc64le" ];then | |
797 | 186 | #Apply fixpack 8.5.5.4 to upgrade was base version from 8.5.5.0 to 8.5.5.4 | 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 |
798 | 187 | 370 | if [ $? == 0 ]; | |
799 | 188 | juju-log "Upgrading WAS Base" | 371 | then |
800 | 189 | cd $IM_INSTALL_PATH/eclipse/tools | 372 | juju-log " IBM WAS Base: WAS Base is installed successfully" |
801 | 190 | sudo ./imcl install com.ibm.websphere.BASE.v85_8.5.5004.20141119_1746 -repositories $CHARM_DIR/files/archives/was_fixpack/ -installationDirectory $WAS_BASE_INSTALL_PATH -sharedResourcesDirectory $IM_INSTALL_PATH/IMShared -acceptLicense -showProgress | 373 | else |
802 | 191 | if [ $? == 0 ] | 374 | juju-log "IBM WAS Base: Error while installing WAS" |
803 | 192 | then | 375 | exit 1 |
804 | 193 | juju-log " WAS fixpack installed successfully" | 376 | fi |
805 | 194 | else | 377 | |
806 | 195 | juju-log "Error while installing WAS fixpack" | 378 | fi |
807 | 196 | exit 1 | 379 | else |
808 | 197 | fi | 380 | juju-log "IBM WAS Base: IM needs to be installed before installing WAS." |
809 | 198 | 381 | exit 0 | |
810 | 382 | fi | ||
811 | 383 | juju-log "IBM WAS Base: creating a profile" | ||
812 | 384 | #sh does not work in ubuntu so linking to bash | ||
813 | 385 | juju-log "IBM WAS Base: Unlink /bin/sh" | ||
814 | 386 | unlink /bin/sh | ||
815 | 387 | ln -s /bin/bash /bin/sh | ||
816 | 388 | juju-log "IBM WAS Base: creating a profile" | ||
817 | 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" | ||
818 | 390 | juju-log "IBM WAS Base: Profile creation completed" | ||
819 | 391 | #Apply fixpack 8.5.5.4 to upgrade was base version from 8.5.5.0 to 8.5.5.4 | ||
820 | 392 | juju-log "IBM WAS Base: Upgrading WAS Base by installing WAS fixpack" | ||
821 | 393 | if [ "$ARCHITECTURE" == "x86_64" ];then | ||
822 | 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 | ||
823 | 395 | elif [ "$ARCHITECTURE" == "ppc64le" ];then | ||
824 | 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 | ||
825 | 397 | fi | ||
826 | 398 | if [ $? == 0 ]; | ||
827 | 399 | then | ||
828 | 400 | juju-log " IBM WAS Base: WAS fixpack installed successfully" | ||
829 | 401 | else | ||
830 | 402 | juju-log "IBM WAS Base: Error while installing WAS fixpack" | ||
831 | 403 | exit 1 | ||
832 | 404 | fi | ||
833 | 405 | #starting the server | ||
834 | 406 | cd $WAS_BASE_INSTALL_PATH/profiles/test/bin/ | ||
835 | 407 | juju-log "IBM WAS Base: Server Starting" | ||
836 | 408 | ./startServer.sh server1 | ||
837 | 409 | if [ "$?" -ne "0" ]; then | ||
838 | 410 | juju-log "IBM WAS Base: Error while starting the server" | ||
839 | 411 | else | ||
840 | 412 | juju-log "IBM WAS Base: Server started successfully" | ||
841 | 413 | fi | ||
842 | 414 | |||
843 | 415 | |||
844 | 416 | else | ||
845 | 417 | juju-log "IBM WAS Base: WAS BASE Packages are not available" | ||
846 | 418 | fi | ||
847 | 199 | else | 419 | else |
849 | 200 | juju-log "WAS BASE Packages are not available " | 420 | juju-log "IBM WAS Base: IBM WAS Base Software installed already" |
850 | 201 | fi | 421 | fi |
852 | 202 | 422 | else | |
853 | 423 | juju-log "IBM WAS Base: Acceptable values for license is 'True' or 'False'" | ||
854 | 203 | fi | 424 | fi |
856 | 204 | 425 | juju-log "IBM WAS Base: End Config-Changed hook..." | |
857 | 205 | 426 | ||
858 | === modified file 'hooks/install' | |||
859 | --- hooks/install 2015-04-09 10:32:35 +0000 | |||
860 | +++ hooks/install 2015-07-29 11:48:27 +0000 | |||
861 | @@ -2,46 +2,22 @@ | |||
862 | 2 | # Here do anything needed to install the service | 2 | # Here do anything needed to install the service |
863 | 3 | 3 | ||
864 | 4 | set -e | 4 | set -e |
908 | 5 | juju-log "Downloading WAS Installable" | 5 | juju-log "IBM WAS Base: Begin Install." |
909 | 6 | was_repository=`config-get was_url` | 6 | |
910 | 7 | im_file_name=`config-get im_file_name` | 7 | # Install wget |
911 | 8 | juju-log "repository : $was_repository" | 8 | juju-log "IBM WAS Base: Downloading and installng wget package" |
912 | 9 | if [ -z "$was_repository" ];then | 9 | apt-get install -y wget |
913 | 10 | juju-log "Please enter Repository URL in config.yaml" | 10 | juju-log "IBM WAS Base: wget downloaded and installed." |
914 | 11 | fi | 11 | |
915 | 12 | 12 | #Install unzip | |
916 | 13 | if [ -z "$im_file_name" ];then | 13 | juju-log "IBM WAS Base: Downloading and installng unzip." |
917 | 14 | juju-log "Please enter IM Installation path or IM package Name" | 14 | apt-get install -y unzip |
918 | 15 | fi | 15 | juju-log "IBM WAS Base: unzip downloaded and installed." |
919 | 16 | juju-log "Downloading and extracting WAS packages" | 16 | |
920 | 17 | sudo apt-get install unzip | 17 | ARCHITECTURE=`uname -m` |
921 | 18 | juju-log "downloading and extracting IM packages" | 18 | if [ "$ARCHITECTURE" != "x86_64" -a "$ARCHITECTURE" != "ppc64le" ]; then |
922 | 19 | cd $CHARM_DIR/files/archives | 19 | juju-log "IBM WAS Base: Unsupported platform. IBM WAS Base installed with this Charm supports only the x86_64 and ppc64le platforms." |
923 | 20 | mkdir IM | 20 | exit 1 |
924 | 21 | cd IM | 21 | fi |
925 | 22 | wget $was_repository/$im_file_name | 22 | |
926 | 23 | unzip $im_file_name | 23 | juju-log "IBM WAS Base: End Install." |
884 | 24 | |||
885 | 25 | cd $CHARM_DIR/files/archives | ||
886 | 26 | wget $was_repository/WAS_V8.5.5_1_OF_3.zip | ||
887 | 27 | wget $was_repository/WAS_V8.5.5_2_OF_3.zip | ||
888 | 28 | wget $was_repository/WAS_V8.5.5_3_OF_3.zip | ||
889 | 29 | |||
890 | 30 | #installing unzip packages | ||
891 | 31 | unzip WAS_V8.5.5_1_OF_3.zip | ||
892 | 32 | unzip WAS_V8.5.5_2_OF_3.zip | ||
893 | 33 | unzip WAS_V8.5.5_3_OF_3.zip | ||
894 | 34 | |||
895 | 35 | |||
896 | 36 | juju-log "Downloading and extracting WAS fixpack images" | ||
897 | 37 | #Downloading was fixpack packages | ||
898 | 38 | cd $CHARM_DIR/files/archives | ||
899 | 39 | mkdir was_fixpack | ||
900 | 40 | cd was_fixpack | ||
901 | 41 | wget $was_repository/8.5.5-WS-WAS-FP0000004-part1.zip | ||
902 | 42 | wget $was_repository/8.5.5-WS-WAS-FP0000004-part2.zip | ||
903 | 43 | |||
904 | 44 | #Extracting the packages | ||
905 | 45 | unzip 8.5.5-WS-WAS-FP0000004-part1.zip | ||
906 | 46 | unzip 8.5.5-WS-WAS-FP0000004-part2 | ||
907 | 47 | juju-log "WAS Installables download complete" | ||
927 | 48 | 24 | ||
928 | === modified file 'hooks/start' | |||
929 | --- hooks/start 2015-04-09 10:32:35 +0000 | |||
930 | +++ hooks/start 2015-07-29 11:48:27 +0000 | |||
931 | @@ -2,14 +2,24 @@ | |||
932 | 2 | WAS_BASE_INSTALL_PATH=/root/IBM/WebSphere/AppServer/V85/BASE | 2 | WAS_BASE_INSTALL_PATH=/root/IBM/WebSphere/AppServer/V85/BASE |
933 | 3 | 3 | ||
934 | 4 | #starting the server | 4 | #starting the server |
943 | 5 | cd $WAS_BASE_INSTALL_PATH/profiles/test/bin/ | 5 | #server_status=` ps -ef | grep '$WAS_BASE_INSTALL_PATH'` |
944 | 6 | sudo ./startServer.sh server1 | 6 | netstat -nltp | grep 9060 |
945 | 7 | if [ "$?" -ne "0" ]; then | 7 | if [ "$?" -eq "0" ];then |
946 | 8 | juju-log "Error while starting the server" | 8 | juju-log "IBM WAS Base: WAS Base Server already started" |
947 | 9 | else | 9 | else |
948 | 10 | juju-log "Server started successfully" | 10 | if [ -d $WAS_BASE_INSTALL_PATH/profiles/test/bin ]; then |
949 | 11 | 11 | cd $WAS_BASE_INSTALL_PATH/profiles/test/bin/ | |
950 | 12 | fi | 12 | ./startServer.sh server1 |
951 | 13 | if [ "$?" -ne "0" ]; then | ||
952 | 14 | juju-log "IBM WAS Base: Error while starting the server" | ||
953 | 15 | else | ||
954 | 16 | juju-log "IBM WAS Base: Server started successfully" | ||
955 | 17 | fi | ||
956 | 18 | else | ||
957 | 19 | juju-log "IBM WAS Base: No server to start, exiting." | ||
958 | 20 | exit 0 | ||
959 | 21 | fi | ||
960 | 22 | fi | ||
961 | 13 | 23 | ||
962 | 14 | open-port 9060 | 24 | open-port 9060 |
963 | 15 | open-port 9443 | 25 | open-port 9443 |
964 | 16 | 26 | ||
965 | === modified file 'hooks/stop' | |||
966 | --- hooks/stop 2015-04-09 10:32:35 +0000 | |||
967 | +++ hooks/stop 2015-07-29 11:48:27 +0000 | |||
968 | @@ -3,10 +3,17 @@ | |||
969 | 3 | set -e | 3 | set -e |
970 | 4 | WAS_BASE_INSTALL_PATH=/root/IBM/WebSphere/AppServer/V85/BASE | 4 | WAS_BASE_INSTALL_PATH=/root/IBM/WebSphere/AppServer/V85/BASE |
971 | 5 | 5 | ||
979 | 6 | cd $WAS_BASE_INSTALL_PATH/profiles/test/bin/ | 6 | if [ -d $WAS_BASE_INSTALL_PATH/profiles/test/bin ]; then |
980 | 7 | sudo ./stopServer.sh server1 | 7 | cd $WAS_BASE_INSTALL_PATH/profiles/test/bin/ |
981 | 8 | if [ "$?" -ne "0" ]; then | 8 | ./stopServer.sh server1 |
982 | 9 | juju-log "Error while stoping the server" | 9 | if [ "$?" -ne "0" ]; then |
983 | 10 | else | 10 | juju-log "Error while stoping the server" |
984 | 11 | juju-log "Server stopped successfully" | 11 | else |
985 | 12 | fi | 12 | juju-log "Server stopped successfully" |
986 | 13 | fi | ||
987 | 14 | else | ||
988 | 15 | juju-log "IBM WAS Base: No server to stop, exiting." | ||
989 | 16 | exit 0 | ||
990 | 17 | fi | ||
991 | 18 | close-port 9060 | ||
992 | 19 | close-port 9443 | ||
993 | 13 | 20 | ||
994 | === added file 'hooks/website-relation-changed' | |||
995 | --- hooks/website-relation-changed 1970-01-01 00:00:00 +0000 | |||
996 | +++ hooks/website-relation-changed 2015-07-29 11:48:27 +0000 | |||
997 | @@ -0,0 +1,3 @@ | |||
998 | 1 | #!/bin/sh | ||
999 | 2 | relation-set hostname=`unit-get private-address` port=9060 https-port=9443 | ||
1000 | 3 | |||
1001 | 0 | 4 | ||
1002 | === added file 'hooks/website-relation-joined' | |||
1003 | --- hooks/website-relation-joined 1970-01-01 00:00:00 +0000 | |||
1004 | +++ hooks/website-relation-joined 2015-07-29 11:48:27 +0000 | |||
1005 | @@ -0,0 +1,12 @@ | |||
1006 | 1 | #!/bin/sh | ||
1007 | 2 | |||
1008 | 3 | juju-log "IBM WAS Base: Begin website-relation-joined hook." | ||
1009 | 4 | set -e | ||
1010 | 5 | was_base_license_accepted=`config-get accept-ibm-websphere-license` | ||
1011 | 6 | if [ "$was_base_license_accepted" == "False" ]; then | ||
1012 | 7 | juju-log "IBM WAS Base: IBM WAS Base License is not accepted." | ||
1013 | 8 | juju-log "Delete the relation. Accept the IBM WAS Base License, as per the README, before setting up any relation." | ||
1014 | 9 | exit 0 | ||
1015 | 10 | fi | ||
1016 | 11 | relation-set hostname=`unit-get private-address` port=9060 https-port=9443 | ||
1017 | 12 | juju-log "IBM WAS Base: End website-relation-joined hook." | ||
1018 | 0 | 13 | ||
1019 | === modified file 'metadata.yaml' | |||
1020 | --- metadata.yaml 2015-04-09 10:32:35 +0000 | |||
1021 | +++ metadata.yaml 2015-07-29 11:48:27 +0000 | |||
1022 | @@ -1,6 +1,6 @@ | |||
1023 | 1 | name: was-base | 1 | name: was-base |
1024 | 2 | summary: WebSphere Application Server Base Edition | 2 | summary: WebSphere Application Server Base Edition |
1026 | 3 | maintainer: jujusupp@us.ibm.com | 3 | maintainer: IBM Juju Support Team <jujusupp@us.ibm.com> |
1027 | 4 | description: | | 4 | description: | |
1028 | 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. |
1029 | 6 | tags: ["applications"] | 6 | tags: ["applications"] |
1030 | 7 | 7 | ||
1031 | === removed file 'revision' | |||
1032 | --- revision 2015-04-09 10:32:35 +0000 | |||
1033 | +++ revision 1970-01-01 00:00:00 +0000 | |||
1034 | @@ -1,1 +0,0 @@ | |||
1035 | 1 | 1 | ||
1036 | 2 | 0 | ||
1037 | === modified file 'tests/00-setup' | |||
1038 | --- tests/00-setup 2015-04-17 07:55:57 +0000 | |||
1039 | +++ tests/00-setup 2015-07-29 11:48:27 +0000 | |||
1040 | @@ -1,5 +1,17 @@ | |||
1041 | 1 | #!/bin/bash | 1 | #!/bin/bash |
1042 | 2 | # ATTENTION: ib_url must contain the repository with | ||
1043 | 3 | # your IB packages | ||
1044 | 4 | WAS_URL=${WAS_URL?Error: IBM WAS Base repository must be defined in tests/00-setup} | ||
1045 | 5 | IM_FILE_NAME=${IM_FILE_NAME?Error: IBM IM package be defined in tests/00-setup} | ||
1046 | 6 | |||
1047 | 7 | # Add a local configuration file | ||
1048 | 8 | sudo cat << EOF > local.yaml | ||
1049 | 9 | wasbase: | ||
1050 | 10 | was_url: "$WAS_URL" | ||
1051 | 11 | im_file_name: "$IM_FILE_NAME" | ||
1052 | 12 | EOF | ||
1053 | 2 | 13 | ||
1054 | 3 | sudo add-apt-repository ppa:juju/stable -y | 14 | sudo add-apt-repository ppa:juju/stable -y |
1055 | 4 | sudo apt-get update | 15 | sudo apt-get update |
1056 | 5 | sudo apt-get install amulet python3-requests -y | 16 | sudo apt-get install amulet python3-requests -y |
1057 | 17 | |||
1058 | 6 | 18 | ||
1059 | === modified file 'tests/10-bundles-test.py' | |||
1060 | --- tests/10-bundles-test.py 2015-04-17 07:55:57 +0000 | |||
1061 | +++ tests/10-bundles-test.py 2015-07-29 11:48:27 +0000 | |||
1062 | @@ -6,38 +6,57 @@ | |||
1063 | 6 | import unittest | 6 | import unittest |
1064 | 7 | import yaml | 7 | import yaml |
1065 | 8 | import amulet | 8 | import amulet |
1066 | 9 | import sys | ||
1067 | 9 | import requests | 10 | import requests |
1068 | 10 | 11 | ||
1069 | 11 | # 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 |
1070 | 12 | seconds_to_wait = 2400 | 13 | seconds_to_wait = 2400 |
1071 | 13 | 14 | ||
1072 | 14 | |||
1073 | 15 | class BundleTest(unittest.TestCase): | 15 | class BundleTest(unittest.TestCase): |
1074 | 16 | """ Create a class for testing the charm in the unit test framework. """ | ||
1075 | 17 | @classmethod | 16 | @classmethod |
1076 | 18 | def setUpClass(cls): | 17 | def setUpClass(cls): |
1081 | 19 | """ Set up an amulet deployment using the bundle. """ | 18 | d = amulet.Deployment() |
1082 | 20 | d = amulet.Deployment() | 19 | |
1083 | 21 | bundle_path = os.path.join(os.path.dirname(__file__), 'bundles.yaml') | 20 | local_path = os.path.join(os.path.dirname(__file__), 'local.yaml') |
1084 | 22 | with open(bundle_path, 'r') as bundle_file: | 21 | with open(local_path, "r") as fd: |
1085 | 22 | config = yaml.safe_load(fd) | ||
1086 | 23 | |||
1087 | 24 | url = config.get('wasbase').get('was_url') | ||
1088 | 25 | print('Using URL %s' % url) | ||
1089 | 26 | # Test if a IB url for the repository is defined | ||
1090 | 27 | if not url: | ||
1091 | 28 | print("You need to define a url for the WAS Base packages repository.\n" | ||
1092 | 29 | "Edit local.yaml or tests/00-setup and run it again.") | ||
1093 | 30 | sys.exit(1) | ||
1094 | 31 | |||
1095 | 32 | pkg = config.get('wasbase').get('im_file_name') | ||
1096 | 33 | print('Using IBM IM package %s' % pkg) | ||
1097 | 34 | if not pkg: | ||
1098 | 35 | print("You need to define a package name for IBM IM.\n" | ||
1099 | 36 | "Edit local.yaml or tests/00-setup and run it again.") | ||
1100 | 37 | sys.exit(1) | ||
1101 | 38 | |||
1102 | 39 | bundle_path = os.path.join(os.path.dirname(__file__), 'bundles.yaml') | ||
1103 | 40 | with open(bundle_path, 'r') as bundle_file: | ||
1104 | 23 | contents = yaml.safe_load(bundle_file) | 41 | contents = yaml.safe_load(bundle_file) |
1106 | 24 | d.load(contents) | 42 | d.load(contents) |
1107 | 25 | 43 | ||
1112 | 26 | # Software doesn't actually install until you accept the license | 44 | # Software doesn't actually install until you accept the license |
1113 | 27 | d.configure('was-base', {'accept-ibm-websphere-license': True, 'accept-ibm-im-license': True }) | 45 | d.configure('was-base', {'accept-ibm-websphere-license': True, 'accept-ibm-im-license': True,'was_url': url, 'im_file_name': pkg }) |
1114 | 28 | d.setup(seconds_to_wait) | 46 | d.setup(seconds_to_wait) |
1115 | 29 | cls.d = d | 47 | d.sentry.wait(seconds_to_wait) |
1116 | 48 | cls.d = d | ||
1117 | 30 | 49 | ||
1118 | 31 | def test_deployed(self): | 50 | def test_deployed(self): |
1121 | 32 | """ Test to see if the bundle deployed successfully. """ | 51 | self.assertTrue(self.d.deployed) |
1120 | 33 | self.assertTrue(self.d.deployed) | ||
1122 | 34 | 52 | ||
1123 | 35 | def test_website(self): | 53 | def test_website(self): |
1127 | 36 | unit = self.d.sentry.unit['was-base/0'] | 54 | unit = self.d.sentry.unit['was-base/0'] |
1128 | 37 | url = 'http://%s:9060/ibm/console' % unit.info['public-address'] | 55 | url = 'http://%s:9060/ibm/console' % unit.info['public-address'] |
1129 | 38 | response = requests.get(url) | 56 | response = requests.get(url) |
1130 | 39 | # Raise an exception if the url was not a valid web page. | 57 | # Raise an exception if the url was not a valid web page. |
1132 | 40 | response.raise_for_status() | 58 | response.raise_for_status() |
1133 | 41 | 59 | ||
1134 | 42 | if __name__ == '__main__': | 60 | if __name__ == '__main__': |
1135 | 43 | unittest.main() | 61 | unittest.main() |
1136 | 62 |