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