Merge lp:~ibmcharmers/charms/trusty/was-base/devel into lp:~ibmcharmers/charms/trusty/was-base/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
Reviewer Review Type Date Requested Status
IBM Charm Authors Pending
Review via email: mp+266220@code.launchpad.net
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
=== modified file 'README.md'
--- README.md 2015-04-09 10:32:35 +0000
+++ README.md 2015-07-29 11:48:27 +0000
@@ -3,33 +3,37 @@
3WebSphere Application Server Base3WebSphere Application Server Base
44
5WebSphere Application Server is a proven, high-performance transaction engine that can help build, run, integrate, and manage dynamic web applications.5WebSphere Application Server is a proven, high-performance transaction engine that can help build, run, integrate, and manage dynamic web applications.
66Details on IBM Websphere Application Server and WAS Base Prduct Page available [here] [WAS-product-page].
77
8#Creating the repositories8
9# Usage
10
11Download 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.
12
13Download your licensed IBM Websphere Base software 8.5.5.0 version and upload to your apache repository.
14
15Download your licensed IBM Websphere Base software WAS fixpack version 8.5.5.4 and upload to your apache repository.
16
17For 'ppc64le' based machines, Download your licensed IBM Websphere Base software WAS fixpack version 8.5.5.6 and upload to your apache repository.
18
19Put 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.
20
21
22#Creating the repositories in Apache
23
9Run steps below with admin access24Run steps below with admin access
1025
11Install needed packages26Install needed packages
12 apt-get install dpkg-dev apache227 apt-get install dpkg-dev apache2
1328
14Create the repository on apache server29Create the repository on apache server Under your apache repository directory.
15Under your apache repository directory30Configure apache server to allow access to the repository.
16 cd <apache-repository-directory>31
17Configure apache server to allow access to the repository32To install IBM Websphere Application Server Base you need to install IBM Installation Manager software as prerequisite.
18Configure config.yaml with the repository url33To 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/).
19 was_url: "http://<server-name>/debs/"34
2035To 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.
21# Usage36
22Download your licensed IBM Installation Manager software version 1.5 and above and upload to your apache repository
23
24Download your licensed IBM Websphere Base software 8.5.5.0 and upload to your apache repository
25
26Download your licensed IBM Websphere Base software WAS fixpack version 8.5.5.4 version and upload to your apache repository
27
28For WAS 8.5.5.0 Download refer : http://www-01.ibm.com/support/docview.wss?uid=swg27038625
29for WAS 8.5.5.4 fixpack download refer : http://www-01.ibm.com/support/docview.wss?uid=swg24038539 link
30
31To download and install the code contained in this charm you must agree to the
32IBM license. The license file(s) can be found in the product binaries you downloaded.
3337
34Run the following to deploy this charm:38Run the following to deploy this charm:
3539
@@ -38,23 +42,20 @@
38At this point the charm will wait until the user accepts the license. If you 42At this point the charm will wait until the user accepts the license. If you
39agree to the license, run the following command:43agree to the license, run the following command:
4044
41 juju set was-base accept-ibm-im-license=True45If the was_url and im_filename is configured in the config.yaml:
42 juju set was-base accept-ibm-websphere-license=True46
4347 juju set was-base accept-ibm-im-license=True accept-ibm-websphere-license=True
4448
45You can then browse to http://ip-address:9060 to view WAS Console. 49If not,
50
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>
52
53
54You can then browse to "http://was-base unit's ip-address:9060/ibm/cinsole" to view WAS Console.
55
4656
47# Configuration57# Configuration
4858
49`was_url`
50Apache Repository URL where WAS packages are placed
51
52`im_install_path`
53Installation Manager Installation Path
54
55`im_file_name`
56Installation Manager Package Name
57
58`accept-ibm-im-license` 59`accept-ibm-im-license`
59The IBM Installation Manager software comes with special terms and conditions from IBM.60The IBM Installation Manager software comes with special terms and conditions from IBM.
60The IBM Installation Manager software can only be used by accepting the terms and 61The IBM Installation Manager software can only be used by accepting the terms and
@@ -70,13 +71,82 @@
70Agreement for Non-Warranted Programs and additional license information.71Agreement for Non-Warranted Programs and additional license information.
71Please read the license agreement carefully.72Please read the license agreement carefully.
7273
73The license file can be found in the root directory of the charm source74Check the Usage section on getting the license agreement.
74in the IBM-WebSphere-license.txt file
7575
76**The WebSphere software cannot be installed until the terms and76**The WebSphere software cannot be installed until the terms and
77contions are accepted. The charm will not function correctly until the77contions are accepted. The charm will not function correctly until the
78this configuration option is set to True.**78this configuration option is set to True.**
7979
80# Contact Information80`was_url`
81The web server URL from which IBM IM, IBM WAS Base and fixpack packages can be downloaded.
82
83`im_install_path`
84Install 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.
85
86
87`im_file_name`
88The 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.
89
90`sha_im`
91Checksum 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.
92
93#IBM WAS Base Information
94
95(1) General Information
96Information on IBM WAS available [here] [WAS-Infocenter]
97
98(2) Download Information
99
100Downloadable Package Names for 'x86_64' based machine:
101WAS_V8.5.5_1_OF_3.zip
102WAS_V8.5.5_2_OF_3.zip
103WAS_V8.5.5_3_OF_3.zip
1048.5.5-WS-WAS-FP0000004-part1.zip
1058.5.5-WS-WAS-FP0000004-part2.zip
106
107Downloadable Package Names for 'ppc64le' based machine:
108WAS_V8.5.5_FOR_POWERLE_ML.zip
109WAS_V8.5.5_2_OF_2_FOR_POWERLE_ML.zip
1108.5.5-WS-WAS-LE-FP0000006-part1.zip
1118.5.5-WS-WAS-LE-FP0000006-part2.zip
112
113Information on procuring WAS product is available at the [Passport Advantage site] [Passport-Advantage]
114
115Details about WAS 8.5.5.0 download available [here] [[WAS-8.5.5.0-download]
116
117Information about insatllation of WAS Base on 'ppc64le' based machine available [here] [WAS-for-ppc64le]
118
119Details about WAS 8.5.5.4 fixpack download available [here] [WAS-8.5.5.4-fixpack-download].
120
121A trial version is available [here] [WAS-trail-version].
122
123More information about IBM IM Downloadable file available [here] [IBM-IM-more-info]
124
125(3) Contact Information
81126
82For issues with this charm, please contact jujusupp@us.ibm.com127For issues with this charm, please contact jujusupp@us.ibm.com
128
129<!-- Links -->
130
131[WAS-Infocenter]: http://www-01.ibm.com/support/knowledgecenter/SSAW57_8.5.5/as_ditamaps/was855_welcome_ndmp.html?lang=en
132
133[WAS-product-page]: http://www-03.ibm.com/software/products/en/appserv-was
134
135[WAS-8.5.5.0-download]: http://www-01.ibm.com/support/docview.wss?uid=swg27038625
136
137[WAS-8.5.5.4-fixpack-download]: http://www-01.ibm.com/support/docview.wss?uid=swg24038539
138
139[WAS-trail-version]: http://www.ibm.com/developerworks/downloads/ws/was/index.html
140
141[Passport-Advantage]: http://www-01.ibm.com/software/passportadvantage/
142
143[IBM-IM-more-info]: http://www-01.ibm.com/support/docview.wss?uid=swg24038380
144
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
146
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
148
149[WAS-ppc64le-fixpack-info]: http://www-01.ibm.com/support/docview.wss?uid=swg24040035
150
151[License]: http://www-03.ibm.com/software/sla/sladb.nsf/search
152
83153
=== modified file 'config.yaml'
--- config.yaml 2015-05-05 08:37:15 +0000
+++ config.yaml 2015-07-29 11:48:27 +0000
@@ -2,26 +2,46 @@
2 was_url:2 was_url:
3 type: string3 type: string
4 default: ""4 default: ""
5 description: "Download url for WAS packages" 5 description: |
6 Download url for WAS Base packages, This is the URL containing WAS Base packages,
7 mention till the folder which contains packages ex: http://<ip-address>/debs/WAS-BASE/.
6 im_install_path:8 im_install_path:
7 type: string9 type: string
8 default: "/opt/IBM/InstallationManager"10 default: "/opt/IBM/InstallationManager"
9 description: "Install Location for Installation Manager.Can be changed if IM needs to be installed at some other place"11 description: |
12 Install Location for Installation Manager.Please enter the path
13 where you wants to install Install Manager ex : /opt/IBM/InstallationManager
14 here IM will install at this location, It can be changed if IM needs to be installed at some other place.
10 im_file_name:15 im_file_name:
11 type: string16 type: string
12 default: Install_Mgr_v1.6.2_Lnx_WASv8.5.5.zip17 default: ""
13 description: "Installation Manager installable Name"18 description: |
19 Name of the IBM IM package. If not set, the Charm uses a predefined
20 package name for download from the url location. If the predefined
21 package is not available at url location or if set incorrectly,
22 the charm cannot install the IBM IM software.
14 accept-ibm-websphere-license:23 accept-ibm-websphere-license:
15 type: boolean24 type: boolean
16 default: False 25 default: False
17 description: |26 description: |
18 The IBM WebSphere Application Server software comes with special terms and27 The IBM WebSphere Application Server software comes with special terms and
19 conditions from IBM. The WebSphere software can only be used by 28 conditions from IBM. The WebSphere software can only be used by
20 accepting the license terms and conditions.29 accepting the license terms and conditions. It should be set to "True" to install
30 the Websphere Application Server software.
21 accept-ibm-im-license:31 accept-ibm-im-license:
22 type: boolean32 type: boolean
23 default: False 33 default: False
24 description: |34 description: |
25 The IBM Installation Manager software comes with special terms and35 The IBM Installation Manager software comes with special terms and
26 conditions from IBM. The Installation Manager software can only be used by36 conditions from IBM. The Installation Manager software can only be used by
27 accepting the license terms and conditions.37 accepting the license terms and conditions. It should be set to "True" to install
38 the IBM Installation Manager software.
39 sha_im:
40 type: string
41 default: ""
42 description: |
43 Checksum value to check integrity of IBM IM package. The Charm uses
44 sha1sum to check the integrity. For example, run the command:
45 <sha1sum Install_Mgr_v1.6.2_Lnx_WASv8.5.5.zip | cut -d " " -f1>
46 to get the checksum value for IBM Installation Manager pacakage.
47 If empty, it does not carry out the integrity check.
2848
=== modified file 'copyright'
--- copyright 2015-04-09 10:32:35 +0000
+++ copyright 2015-07-29 11:48:27 +0000
@@ -1,17 +1,13 @@
1Format: http://dep.debian.net/deps/dep5/1Copyright 2015 IBM Corporation
22
3Files: *3This Charm is licensed under the Apache License, Version 2.0 (the "License");
4Copyright: Copyright 2014, Canonical Ltd., All Rights Reserved.4you may not use this file except in compliance with the License.
5License: GPL-35You may obtain a copy of the License at
6 This program is free software: you can redistribute it and/or modify6
7 it under the terms of the GNU General Public License as published by7 http://www.apache.org/licenses/LICENSE-2.0
8 the Free Software Foundation, either version 3 of the License, or8
9 (at your option) any later version.9Unless required by applicable law or agreed to in writing, software
10 .10distributed under the License is distributed on an "AS IS" BASIS,
11 This program is distributed in the hope that it will be useful,11WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 but WITHOUT ANY WARRANTY; without even the implied warranty of12See the License for the specific language governing permissions and
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the13limitations under the License.
14 GNU General Public License for more details.
15 .
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>.
1814
=== modified file 'hooks/config-changed'
--- hooks/config-changed 2015-04-09 10:32:35 +0000
+++ hooks/config-changed 2015-07-29 11:48:27 +0000
@@ -1,17 +1,18 @@
1#!/bin/bash1#!/bin/bash
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)
3
4set -e3set -e
54
6WAS_BASE_INSTALL_PATH=/root/IBM/WebSphere/AppServer/V85/BASE5WAS_BASE_INSTALL_PATH=/root/IBM/WebSphere/AppServer/V85/BASE
6ARCHIVE_DIR=files/archives
7
7# Check whether IM is installed8# Check whether IM is installed
8is_im_installed()9is_im_installed()
9{10{
10 if [ -f $IM_INSTALL_PATH/eclipse/IBMIM ]; then11 if [ -f $IM_INSTALL_PATH/eclipse/IBMIM ]; then
11 echo "True"12 echo "True"
12 else13 else
13 echo "False"14 echo "False"
14 fi15 fi
1516
16}17}
1718
@@ -19,11 +20,11 @@
19# Check whether WAS BASE is installed20# Check whether WAS BASE is installed
20is_was_base_installed()21is_was_base_installed()
21{22{
22 if [ -d $WAS_BASE_INSTALL_PATH/bin ]; then23 if [ -d $WAS_BASE_INSTALL_PATH/bin ]; then
23 echo "True"24 echo "True"
24 else25 else
25 echo "False"26 echo "False"
26 fi27 fi
2728
28}29}
2930
@@ -32,27 +33,42 @@
32remove_was_base_software()33remove_was_base_software()
33{34{
3435
35 was_base_installed=`is_was_base_installed`36 was_base_installed=`is_was_base_installed`
36 if [ $was_base_installed == True ]; then37 if [ $was_base_installed == True ]; then
37 juju-log "Removing WAS BASE Installation"38 juju-log "IBM WAS Base: Removing WAS BASE Installation"
38 # Uninstalling WAS BASE39 juju-log "IBM WAS Base: Server stopping"
39 cd $IM_INSTALL_PATH/eclipse/tools40 $WAS_BASE_INSTALL_PATH/profiles/test/bin/stopServer.sh server1
40 sudo ./imcl uninstall com.ibm.websphere.liberty.BASE.v85 -installationDirectory $WAS_BASE_INSTALL_PATH41 if [ "$?" -ne "0" ]; then
41 fi42 juju-log "IBM WAS Base: Error while stopping the server"
42 juju-log "Uninstalling WAS BASE software completed"43 else
44 juju-log "IBM WAS Base: Server stopped successfully"
45 fi
46
47 # Uninstalling WAS BASE
48 $IM_INSTALL_PATH/eclipse/tools/imcl uninstall com.ibm.websphere.BASE.v85 -installationDirectory $WAS_BASE_INSTALL_PATH
49 if [ -d /root/IBM/WebSphere/AppServer/V85/BASE ]; then
50 juju-log "IBM WAS Base: Removing installation directory"
51 cd /root
52 rm -rf IBM/WebSphere/AppServer/V85/BASE
53 else
54 juju-log "IBM WAS Base: Installation directory does not exist"
55 fi
56 juju-log "IBM WAS Base: Uninstalling WAS Base software completed"
57
58 else
59 juju-log "IBM WAS Base: WAS Base software has not been installed."
60 fi
43}61}
4462
45#Remove IM, if installed63#Remove IM, if installed
46remove_im_software()64remove_im_software()
47{65{
4866 im_installed=`is_im_installed`
49 im_installed=`is_im_installed`67 if [ $im_installed == True ]; then
50 if [ $im_installed == True ]; then68 juju-log "IBM WAS Base: Removing IBM IM software."
51 juju-log "Removing IBM WebSphere IM software."69 /root/var/ibm/InstallationManager/uninstall/uninstallc
52 cd /root/var/ibm/InstallationManager/uninstall70 juju-log "IBM WAS Base: Removed IBM IM software"
53 #Uninstalling IM71 fi
54 ./uninstall --launcher.ini user-silent-uninstall.ini
55 fi
5672
57}73}
5874
@@ -60,145 +76,350 @@
60remove_unaccepted_software()76remove_unaccepted_software()
61{77{
6278
63 if [ $1 == False ]; then79 if [ $1 == False ]; then
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."
65 if [ -f $IM_INSTALL_PATH/eclipse/IBMIM ]; then81 if [ -f $IM_INSTALL_PATH/eclipse/IBMIM ]; then
66 juju-log "IM exists "82 juju-log "IBM WAS Base: IBM IM exists "
67 remove_was_base_software 83 remove_was_base_software
68 else84 else
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"
70 exit 0 86 exit 0
71 fi87 fi
72 fi88 fi
7389 if [ $2 == False ]; then
7490 juju-log "IBM WAS Base: Removing IBM IM (if installed) as the license agreement is not accepted."
75 if [ $2 == False ]; then91
76 juju-log "Removing IBM IM (if installed) as the license agreement is not accepted."92 #Check any dependent products exists like WAS
7793
78 #Check any dependent products exists like WAS94 if [ -d $WAS_BASE_INSTALL_PATH/bin ]; then
7995 juju-log "IBM WAS Base: Can not uninstall IM as it has WAS product installed"
80 if [ -d $WAS_BASE_INSTALL_PATH/bin ]; then96 exit 0
81 juju-log "Can not uninstall IM as its has WAS product installed"97 else
82 exit 0 98 juju-log "IBM WAS Base: Uninstall IBM IM software"
83 else99 remove_im_software
84 juju-log "Uninstall IM software"100 fi
85 remove_im_software101 fi
86 fi102
87 fi103}
88104
89}105# Download IM Package
90106
91107download_IM(){
92juju-log "Websphere WAS BASE: Begin config-change hook"108#Exit if URL to download package is null
109 if [ "$WAS_URL" == "" ]; then
110 juju-log "IBM WAS Base: URL to download IBM WAS Base package is not configured."
111 exit 0
112 fi
113
114 # If an install IM done, get the name of the package from which it was done
115 if [ -f $CHARM_DIR/$ARCHIVE_DIR/IM/*.zip ]; then
116 im_pkg_name=`ls $CHARM_DIR/$ARCHIVE_DIR/IM/*.zip`
117 if [ $? == 0 ]; then
118 im_pkg_name=`basename $im_pkg_name`
119 fi
120 fi
121
122 # Get the package name to check whether the user wants to install a different package
123 cfg_im_pkg_name=$im_file_name
124
125 # Set package name to a predefined value if the user has not provided a package name
126 if [ "$cfg_im_pkg_name" == "" ]; then
127 if [ "$ARCHITECTURE" = "x86_64" ]; then
128 cfg_im_pkg_name="Install_Mgr_v1.6.2_Lnx_WASv8.5.5.zip"
129 elif [ "$ARCHITECTURE" = "ppc64le" ]; then
130 cfg_im_pkg_name="agent.installer.linux.gtk.ppc64le_1.8.1000.20141126_2002.zip"
131 else
132 juju-log "IBM WAS Base: Platform not supported for IM."
133 exit 1
134 fi
135 fi
136
137 # The user has configured a different package name
138 if [ "$im_pkg_name" != "$cfg_im_pkg_name" ]; then
139 set +e
140 #previously downloaded and installed IM software
141 if [ "$im_pkg_name" != "" ]; then
142 juju-log "IBM WAS Base: Deleting the older IM package."
143 rm -rf $CHARM_DIR/$ARCHIVE_DIR/IM
144 remove_was_base_software
145 remove_im_software
146 fi
147 #Download the new IM package
148 juju-log "IBM WAS Base: Downloading IM package."
149 wget -t 2 -P $CHARM_DIR/$ARCHIVE_DIR/IM $WAS_URL/$cfg_im_pkg_name
150 if [ $? == 0 ]; then
151 juju-log "IBM WAS Base: Downloaded IM package."
152 else
153 juju-log "IBM WAS Base: Download of IM package failed."
154 juju-log "IBM WAS Base: Ensure the download URL and package name are correctly set in the charm configuration."
155 exit 0
156 fi
157 set -e
158 fi
159
160 # Check integrity of downloaded package
161 SHA_IM=`config-get sha_im`
162 if [ "$SHA_IM" == "" ]; then
163 juju-log "IBM WAS Base: Ignored integrity check for IM package as sha_im checksum is null."
164 elif [ "$SHA_IM" != "`sha1sum $ARCHIVE_DIR/IM/$cfg_im_pkg_name | cut -d" " -f1`" ]; then
165 juju-log "IBM WAS Base: IBM IM package is corrupt."
166 exit 0
167 fi
168}
169
170#download WAS-Base
171
172download_WAS()
173{
174#Exit if URL to download package is null
175 if [ "$WAS_URL" == "" ]; then
176 juju-log "IBM WAS Base: URL to download IBM WAS Base package is not configured."
177 exit 0
178 else
179 juju-log "Downloading WAS Base Packages"
180 was_base_pkg1="WAS_V8.5.5_1_OF_3.zip"
181 was_base_pkg2="WAS_V8.5.5_2_OF_3.zip"
182 was_base_pkg3="WAS_V8.5.5_3_OF_3.zip"
183 was_base_fixpack1="8.5.5-WS-WAS-FP0000004-part1.zip"
184 was_base_fixpack2="8.5.5-WS-WAS-FP0000004-part2.zip"
185 was_base_ppc64le_pkg1="WAS_V8.5.5_FOR_POWERLE_ML.zip"
186 was_base_ppc64le_pkg2="WAS_V8.5.5_2_OF_2_FOR_POWERLE_ML.zip"
187 was_base_ppc64le_fixpack1="8.5.5-WS-WAS-LE-FP0000006-part1.zip"
188 was_base_ppc64le_fixpack2="8.5.5-WS-WAS-LE-FP0000006-part2.zip"
189
190 if [ "$ARCHITECTURE" == "x86_64" ];then
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
192 juju-log " IBM WAS Base:Installing WAS Base, Downloaded packages already exists in archive directory."
193 else
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
195 if [ $? == 0 ]; then
196 juju-log "IBM WAS Base: Downloaded WAS Base packages successfully"
197 fi
198 fi
199 elif [ "$ARCHITECTURE" == "ppc64le" ];then
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
201 juju-log " IBM WAS Base:Installing WAS Base, Downloaded packages already exists in archive directory."
202 else
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
204 if [ $? == 0 ]; then
205 juju-log "IBM WAS Base: Downloaded WAS Base packages successfully"
206 fi
207 fi
208
209 fi
210 fi
211
212 # Check integrity of downloaded package
213 if [ "$ARCHITECTURE" == "x86_64" ];then
214 if [ "b9cc0b783b482de2092d5c387de05cda2e922413" != "`sha1sum $CHARM_DIR/$ARCHIVE_DIR/$was_base_pkg1 | cut -d" " -f1`" ]; then
215 juju-log "IBM WAS Base: IBM WAS package1 is corrupt."
216 exit 0
217 fi
218 if [ "74a52b1b5aaedd67c0727db90aff9dc63ff28f4e" != "`sha1sum $CHARM_DIR/$ARCHIVE_DIR/$was_base_pkg2 | cut -d" " -f1`" ]; then
219 juju-log "IBM WAS Base: IBM WAS package2 is corrupt."
220 exit 0
221 fi
222 if [ "e6943fa4a4a7a1384fad1faa54289106f0e57979" != "`sha1sum $CHARM_DIR/$ARCHIVE_DIR/$was_base_pkg3 | cut -d" " -f1`" ]; then
223 juju-log "IBM WAS Base: IBM WAS package3 is corrupt."
224 exit 0
225 fi
226 if [ "895863b932334a78cccce6c73ec98d35ba98639b" != "`sha1sum $CHARM_DIR/$ARCHIVE_DIR/$was_base_fixpack1 | cut -d" " -f1`" ]; then
227 juju-log "IBM WAS Base: IBM WAS Fix Pack part1 is corrupt."
228 exit 0
229 fi
230 if [ "8f8560746c6fb0f87cd47801a014e7c34fccc4cc" != "`sha1sum $CHARM_DIR/$ARCHIVE_DIR/$was_base_fixpack2 | cut -d" " -f1`" ]; then
231 juju-log "IBM WAS Base: IBM WAS Fix Pack part2 is corrupt."
232 exit 0
233 fi
234 elif [ "$ARCHITECTURE" == "ppc64le" ];then
235 if [ "62cc5a2d23a2ff828d2b4dcd9ac754b3ff994292" != "`sha1sum $CHARM_DIR/$ARCHIVE_DIR/$was_base_ppc64le_pkg1 | cut -d" " -f1`" ]; then
236 juju-log "IBM WAS Base: IBM WAS package1 is corrupt."
237 exit 0
238 fi
239 if [ "bc475ccd6f918bf858ccbb48d82e5adc2c7b3fa9" != "`sha1sum $CHARM_DIR/$ARCHIVE_DIR/$was_base_ppc64le_pkg2 | cut -d" " -f1`" ]; then
240 juju-log "IBM WAS Base: IBM WAS package2 is corrupt."
241 exit 0
242 fi
243 if [ "c0f38a16b87b7e6e7c5c0f609fb3c1a61a3b7e8e" != "`sha1sum $CHARM_DIR/$ARCHIVE_DIR/$was_base_ppc64le_fixpack1 | cut -d" " -f1`" ]; then
244 juju-log "IBM WAS Base: IBM WAS Fix Pack part1 is corrupt."
245 exit 0
246 fi
247 if [ "c8fe75b915fa2ecd183af208eff7df0464342ff8" != "`sha1sum $CHARM_DIR/$ARCHIVE_DIR/$was_base_ppc64le_fixpack2 | cut -d" " -f1`" ]; then
248 juju-log "IBM WAS Base: IBM WAS Fix Pack part2 is corrupt."
249 exit 0
250 fi
251 fi
252
253}
254
255
256juju-log "IBM WAS BASE: Begin config-change hook"
93was_base_license_accepted=`config-get accept-ibm-websphere-license`257was_base_license_accepted=`config-get accept-ibm-websphere-license`
94im_license_accepted=`config-get accept-ibm-im-license`258im_license_accepted=`config-get accept-ibm-im-license`
95IM_INSTALL_PATH=`config-get im_install_path`259IM_INSTALL_PATH=`config-get im_install_path`
260WAS_URL=`config-get was_url`
261im_file_name=`config-get im_file_name`
262ARCHITECTURE=`uname -m`
96263
97# Remove IM and WAS if license not accepted abase exit. Else install it264# Remove IM and WAS if license not accepted abase exit. Else install it
98remove_unaccepted_software $was_base_license_accepted $im_license_accepted265remove_unaccepted_software $was_base_license_accepted $im_license_accepted
99if [ $im_license_accepted == False ]; then266if [ $im_license_accepted == False ]; then
100 juju-log "Websphere IM License not accepted."267 juju-log "IBM WAS Base: Websphere IM License not accepted."
101268
102elif [ $im_license_accepted == True ]; then269elif [ $im_license_accepted == True ]; then
103270 juju-log "IBM WAS Base: IBM IM License accepted"
104 juju-log "License accepted"271 download_IM
105 im_inst=`is_im_installed`272 im_inst=`is_im_installed`
106 if [ $im_inst == False ]; then 273 if [ $im_inst == False ]; then
107 juju-log "IM installation start"274 if [ -f $CHARM_DIR/$ARCHIVE_DIR/IM/*.zip ]; then
108 # Check IM package availability275 juju-log "IBM WAS Base: downloading and extracting IM packages"
109 juju-log $CHARM_DIR276 if [ -f $CHARM_DIR/$ARCHIVE_DIR/IM/userinstc ]; then
110 if [ -f $CHARM_DIR/files/archives/IM/userinstc ];277 juju-log "IBM WAS Base: IBM IM package contents extracted already."
111 then278 else
112 juju-log "IM Packages available for installation.";279 unzip $CHARM_DIR/$ARCHIVE_DIR/IM/*.zip -d $CHARM_DIR/$ARCHIVE_DIR/IM
113 cp $CHARM_DIR/files/archives/IM/install.xml $CHARM_DIR/files/archives/IM/silent_install.xml280 if [ $? != 0 ]; then
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.xml281 juju-log "IBM WAS Base: Unable to extract the IM package content. Verify whether the package is corrupt."
115 $CHARM_DIR/files/archives/IM/userinstc -input $CHARM_DIR/files/archives/IM/silent_install.xml -acceptlicense282 # Remove corrupt archive file
116 if [ $? == 0 ]283 rm -f $CHARM_DIR/$ARCHIVE_DIR/IM/*.zip
117 then284 exit 0
118 juju-log "IM Is installed successfully"285 fi
119 else286 fi
120 juju-log "Error while installing IM"287 fi
121 exit 1288 juju-log "IBM WAS Base: IM installation start"
122 fi289 # Check IM package availability
123290 juju-log $CHARM_DIR/$ARCHIVE_DIR
124 else291 if [ -f $CHARM_DIR/$ARCHIVE_DIR/IM/userinstc ];
125 juju-log "IM Packages missing. Please check README file.";292 then
126 juju-log "Upgrade IM charm after adding the IM packages";293
127 exit 1294 juju-log "IBM WAS Base: IM Packages available for installation."
128 fi295 cp $CHARM_DIR/$ARCHIVE_DIR/IM/install.xml $CHARM_DIR/$ARCHIVE_DIR/IM/silent_install.xml
129 fi296 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
297 $CHARM_DIR/$ARCHIVE_DIR/IM/userinstc -input $CHARM_DIR/$ARCHIVE_DIR/IM/silent_install.xml -acceptlicense
298 if [ $? == 0 ]
299 then
300 juju-log "IBM WAS Base: IM Is installed successfully"
301 else
302 juju-log "IBM WAS Base: Error while installing IM"
303 exit 1
304 fi
305
306 else
307 juju-log "IBM WAS Base: IM Packages missing. Please check README file"
308 juju-log "IBM WAS Base: Upgrade IM charm after adding the IM packages";
309 exit 1
310 fi
311 else
312 juju-log "IBM WAS Base: IBM IM Installed already using same package name."
313 fi
130else314else
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'"
132316
133fi317fi
134318
135if [ $was_base_license_accepted == False ]; then319if [ $was_base_license_accepted == False ]; then
136 juju-log "Websphere BASE License not accepted."320 juju-log "IBM WAS Base: Websphere BASE License not accepted."
137
138elif [ $was_base_license_accepted == True ]; then321elif [ $was_base_license_accepted == True ]; then
139 juju-log "Check WAS Base package availability"322 juju-log "IBM WAS Base: Check WAS Base package availability"
140 # check WAS package availability323 is_was_base_installed=`is_was_base_installed`
141 if [ -d "$CHARM_DIR/files/archives/disk1" ]; then 324 if [ $is_was_base_installed == False ];then
142 juju-log "WAS BASE Packages available for installation.";325 download_WAS
143 #Check IM installation326 if [ -d "$CHARM_DIR/$ARCHIVE_DIR/disk1" ];then
144 im_installed=`is_im_installed`327 juju-log "IBM WAS Base: Installing WAS Base, unzipped package contents aavailable"
145 if [ $im_installed == True ]; then328 else
146 329 unzip $CHARM_DIR/$ARCHIVE_DIR/'WAS_*.zip' -d $CHARM_DIR/$ARCHIVE_DIR/
147 juju-log "Installing WAS BASE "330 if [ $? != 0 ]; then
148 cd $IM_INSTALL_PATH/eclipse/tools331 juju-log "IBM WAS Base: Unable to extract the WAS packages content. Verify whether the package is corrupt."
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 -showProgress332 # Remove corrupt archive file
150 if [ $? == 0 ]333 rm -f $CHARM_DIR/$ARCHIVE_DIR/'WAS_*.zip'
151 then334 exit 0
152 juju-log " WAS Base is installed successfully"335 else
153 else336 juju-log "IBM WAS Base: Downloaded and Extracted WAS Base Packages Sucessfully"
154 juju-log "Error while installing WAS"337 fi
155 exit 1338 fi
156 fi339 if [ -d $CHARM_DIR/$ARCHIVE_DIR/was_fixpack ];then
157 else340 juju-log "IBM WAS Base: WAS Base Fixpack packages are available for upgrading"
158 juju-log "IM is not installaed to install WAS"341 else
159 exit 0342 unzip $CHARM_DIR/$ARCHIVE_DIR/'8.5.5-WS-WAS*.zip' -d $CHARM_DIR/$ARCHIVE_DIR/was_fixpack/
160 fi343 if [ $? != 0 ]; then
161344 juju-log "IBM WAS Base: Unable to extract the WAS Base fixpack packages content. Verify whether the package is corrupt."
162 juju-log "creating a profile"345 # Remove corrupt archive file
163 cd $WAS_BASE_INSTALL_PATH/bin346 rm -f $CHARM_DIR/$ARCHIVE_DIR/8.5.5-WS-WAS*.zip
164 #sh does not work in ubuntu so linking to bash347 exit 0
165348 else
166 juju-log "Unlink /bin/sh"349 juju-log "IBM WAS Base: Downloaded and Extracted WAS Base fixpack Packages Sucessfully"
167 sudo unlink /bin/sh350 fi
168 sudo ln -s /bin/bash /bin/sh351 fi
169 juju-log "creating a profile"352 # check WAS package availability
170353 if [ -d "$CHARM_DIR/$ARCHIVE_DIR/disk1" ]; then
171 juju-log "updating /etc/hosts with hostname"354 juju-log "IBM WAS Base: WAS BASE Packages available for installation.";
172 # Need to update hostname in /etc/hosts355 #Check IM installation
173 private_address=`unit-get private-address`356 im_installed=`is_im_installed`
174 juju-log "private_address : $private_address"357 if [ $im_installed == True ]; then
175 echo "$private_address `hostname`" >> /etc/hosts358 juju-log "IBM WAS Base: Installing WAS BASE "
176 if [ $? == 0 ]359 if [ "$ARCHITECTURE" == "x86_64" ];then
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
178 juju-log "hostname updated"361 if [ $? == 0 ];
179 else362 then
180 juju-log "Error while updating /etc/hosts"363 juju-log " IBM WAS Base: WAS Base is installed successfully"
181 fi364 else
182365 juju-log "IBM WAS Base: Error while installing WAS"
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
184 juju-log "Profile creation completed" 367 fi
185368 elif [ "$ARCHITECTURE" == "ppc64le" ];then
186 #Apply fixpack 8.5.5.4 to upgrade was base version from 8.5.5.0 to 8.5.5.4369 $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
187 370 if [ $? == 0 ];
188 juju-log "Upgrading WAS Base"371 then
189 cd $IM_INSTALL_PATH/eclipse/tools 372 juju-log " IBM WAS Base: WAS Base is installed successfully"
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 -showProgress373 else
191 if [ $? == 0 ]374 juju-log "IBM WAS Base: Error while installing WAS"
192 then375 exit 1
193 juju-log " WAS fixpack installed successfully"376 fi
194 else377
195 juju-log "Error while installing WAS fixpack"378 fi
196 exit 1379 else
197 fi380 juju-log "IBM WAS Base: IM needs to be installed before installing WAS."
198381 exit 0
382 fi
383 juju-log "IBM WAS Base: creating a profile"
384 #sh does not work in ubuntu so linking to bash
385 juju-log "IBM WAS Base: Unlink /bin/sh"
386 unlink /bin/sh
387 ln -s /bin/bash /bin/sh
388 juju-log "IBM WAS Base: creating a profile"
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"
390 juju-log "IBM WAS Base: Profile creation completed"
391 #Apply fixpack 8.5.5.4 to upgrade was base version from 8.5.5.0 to 8.5.5.4
392 juju-log "IBM WAS Base: Upgrading WAS Base by installing WAS fixpack"
393 if [ "$ARCHITECTURE" == "x86_64" ];then
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
395 elif [ "$ARCHITECTURE" == "ppc64le" ];then
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
397 fi
398 if [ $? == 0 ];
399 then
400 juju-log " IBM WAS Base: WAS fixpack installed successfully"
401 else
402 juju-log "IBM WAS Base: Error while installing WAS fixpack"
403 exit 1
404 fi
405 #starting the server
406 cd $WAS_BASE_INSTALL_PATH/profiles/test/bin/
407 juju-log "IBM WAS Base: Server Starting"
408 ./startServer.sh server1
409 if [ "$?" -ne "0" ]; then
410 juju-log "IBM WAS Base: Error while starting the server"
411 else
412 juju-log "IBM WAS Base: Server started successfully"
413 fi
414
415
416 else
417 juju-log "IBM WAS Base: WAS BASE Packages are not available"
418 fi
199 else419 else
200 juju-log "WAS BASE Packages are not available "420 juju-log "IBM WAS Base: IBM WAS Base Software installed already"
201 fi421 fi
202422else
423 juju-log "IBM WAS Base: Acceptable values for license is 'True' or 'False'"
203fi424fi
204425juju-log "IBM WAS Base: End Config-Changed hook..."
205426
=== modified file 'hooks/install'
--- hooks/install 2015-04-09 10:32:35 +0000
+++ hooks/install 2015-07-29 11:48:27 +0000
@@ -2,46 +2,22 @@
2# Here do anything needed to install the service2# Here do anything needed to install the service
33
4set -e4set -e
5juju-log "Downloading WAS Installable"5juju-log "IBM WAS Base: Begin Install."
6was_repository=`config-get was_url`6
7im_file_name=`config-get im_file_name`7# Install wget
8juju-log "repository : $was_repository"8juju-log "IBM WAS Base: Downloading and installng wget package"
9if [ -z "$was_repository" ];then9apt-get install -y wget
10juju-log "Please enter Repository URL in config.yaml"10juju-log "IBM WAS Base: wget downloaded and installed."
11fi11
1212#Install unzip
13if [ -z "$im_file_name" ];then13juju-log "IBM WAS Base: Downloading and installng unzip."
14 juju-log "Please enter IM Installation path or IM package Name"14apt-get install -y unzip
15fi15juju-log "IBM WAS Base: unzip downloaded and installed."
16juju-log "Downloading and extracting WAS packages"16
17sudo apt-get install unzip17ARCHITECTURE=`uname -m`
18 juju-log "downloading and extracting IM packages"18if [ "$ARCHITECTURE" != "x86_64" -a "$ARCHITECTURE" != "ppc64le" ]; then
19 cd $CHARM_DIR/files/archives19 juju-log "IBM WAS Base: Unsupported platform. IBM WAS Base installed with this Charm supports only the x86_64 and ppc64le platforms."
20 mkdir IM20 exit 1
21 cd IM21fi
22 wget $was_repository/$im_file_name22
23 unzip $im_file_name23juju-log "IBM WAS Base: End Install."
24
25cd $CHARM_DIR/files/archives
26wget $was_repository/WAS_V8.5.5_1_OF_3.zip
27wget $was_repository/WAS_V8.5.5_2_OF_3.zip
28wget $was_repository/WAS_V8.5.5_3_OF_3.zip
29
30#installing unzip packages
31unzip WAS_V8.5.5_1_OF_3.zip
32unzip WAS_V8.5.5_2_OF_3.zip
33unzip WAS_V8.5.5_3_OF_3.zip
34
35
36juju-log "Downloading and extracting WAS fixpack images"
37#Downloading was fixpack packages
38cd $CHARM_DIR/files/archives
39mkdir was_fixpack
40cd was_fixpack
41wget $was_repository/8.5.5-WS-WAS-FP0000004-part1.zip
42wget $was_repository/8.5.5-WS-WAS-FP0000004-part2.zip
43
44#Extracting the packages
45unzip 8.5.5-WS-WAS-FP0000004-part1.zip
46unzip 8.5.5-WS-WAS-FP0000004-part2
47juju-log "WAS Installables download complete"
4824
=== modified file 'hooks/start'
--- hooks/start 2015-04-09 10:32:35 +0000
+++ hooks/start 2015-07-29 11:48:27 +0000
@@ -2,14 +2,24 @@
2WAS_BASE_INSTALL_PATH=/root/IBM/WebSphere/AppServer/V85/BASE2WAS_BASE_INSTALL_PATH=/root/IBM/WebSphere/AppServer/V85/BASE
33
4#starting the server4#starting the server
5cd $WAS_BASE_INSTALL_PATH/profiles/test/bin/5#server_status=` ps -ef | grep '$WAS_BASE_INSTALL_PATH'`
6sudo ./startServer.sh server16netstat -nltp | grep 9060
7 if [ "$?" -ne "0" ]; then7if [ "$?" -eq "0" ];then
8 juju-log "Error while starting the server"8 juju-log "IBM WAS Base: WAS Base Server already started"
9 else9else
10 juju-log "Server started successfully"10 if [ -d $WAS_BASE_INSTALL_PATH/profiles/test/bin ]; then
1111 cd $WAS_BASE_INSTALL_PATH/profiles/test/bin/
12 fi12 ./startServer.sh server1
13 if [ "$?" -ne "0" ]; then
14 juju-log "IBM WAS Base: Error while starting the server"
15 else
16 juju-log "IBM WAS Base: Server started successfully"
17 fi
18 else
19 juju-log "IBM WAS Base: No server to start, exiting."
20 exit 0
21 fi
22fi
1323
14open-port 906024open-port 9060
15open-port 944325open-port 9443
1626
=== modified file 'hooks/stop'
--- hooks/stop 2015-04-09 10:32:35 +0000
+++ hooks/stop 2015-07-29 11:48:27 +0000
@@ -3,10 +3,17 @@
3set -e3set -e
4WAS_BASE_INSTALL_PATH=/root/IBM/WebSphere/AppServer/V85/BASE4WAS_BASE_INSTALL_PATH=/root/IBM/WebSphere/AppServer/V85/BASE
55
6cd $WAS_BASE_INSTALL_PATH/profiles/test/bin/6if [ -d $WAS_BASE_INSTALL_PATH/profiles/test/bin ]; then
7 sudo ./stopServer.sh server17 cd $WAS_BASE_INSTALL_PATH/profiles/test/bin/
8 if [ "$?" -ne "0" ]; then8 ./stopServer.sh server1
9 juju-log "Error while stoping the server"9 if [ "$?" -ne "0" ]; then
10 else10 juju-log "Error while stoping the server"
11 juju-log "Server stopped successfully"11 else
12 fi12 juju-log "Server stopped successfully"
13 fi
14else
15 juju-log "IBM WAS Base: No server to stop, exiting."
16 exit 0
17fi
18close-port 9060
19close-port 9443
1320
=== added file 'hooks/website-relation-changed'
--- hooks/website-relation-changed 1970-01-01 00:00:00 +0000
+++ hooks/website-relation-changed 2015-07-29 11:48:27 +0000
@@ -0,0 +1,3 @@
1#!/bin/sh
2relation-set hostname=`unit-get private-address` port=9060 https-port=9443
3
04
=== added file 'hooks/website-relation-joined'
--- hooks/website-relation-joined 1970-01-01 00:00:00 +0000
+++ hooks/website-relation-joined 2015-07-29 11:48:27 +0000
@@ -0,0 +1,12 @@
1#!/bin/sh
2
3juju-log "IBM WAS Base: Begin website-relation-joined hook."
4set -e
5was_base_license_accepted=`config-get accept-ibm-websphere-license`
6if [ "$was_base_license_accepted" == "False" ]; then
7 juju-log "IBM WAS Base: IBM WAS Base License is not accepted."
8 juju-log "Delete the relation. Accept the IBM WAS Base License, as per the README, before setting up any relation."
9 exit 0
10fi
11relation-set hostname=`unit-get private-address` port=9060 https-port=9443
12juju-log "IBM WAS Base: End website-relation-joined hook."
013
=== modified file 'metadata.yaml'
--- metadata.yaml 2015-04-09 10:32:35 +0000
+++ metadata.yaml 2015-07-29 11:48:27 +0000
@@ -1,6 +1,6 @@
1name: was-base1name: was-base
2summary: WebSphere Application Server Base Edition2summary: WebSphere Application Server Base Edition
3maintainer: jujusupp@us.ibm.com3maintainer: IBM Juju Support Team <jujusupp@us.ibm.com>
4description: |4description: |
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.
6tags: ["applications"]6tags: ["applications"]
77
=== removed file 'revision'
--- revision 2015-04-09 10:32:35 +0000
+++ revision 1970-01-01 00:00:00 +0000
@@ -1,1 +0,0 @@
11
20
=== modified file 'tests/00-setup'
--- tests/00-setup 2015-04-17 07:55:57 +0000
+++ tests/00-setup 2015-07-29 11:48:27 +0000
@@ -1,5 +1,17 @@
1#!/bin/bash1#!/bin/bash
2# ATTENTION: ib_url must contain the repository with
3# your IB packages
4WAS_URL=${WAS_URL?Error: IBM WAS Base repository must be defined in tests/00-setup}
5IM_FILE_NAME=${IM_FILE_NAME?Error: IBM IM package be defined in tests/00-setup}
6
7# Add a local configuration file
8sudo cat << EOF > local.yaml
9wasbase:
10 was_url: "$WAS_URL"
11 im_file_name: "$IM_FILE_NAME"
12EOF
213
3sudo add-apt-repository ppa:juju/stable -y14sudo add-apt-repository ppa:juju/stable -y
4sudo apt-get update15sudo apt-get update
5sudo apt-get install amulet python3-requests -y16sudo apt-get install amulet python3-requests -y
17
618
=== modified file 'tests/10-bundles-test.py'
--- tests/10-bundles-test.py 2015-04-17 07:55:57 +0000
+++ tests/10-bundles-test.py 2015-07-29 11:48:27 +0000
@@ -6,38 +6,57 @@
6import unittest6import unittest
7import yaml7import yaml
8import amulet8import amulet
9import sys
9import requests10import requests
1011
11# Lots of prereqs on this charm (eg: java), so give it a large timeout12# Lots of prereqs on this charm (eg: java), so give it a large timeout
12seconds_to_wait = 240013seconds_to_wait = 2400
1314
14
15class BundleTest(unittest.TestCase):15class BundleTest(unittest.TestCase):
16 """ Create a class for testing the charm in the unit test framework. """
17 @classmethod16 @classmethod
18 def setUpClass(cls):17 def setUpClass(cls):
19 """ Set up an amulet deployment using the bundle. """18 d = amulet.Deployment()
20 d = amulet.Deployment()19
21 bundle_path = os.path.join(os.path.dirname(__file__), 'bundles.yaml')20 local_path = os.path.join(os.path.dirname(__file__), 'local.yaml')
22 with open(bundle_path, 'r') as bundle_file:21 with open(local_path, "r") as fd:
22 config = yaml.safe_load(fd)
23
24 url = config.get('wasbase').get('was_url')
25 print('Using URL %s' % url)
26 # Test if a IB url for the repository is defined
27 if not url:
28 print("You need to define a url for the WAS Base packages repository.\n"
29 "Edit local.yaml or tests/00-setup and run it again.")
30 sys.exit(1)
31
32 pkg = config.get('wasbase').get('im_file_name')
33 print('Using IBM IM package %s' % pkg)
34 if not pkg:
35 print("You need to define a package name for IBM IM.\n"
36 "Edit local.yaml or tests/00-setup and run it again.")
37 sys.exit(1)
38
39 bundle_path = os.path.join(os.path.dirname(__file__), 'bundles.yaml')
40 with open(bundle_path, 'r') as bundle_file:
23 contents = yaml.safe_load(bundle_file)41 contents = yaml.safe_load(bundle_file)
24 d.load(contents)42 d.load(contents)
2543
26 # Software doesn't actually install until you accept the license44 # Software doesn't actually install until you accept the license
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 })
28 d.setup(seconds_to_wait)46 d.setup(seconds_to_wait)
29 cls.d = d47 d.sentry.wait(seconds_to_wait)
48 cls.d = d
3049
31 def test_deployed(self):50 def test_deployed(self):
32 """ Test to see if the bundle deployed successfully. """51 self.assertTrue(self.d.deployed)
33 self.assertTrue(self.d.deployed)
3452
35 def test_website(self):53 def test_website(self):
36 unit = self.d.sentry.unit['was-base/0']54 unit = self.d.sentry.unit['was-base/0']
37 url = 'http://%s:9060/ibm/console' % unit.info['public-address']55 url = 'http://%s:9060/ibm/console' % unit.info['public-address']
38 response = requests.get(url)56 response = requests.get(url)
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.
40 response.raise_for_status()58 response.raise_for_status()
4159
42if __name__ == '__main__':60if __name__ == '__main__':
43 unittest.main()61 unittest.main()
62

Subscribers

People subscribed via source and target branches

to all changes: