Merge lp:~ibmcharmers/charms/trusty/was-base/devel into lp:~umasv1987/charms/trusty/was-base/was-basefix

Proposed by Geetha S
Status: Needs review
Proposed branch: lp:~ibmcharmers/charms/trusty/was-base/devel
Merge into: lp:~umasv1987/charms/trusty/was-base/was-basefix
Diff against target: 1004 lines (+390/-313)
10 files modified
README.md (+57/-14)
config.yaml (+7/-5)
hooks/config-changed (+255/-213)
hooks/install (+3/-16)
hooks/start (+13/-9)
hooks/stop (+12/-7)
hooks/website-relation-changed (+1/-1)
hooks/website-relation-joined (+1/-1)
tests/10-bundles-test.py (+41/-44)
tests/local.yaml (+0/-3)
To merge this branch: bzr merge lp:~ibmcharmers/charms/trusty/was-base/devel
Reviewer Review Type Date Requested Status
vsr (community) Needs Fixing
Review via email: mp+264820@code.launchpad.net
To post a comment you must log in.
14. By Geetha S

WAS Base Committing Changes

15. By Geetha S

WAS Base Committing Changes

16. By Geetha S

WAS Base Committing Changes

Revision history for this message
vsr (vsasi) wrote :

Please update as per our - update to host file, relation-changed hook

review: Needs Fixing
17. By Geetha S

Committing WAS Base changes

18. By Geetha S

Committing WAS Base changes

19. By Geetha S

WAS Base Committing Changes

20. By Geetha S

WAS Base Committing Formmatting changes

21. By Geetha S

Committing spelling and formatting changes for WAS Base

22. By Geetha S

Committing spelling and formatting changes for WAS Base

23. By Geetha S

Committing spelling and formatting changes for WAS Base

24. By Geetha S

Committing spelling and formatting changes for WAS Base

25. By Geetha S

Committing ppc64le related changes for WAS Base

26. By Geetha S

Committing ppc64le related changes for WAS Base

27. By Geetha S

Committing ppc64le related changes for WAS Base

28. By Geetha S

Committing testcase changes for WAS Base

29. By Geetha S

Committing testcase related changes for WAS Base

30. By Geetha S

Committing code changes for WAS Base

31. By Geetha S

Committing start/stop hook changes

32. By Geetha S

Committing reverse proxy test case

Unmerged revisions

32. By Geetha S

Committing reverse proxy test case

31. By Geetha S

Committing start/stop hook changes

30. By Geetha S

Committing code changes for WAS Base

29. By Geetha S

Committing testcase related changes for WAS Base

28. By Geetha S

Committing testcase changes for WAS Base

27. By Geetha S

Committing ppc64le related changes for WAS Base

26. By Geetha S

Committing ppc64le related changes for WAS Base

25. By Geetha S

Committing ppc64le related changes for WAS Base

24. By Geetha S

Committing spelling and formatting changes for WAS Base

23. By Geetha S

Committing spelling and formatting changes for WAS Base

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'README.md'
--- README.md 2015-07-13 10:13:52 +0000
+++ README.md 2015-08-04 08:54:53 +0000
@@ -3,17 +3,19 @@
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.
6For details on IBM Websphere Application Server please visit "http://www-03.ibm.com/software/products/en/appserv-was".6Details on IBM Websphere Application Server and WAS Base Prduct Page available [here] [WAS-product-page].
77
88
9# Usage9# Usage
1010
11Download your licensed IBM Installation Manager software version 1.5 and above and upload to your apache repository.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.
1212
13Download your licensed IBM Websphere Base software 8.5.5.0 version and upload to your apache repository.13Download your licensed IBM Websphere Base software 8.5.5.0 version and upload to your apache repository.
1414
15Download your licensed IBM Websphere Base software WAS fixpack version 8.5.5.4 and upload to your apache repository.15Download your licensed IBM Websphere Base software WAS fixpack version 8.5.5.4 and upload to your apache repository.
1616
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
17Put 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.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.
1820
1921
@@ -30,7 +32,7 @@
30To install IBM Websphere Application Server Base you need to install IBM Installation Manager software as prerequisite.32To install IBM Websphere Application Server Base you need to install IBM Installation Manager software as prerequisite.
31To 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/).33To 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/).
3234
33To install the downloaded binaries you must agree to the IBM license. You can view the full license for IBM Installation Manager and IBM WebSphere Application Server Base by visiting the [Software license agreements search website](http://www-03.ibm.com/software/sla/sladb.nsf/search). Search for "IBM Installation Manager" and "IBM Websphere Application Server" and choose the license that applies to the version you are using.35To 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.
3436
3537
36Run the following to deploy this charm:38Run the following to deploy this charm:
@@ -83,7 +85,7 @@
83 85
8486
85`im_file_name`87`im_file_name`
86The IBM Installation Manager Package name. If not set, It is assigned the value "Install_Mgr_v1.6.2_Lnx_WASv8.5.5.zip" for x86_64 based machine.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.
8789
88`sha_im`90`sha_im`
89Checksum 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.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.
@@ -91,19 +93,60 @@
91#IBM WAS Base Information93#IBM WAS Base Information
9294
93(1) General Information 95(1) General Information
94Information on IBM WAS available at the [WAS Infocenter] (http://www-01.ibm.com/support/knowledgecenter/SSAW57_8.5.5/as_ditamaps/was855_welcome_ndmp.html?lang=en).96Information on IBM WAS available [here] [WAS-Infocenter]
9597
96(2) Download Information98(2) Download Information
97Information on procuring WAS product is available at the [Passport Advantage Site](http://www-01.ibm.com/software/passportadvantage/).99
98100Downloadable Package Names for 'x86_64' based machine:
99Refer this URL for WAS 8.5.5.0 download (http://www-01.ibm.com/support/docview.wss?uid=swg27038625).101WAS_V8.5.5_1_OF_3.zip
100102WAS_V8.5.5_2_OF_3.zip
101Refer this URL for WAS 8.5.5.4 fixpack download (http://www-01.ibm.com/support/docview.wss?uid=swg24038539).103WAS_V8.5.5_3_OF_3.zip
1021048.5.5-WS-WAS-FP0000004-part1.zip
103A trial version is available [here] ( http://www.ibm.com/developerworks/downloads/ws/was/index.html).1058.5.5-WS-WAS-FP0000004-part2.zip
104106
105Refer this URL for more information about Downloadable files (http://www-01.ibm.com/support/docview.wss?uid=swg24038380).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]
106124
107(3) Contact Information125(3) Contact Information
108126
109For 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
110153
=== modified file 'config.yaml'
--- config.yaml 2015-07-13 10:13:52 +0000
+++ config.yaml 2015-08-04 08:54:53 +0000
@@ -4,14 +4,14 @@
4 default: ""4 default: ""
5 description: |5 description: |
6 Download url for WAS Base packages, This is the URL containing WAS Base packages,6 Download url for WAS Base packages, This is the URL containing WAS Base packages,
7 mention till the folder which contains packages ex: http://9.124.100.99/debs/WAS-BASE/.7 mention till the folder which contains packages ex: http://<ip-address>/debs/WAS-BASE/.
8 im_install_path:8 im_install_path:
9 type: string9 type: string
10 default: "/opt/IBM/InstallationManager"10 default: "/opt/IBM/InstallationManager"
11 description: |11 description: |
12 Install Location for Installation Manager.Please enter the path 12 Install Location for Installation Manager.Please enter the path
13 where you wants to install Install Manager ex : /opt/IBM/InstallationManager 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.14 here IM will install at this location, It can be changed if IM needs to be installed at some other place.
15 im_file_name:15 im_file_name:
16 type: string16 type: string
17 default: ""17 default: ""
@@ -26,19 +26,21 @@
26 description: |26 description: |
27 The IBM WebSphere Application Server software comes with special terms and27 The IBM WebSphere Application Server software comes with special terms and
28 conditions from IBM. The WebSphere software can only be used by 28 conditions from IBM. The WebSphere software can only be used by
29 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.
30 accept-ibm-im-license:31 accept-ibm-im-license:
31 type: boolean32 type: boolean
32 default: False 33 default: False
33 description: |34 description: |
34 The IBM Installation Manager software comes with special terms and35 The IBM Installation Manager software comes with special terms and
35 conditions from IBM. The Installation Manager software can only be used by36 conditions from IBM. The Installation Manager software can only be used by
36 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.
37 sha_im:39 sha_im:
38 type: string40 type: string
39 default: ""41 default: ""
40 description: |42 description: |
41 Checksum value to check integrity of IBM IM pacakage. The Charm uses43 Checksum value to check integrity of IBM IM package. The Charm uses
42 sha1sum to check the integrity. For example, run the command: 44 sha1sum to check the integrity. For example, run the command:
43 <sha1sum Install_Mgr_v1.6.2_Lnx_WASv8.5.5.zip | cut -d " " -f1> 45 <sha1sum Install_Mgr_v1.6.2_Lnx_WASv8.5.5.zip | cut -d " " -f1>
44 to get the checksum value for IBM Installation Manager pacakage.46 to get the checksum value for IBM Installation Manager pacakage.
4547
=== modified file 'hooks/config-changed'
--- hooks/config-changed 2015-07-13 10:13:52 +0000
+++ hooks/config-changed 2015-08-04 08:54:53 +0000
@@ -9,9 +9,9 @@
9is_im_installed()9is_im_installed()
10{10{
11 if [ -f $IM_INSTALL_PATH/eclipse/IBMIM ]; then11 if [ -f $IM_INSTALL_PATH/eclipse/IBMIM ]; then
12 echo "True"12 echo "True"
13 else13 else
14 echo "False"14 echo "False"
15 fi15 fi
1616
17}17}
@@ -21,9 +21,9 @@
21is_was_base_installed()21is_was_base_installed()
22{22{
23 if [ -d $WAS_BASE_INSTALL_PATH/bin ]; then23 if [ -d $WAS_BASE_INSTALL_PATH/bin ]; then
24 echo "True"24 echo "True"
25 else25 else
26 echo "False"26 echo "False"
27 fi27 fi
2828
29}29}
@@ -35,26 +35,29 @@
3535
36 was_base_installed=`is_was_base_installed`36 was_base_installed=`is_was_base_installed`
37 if [ $was_base_installed == True ]; then37 if [ $was_base_installed == True ]; then
38 juju-log "IBM WAS Base: Removing WAS BASE Installation"38 juju-log "IBM WAS Base: Removing WAS BASE Installation"
39 juju-log "IBM WAS Base: Server stopping"39 juju-log "IBM WAS Base: Server stopping"
40 $WAS_BASE_INSTALL_PATH/profiles/test/bin/stopServer.sh server140 $WAS_BASE_INSTALL_PATH/profiles/test/bin/stopServer.sh server1
41 if [ "$?" -ne "0" ]; then41 if [ "$?" -ne "0" ]; then
42 juju-log "IBM WAS Base: Error while stoping the server"42 juju-log "IBM WAS Base: Error while stopping the server"
43 else43 else
44 juju-log "IBM WAS Base: Server stopped successfully"44 juju-log "IBM WAS Base: Server stopped successfully"
45 fi45 fi
4646
47 # Uninstalling WAS BASE47 # Uninstalling WAS BASE
48 $IM_INSTALL_PATH/eclipse/tools/imcl uninstall com.ibm.websphere.BASE.v85 -installationDirectory $WAS_BASE_INSTALL_PATH48 $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 ]; then49 if [ -d /root/IBM/WebSphere/AppServer/V85/BASE ]; then
50 juju-log "IBM WAS Base: Removing install dir"50 juju-log "IBM WAS Base: Removing installation directory"
51 cd /root51 cd /root
52 rm -rf IBM/WebSphere/AppServer/V85/BASE 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
53 else58 else
54 juju-log "IBM WAS Base: Install directory is not exist"59 juju-log "IBM WAS Base: WAS Base software has not been installed."
55 fi60 fi
56 fi
57 juju-log "IBM WAS Base: Uninstalling WAS BASE software completed"
58}61}
5962
60#Remove IM, if installed63#Remove IM, if installed
@@ -62,9 +65,9 @@
62{65{
63 im_installed=`is_im_installed`66 im_installed=`is_im_installed`
64 if [ $im_installed == True ]; then67 if [ $im_installed == True ]; then
65 juju-log "IBM WAS Base: Removing IBM IM software."68 juju-log "IBM WAS Base: Removing IBM IM software."
66 /root/var/ibm/InstallationManager/uninstall/uninstallc69 /root/var/ibm/InstallationManager/uninstall/uninstallc
67 juju-log "IBM WAS Base: Removed IBM IM software"70 juju-log "IBM WAS Base: Removed IBM IM software"
68 fi71 fi
6972
70}73}
@@ -74,27 +77,27 @@
74{77{
7578
76 if [ $1 == False ]; then79 if [ $1 == False ]; then
77 juju-log "IBM WAS Base: Removing IBM WebSphere (if installed) as the license agreement is not accepted."80 juju-log "IBM WAS Base: Removing IBM WebSphere (if installed) as the license agreement is not accepted."
78 if [ -f $IM_INSTALL_PATH/eclipse/IBMIM ]; then81 if [ -f $IM_INSTALL_PATH/eclipse/IBMIM ]; then
79 juju-log "IBM WAS Base: IBM IM exists "82 juju-log "IBM WAS Base: IBM IM exists "
80 remove_was_base_software 83 remove_was_base_software
81 else84 else
82 juju-log "IBM WAS Base: IBM IM not exists and hence exiting from WAS unistalling"85 juju-log "IBM WAS Base: IBM IM does not exist and hence exiting from WAS uninstalling"
83 exit 0 86 exit 0
84 fi87 fi
85 fi88 fi
86 if [ $2 == False ]; then89 if [ $2 == False ]; then
87 juju-log "IBM WAS Base: Removing IBM IM (if installed) as the license agreement is not accepted."90 juju-log "IBM WAS Base: Removing IBM IM (if installed) as the license agreement is not accepted."
8891
89 #Check any dependent products exists like WAS92 #Check any dependent products exists like WAS
9093
91 if [ -d $WAS_BASE_INSTALL_PATH/bin ]; then94 if [ -d $WAS_BASE_INSTALL_PATH/bin ]; then
92 juju-log "IBM WAS Base: Can not uninstall IM as its has WAS product installed"95 juju-log "IBM WAS Base: Can not uninstall IM as it has WAS product installed"
93 exit 096 exit 0
94 else97 else
95 juju-log "IBM WAS Base: Uninstall IBM IM software"98 juju-log "IBM WAS Base: Uninstall IBM IM software"
96 remove_im_software99 remove_im_software
97 fi100 fi
98 fi101 fi
99102
100}103}
@@ -109,7 +112,7 @@
109 fi112 fi
110 113
111 # If an install IM done, get the name of the package from which it was done114 # If an install IM done, get the name of the package from which it was done
112 if [ -f $CHARM_DIR/$ARCHIVE_DIR/IM/*.zip ]; then 115 if [ -f $CHARM_DIR/$ARCHIVE_DIR/IM/*.zip ]; then
113 im_pkg_name=`ls $CHARM_DIR/$ARCHIVE_DIR/IM/*.zip` 116 im_pkg_name=`ls $CHARM_DIR/$ARCHIVE_DIR/IM/*.zip`
114 if [ $? == 0 ]; then117 if [ $? == 0 ]; then
115 im_pkg_name=`basename $im_pkg_name`118 im_pkg_name=`basename $im_pkg_name`
@@ -120,42 +123,38 @@
120 cfg_im_pkg_name=$im_file_name123 cfg_im_pkg_name=$im_file_name
121 124
122 # Set package name to a predefined value if the user has not provided a package name125 # Set package name to a predefined value if the user has not provided a package name
123 if [ "$cfg_im_pkg_name" == "" ]; then126 if [ "$cfg_im_pkg_name" == "" ]; then
124 ARCHITECTURE=`uname -m`127 if [ "$ARCHITECTURE" = "x86_64" ]; then
125 if [ "$ARCHITECTURE" = "x86_64" ] || [ "$ARCHITECTURE" = "ppc64le" ]; then128 cfg_im_pkg_name="Install_Mgr_v1.6.2_Lnx_WASv8.5.5.zip"
126 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"
127 else131 else
128 juju-log "IBM WAS Base: Platform not supported for IM."132 juju-log "IBM WAS Base: Platform not supported for IM."
129 exit 1133 exit 1
130 fi134 fi
131 fi135 fi
132 136
133 # The user has configured a different package name137 # The user has configured a different package name
134 if [ "$im_pkg_name" != "$cfg_im_pkg_name" ]; then138 if [ "$im_pkg_name" != "$cfg_im_pkg_name" ]; then
135
136 #Download the new IM package
137 set +e139 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
138 juju-log "IBM WAS Base: Downloading IM package."148 juju-log "IBM WAS Base: Downloading IM package."
139
140 wget -t 2 -P $CHARM_DIR/$ARCHIVE_DIR/IM $WAS_URL/$cfg_im_pkg_name149 wget -t 2 -P $CHARM_DIR/$ARCHIVE_DIR/IM $WAS_URL/$cfg_im_pkg_name
141
142 if [ $? == 0 ]; then150 if [ $? == 0 ]; then
143 juju-log "IBM WAS Base: Downloaded IM package."151 juju-log "IBM WAS Base: Downloaded IM package."
144 # Delete previously downloaded and installed IM software
145 if [ "$im_pkg_name" != "" ]; then
146 juju-log "IBM WAS Base: Deleting the older IM package."
147 rm $CHARM_DIR/$ARCHIVE_DIR/IM/$im_pkg_name
148 remove_was_base_software
149 remove_im_software
150 fi
151
152 else152 else
153 juju-log "IBM WAS Base: Download of IM package failed."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."154 juju-log "IBM WAS Base: Ensure the download URL and package name are correctly set in the charm configuration."
155 exit 0155 exit 0
156 fi156 fi
157 set -e157 set -e
158
159 fi158 fi
160 159
161 # Check integrity of downloaded package 160 # Check integrity of downloaded package
@@ -176,208 +175,251 @@
176 if [ "$WAS_URL" == "" ]; then175 if [ "$WAS_URL" == "" ]; then
177 juju-log "IBM WAS Base: URL to download IBM WAS Base package is not configured."176 juju-log "IBM WAS Base: URL to download IBM WAS Base package is not configured."
178 exit 0177 exit 0
179 else178 else
180 juju-log "Downloading WAS Base Packages"179 juju-log "Downloading WAS Base Packages"
181 was_base_pkg1="WAS_V8.5.5_1_OF_3.zip"180 was_base_pkg1="WAS_V8.5.5_1_OF_3.zip"
182 was_base_pkg2="WAS_V8.5.5_2_OF_3.zip"181 was_base_pkg2="WAS_V8.5.5_2_OF_3.zip"
183 was_base_pkg3="WAS_V8.5.5_3_OF_3.zip"182 was_base_pkg3="WAS_V8.5.5_3_OF_3.zip"
184 was_base_fixpack1="8.5.5-WS-WAS-FP0000004-part1.zip"183 was_base_fixpack1="8.5.5-WS-WAS-FP0000004-part1.zip"
185 was_base_fixpack2="8.5.5-WS-WAS-FP0000004-part2.zip"184 was_base_fixpack2="8.5.5-WS-WAS-FP0000004-part2.zip"
186 if [ -f $CHARM_DIR/$ARCHIVE_DIR/$was_base_pkg1 -a -f $CHARM_DIR/$ARCHIVE_DIR/$was_base_pkg2 -a -f $CHARM_DIR/$ARCHIVE_DIR/$was_base_pkg3 -a -f $CHARM_DIR/$ARCHIVE_DIR/$was_base_fixpack1 -a -f $CHARM_DIR/$ARCHIVE_DIR/$was_base_fixpack2 ];then185 was_base_ppc64le_pkg1="WAS_V8.5.5_FOR_POWERLE_ML.zip"
187 juju-log " IBM WAS Base:Reinstalling WAS Base, Downloaded Packages already exists in Archive Dir. "186 was_base_ppc64le_pkg2="WAS_V8.5.5_2_OF_2_FOR_POWERLE_ML.zip"
188 else187 was_base_ppc64le_fixpack1="8.5.5-WS-WAS-LE-FP0000006-part1.zip"
189 wget $WAS_URL/$was_base_pkg1 $WAS_URL/$was_base_pkg2 $WAS_URL/$was_base_pkg3 $WAS_URL/$was_base_fixpack1 $WAS_URL/$was_base_fixpack2188 was_base_ppc64le_fixpack2="8.5.5-WS-WAS-LE-FP0000006-part2.zip"
190 if [ $? == 0 ]; then189
191 juju-log "IBM WAS Base: Downloaded WAS Base packages sucessfully"190 if [ "$ARCHITECTURE" == "x86_64" ];then
192 fi191 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
193 fi192 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
194 fi210 fi
195 211
196 # Check integrity of downloaded package 212 # Check integrity of downloaded package
197 if [ "b9cc0b783b482de2092d5c387de05cda2e922413" != "`sha1sum $CHARM_DIR/$ARCHIVE_DIR/WAS_V8.5.5_1_OF_3.zip | cut -d" " -f1`" ]; then213 if [ "$ARCHITECTURE" == "x86_64" ];then
198 juju-log "IBM WAS Base: IBM WAS package1 is corrupt."214 if [ "b9cc0b783b482de2092d5c387de05cda2e922413" != "`sha1sum $CHARM_DIR/$ARCHIVE_DIR/$was_base_pkg1 | cut -d" " -f1`" ]; then
199 exit 0215 juju-log "IBM WAS Base: IBM WAS package1 is corrupt."
200 fi216 exit 0
201 if [ "74a52b1b5aaedd67c0727db90aff9dc63ff28f4e" != "`sha1sum $CHARM_DIR/$ARCHIVE_DIR/WAS_V8.5.5_2_OF_3.zip | cut -d" " -f1`" ]; then217 fi
202 juju-log "IBM WAS Base: IBM WAS package2 is corrupt."218 if [ "74a52b1b5aaedd67c0727db90aff9dc63ff28f4e" != "`sha1sum $CHARM_DIR/$ARCHIVE_DIR/$was_base_pkg2 | cut -d" " -f1`" ]; then
203 exit 0219 juju-log "IBM WAS Base: IBM WAS package2 is corrupt."
204 fi220 exit 0
205 if [ "e6943fa4a4a7a1384fad1faa54289106f0e57979" != "`sha1sum $CHARM_DIR/$ARCHIVE_DIR/WAS_V8.5.5_3_OF_3.zip | cut -d" " -f1`" ]; then221 fi
206 juju-log "IBM WAS Base: IBM WAS package3 is corrupt."222 if [ "e6943fa4a4a7a1384fad1faa54289106f0e57979" != "`sha1sum $CHARM_DIR/$ARCHIVE_DIR/$was_base_pkg3 | cut -d" " -f1`" ]; then
207 exit 0223 juju-log "IBM WAS Base: IBM WAS package3 is corrupt."
208 fi224 exit 0
209 if [ "895863b932334a78cccce6c73ec98d35ba98639b" != "`sha1sum $CHARM_DIR/$ARCHIVE_DIR/8.5.5-WS-WAS-FP0000004-part1.zip | cut -d" " -f1`" ]; then225 fi
210 juju-log "IBM WAS Base: IBM WAS Fix Pack part1 is corrupt."226 if [ "895863b932334a78cccce6c73ec98d35ba98639b" != "`sha1sum $CHARM_DIR/$ARCHIVE_DIR/$was_base_fixpack1 | cut -d" " -f1`" ]; then
211 exit 0227 juju-log "IBM WAS Base: IBM WAS Fix Pack part1 is corrupt."
212 fi228 exit 0
213 if [ "8f8560746c6fb0f87cd47801a014e7c34fccc4cc" != "`sha1sum $CHARM_DIR/$ARCHIVE_DIR/8.5.5-WS-WAS-FP0000004-part2.zip | cut -d" " -f1`" ]; then229 fi
214 juju-log "IBM WAS Base: IBM WAS Fix Pack part2 is corrupt."230 if [ "8f8560746c6fb0f87cd47801a014e7c34fccc4cc" != "`sha1sum $CHARM_DIR/$ARCHIVE_DIR/$was_base_fixpack2 | cut -d" " -f1`" ]; then
215 exit 0231 juju-log "IBM WAS Base: IBM WAS Fix Pack part2 is corrupt."
216 fi232 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
217}253}
218254
219255
220
221
222
223juju-log "IBM WAS BASE: Begin config-change hook"256juju-log "IBM WAS BASE: Begin config-change hook"
224was_base_license_accepted=`config-get accept-ibm-websphere-license`257was_base_license_accepted=`config-get accept-ibm-websphere-license`
225im_license_accepted=`config-get accept-ibm-im-license`258im_license_accepted=`config-get accept-ibm-im-license`
226IM_INSTALL_PATH=`config-get im_install_path`259IM_INSTALL_PATH=`config-get im_install_path`
227WAS_URL=`config-get was_url`260WAS_URL=`config-get was_url`
228im_file_name=`config-get im_file_name`261im_file_name=`config-get im_file_name`
262ARCHITECTURE=`uname -m`
229263
230# 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
231remove_unaccepted_software $was_base_license_accepted $im_license_accepted265remove_unaccepted_software $was_base_license_accepted $im_license_accepted
232if [ $im_license_accepted == False ]; then266if [ $im_license_accepted == False ]; then
233 juju-log "IBM WAS Base: Websphere IM License not accepted."267 juju-log "IBM WAS Base: Websphere IM License not accepted."
234268
235elif [ $im_license_accepted == True ]; then269elif [ $im_license_accepted == True ]; then
236 juju-log "IBM WAS Base: IBM IM License accepted"270 juju-log "IBM WAS Base: IBM IM License accepted"
237 juju-log "IBM WAS Base: downloading and extracting IM packages"271 download_IM
238 cd $CHARM_DIR/$ARCHIVE_DIR272 im_inst=`is_im_installed`
239 if [ -d $CHARM_DIR/$ARCHIVE_DIR/IM ];then273 if [ $im_inst == False ]; then
240 juju-log "IBM WAS Base: Removing Existing IM DIR. Cresting new IM DIR"
241 rm -rf $CHARM_DIR/$ARCHIVE_DIR/IM
242 fi
243 mkdir IM
244 cd IM
245 download_IM
246 if [ -f $CHARM_DIR/$ARCHIVE_DIR/IM/*.zip ]; then274 if [ -f $CHARM_DIR/$ARCHIVE_DIR/IM/*.zip ]; then
247 unzip $CHARM_DIR/$ARCHIVE_DIR/IM/*.zip -d $CHARM_DIR/$ARCHIVE_DIR/IM 275 juju-log "IBM WAS Base: downloading and extracting IM packages"
248 if [ $? != 0 ]; then276 if [ -f $CHARM_DIR/$ARCHIVE_DIR/IM/userinstc ]; then
249 juju-log "IBM WAS Base: Unable to extract the IM package content. Verify whether the package is corrupt."277 juju-log "IBM WAS Base: IBM IM package contents extracted already."
250 # Remove corrupt archive file278 else
251 rm -f $CHARM_DIR/$ARCHIVE_DIR/IM/*.zip279 unzip $CHARM_DIR/$ARCHIVE_DIR/IM/*.zip -d $CHARM_DIR/$ARCHIVE_DIR/IM
252 exit 0280 if [ $? != 0 ]; then
253 fi281 juju-log "IBM WAS Base: Unable to extract the IM package content. Verify whether the package is corrupt."
254 fi282 # Remove corrupt archive file
255283 rm -f $CHARM_DIR/$ARCHIVE_DIR/IM/*.zip
256 im_inst=`is_im_installed`284 exit 0
257 if [ $im_inst == False ]; then 285 fi
286 fi
287 fi
258 juju-log "IBM WAS Base: IM installation start"288 juju-log "IBM WAS Base: IM installation start"
259 # Check IM package availability289 # Check IM package availability
260 juju-log $CHARM_DIR/$ARCHIVE_DIR290 juju-log $CHARM_DIR/$ARCHIVE_DIR
261 if [ -f $CHARM_DIR/$ARCHIVE_DIR/IM/userinstc ];291 if [ -f $CHARM_DIR/$ARCHIVE_DIR/IM/userinstc ];
262 then292 then
263 juju-log "IBM WAS Base: IM Packages available for installation."293
264 cp $CHARM_DIR/$ARCHIVE_DIR/IM/install.xml $CHARM_DIR/$ARCHIVE_DIR/IM/silent_install.xml294 juju-log "IBM WAS Base: IM Packages available for installation."
265 sed -i "2 a \<profile kind='self' installLocation='$IM_INSTALL_PATH' id='IBM Installation Manager'>\n <data key='eclipseLocation' value='$IM_INSTALL_PATH' />\n</profile>" $CHARM_DIR/$ARCHIVE_DIR/IM/silent_install.xml295 cp $CHARM_DIR/$ARCHIVE_DIR/IM/install.xml $CHARM_DIR/$ARCHIVE_DIR/IM/silent_install.xml
266 $CHARM_DIR/$ARCHIVE_DIR/IM/userinstc -input $CHARM_DIR/$ARCHIVE_DIR/IM/silent_install.xml -acceptlicense296 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
267297 $CHARM_DIR/$ARCHIVE_DIR/IM/userinstc -input $CHARM_DIR/$ARCHIVE_DIR/IM/silent_install.xml -acceptlicense
268
269 if [ $? == 0 ]298 if [ $? == 0 ]
270 then299 then
271 juju-log "IBM WAS Base: IM Is installed successfully"300 juju-log "IBM WAS Base: IM Is installed successfully"
272 else301 else
273 juju-log "IBM WAS Base: Error while installing IM"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";
274 exit 1309 exit 1
275 fi310 fi
276311 else
277 else312 juju-log "IBM WAS Base: IBM IM Installed already using same package name."
278 juju-log "IBM WAS Base: IM Packages missing. Please check README file"313 fi
279 juju-log "IBM WAS Base: Upgrade IM charm after adding the IM packages";
280 exit 1
281 fi
282 fi
283else314else
284 juju-log " IBM WAS Base: Acceptable values for license is 'True' or 'False'"315 juju-log " IBM WAS Base: Acceptable values for license is 'True' or 'False'"
285316
286fi317fi
287318
288if [ $was_base_license_accepted == False ]; then319if [ $was_base_license_accepted == False ]; then
289 juju-log "IBM WAS Base: Websphere BASE License not accepted."320 juju-log "IBM WAS Base: Websphere BASE License not accepted."
290
291elif [ $was_base_license_accepted == True ]; then321elif [ $was_base_license_accepted == True ]; then
292 juju-log "IBM WAS Base: Check WAS Base package availability"322 juju-log "IBM WAS Base: Check WAS Base package availability"
293 cd $CHARM_DIR/$ARCHIVE_DIR323 is_was_base_installed=`is_was_base_installed`
324 if [ $is_was_base_installed == False ];then
294 download_WAS325 download_WAS
295 if [ -d "$CHARM_DIR/$ARCHIVE_DIR/disk1" ];then326 if [ -d "$CHARM_DIR/$ARCHIVE_DIR/disk1" ];then
296 juju-log "IBM WAS Base: Reinstalling WAS BASE, unzipped package contents aavailable"327 juju-log "IBM WAS Base: Installing WAS Base, unzipped package contents aavailable"
297 else328 else
298 unzip 'WAS_*.zip'329 unzip $CHARM_DIR/$ARCHIVE_DIR/'WAS_*.zip' -d $CHARM_DIR/$ARCHIVE_DIR/
299 if [ $? != 0 ]; then330 if [ $? != 0 ]; then
300 juju-log "IBM WAS Base: Unable to extract the WAS packages content. Verify whether the package is corrupt."331 juju-log "IBM WAS Base: Unable to extract the WAS packages content. Verify whether the package is corrupt."
301 # Remove corrupt archive file332 # Remove corrupt archive file
302 rm -f $CHARM_DIR/$ARCHIVE_DIR/'WAS_*.zip'333 rm -f $CHARM_DIR/$ARCHIVE_DIR/'WAS_*.zip'
303 exit 0334 exit 0
304 else335 else
305 juju-log "IBM WAS Base: Downloaded and Extracted WAS Base Packages Sucessfully"336 juju-log "IBM WAS Base: Downloaded and Extracted WAS Base Packages Sucessfully"
306 fi337 fi
307 fi338 fi
308 if [ -d $CHARM_DIR/$ARCHIVE_DIR/was_fixpack ];then339 if [ -d $CHARM_DIR/$ARCHIVE_DIR/was_fixpack ];then
309 juju-log "IBM WAS Base: WAS Base Fixpack packages are available for upgrading"340 juju-log "IBM WAS Base: WAS Base Fixpack packages are available for upgrading"
310 else341 else
311 mkdir was_fixpack342 unzip $CHARM_DIR/$ARCHIVE_DIR/'8.5.5-WS-WAS*.zip' -d $CHARM_DIR/$ARCHIVE_DIR/was_fixpack/
312 unzip '8.5.5-WS-WAS*.zip' -d $CHARM_DIR/$ARCHIVE_DIR/was_fixpack
313 if [ $? != 0 ]; then343 if [ $? != 0 ]; then
314 juju-log "IBM WAS Base: Unable to extract the WAS Base fixpack packages content. Verify whether the package is corrupt."344 juju-log "IBM WAS Base: Unable to extract the WAS Base fixpack packages content. Verify whether the package is corrupt."
315 # Remove corrupt archive file345 # Remove corrupt archive file
316 rm -f $CHARM_DIR/$ARCHIVE_DIR/8.5.5-WS-WAS*.zip346 rm -f $CHARM_DIR/$ARCHIVE_DIR/8.5.5-WS-WAS*.zip
317 exit 0347 exit 0
318 else348 else
319 juju-log "IBM WAS Base: Downloaded and Extracted WAS Base fixpack Packages Sucessfully"349 juju-log "IBM WAS Base: Downloaded and Extracted WAS Base fixpack Packages Sucessfully"
320 fi fi350 fi
321351 fi
322352 # check WAS package availability
323 # check WAS package availability353 if [ -d "$CHARM_DIR/$ARCHIVE_DIR/disk1" ]; then
324 if [ -d "$CHARM_DIR/$ARCHIVE_DIR/disk1" ]; then 354 juju-log "IBM WAS Base: WAS BASE Packages available for installation.";
325 juju-log "IBM WAS Base: WAS BASE Packages available for installation.";355 #Check IM installation
326 #Check IM installation
327 im_installed=`is_im_installed`356 im_installed=`is_im_installed`
328 if [ $im_installed == True ]; then357 if [ $im_installed == True ]; then
329 358 juju-log "IBM WAS Base: Installing WAS BASE "
330 juju-log "IBM WAS Base: Installing WAS BASE "359 if [ "$ARCHITECTURE" == "x86_64" ];then
331 $IM_INSTALL_PATH/eclipse/tools/imcl install com.ibm.websphere.BASE.v85 -acceptLicense -repositories $CHARM_DIR/$ARCHIVE_DIR/ -installationDirectory $WAS_BASE_INSTALL_PATH -showProgress360 $IM_INSTALL_PATH/eclipse/tools/imcl install com.ibm.websphere.BASE.v85 -acceptLicense -repositories $CHARM_DIR/$ARCHIVE_DIR/ -installationDirectory $WAS_BASE_INSTALL_PATH -showProgress
361 if [ $? == 0 ];
362 then
363 juju-log " IBM WAS Base: WAS Base is installed successfully"
364 else
365 juju-log "IBM WAS Base: Error while installing WAS"
366 exit 1
367 fi
368 elif [ "$ARCHITECTURE" == "ppc64le" ];then
369 $IM_INSTALL_PATH/eclipse/tools/imcl install com.ibm.websphere.BASE.le.v85 -acceptLicense -repositories $CHARM_DIR/$ARCHIVE_DIR/ -installationDirectory $WAS_BASE_INSTALL_PATH -showProgress
370 if [ $? == 0 ];
371 then
372 juju-log " IBM WAS Base: WAS Base is installed successfully"
373 else
374 juju-log "IBM WAS Base: Error while installing WAS"
375 exit 1
376 fi
377
378 fi
379 else
380 juju-log "IBM WAS Base: IM needs to be installed before installing WAS."
381 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
332 if [ $? == 0 ];398 if [ $? == 0 ];
333 then399 then
334 juju-log " IBM WAS Base: WAS Base is installed successfully"400 juju-log " IBM WAS Base: WAS fixpack installed successfully"
335 else401 else
336 juju-log "IBM WAS Base: Error while installing WAS"402 juju-log "IBM WAS Base: Error while installing WAS fixpack"
337 exit 1403 exit 1
338 fi404 fi
339 else405 #starting the server
340 juju-log "IBM WAS Base: IM is not installaed to install WAS"406 cd $WAS_BASE_INSTALL_PATH/profiles/test/bin/
341 exit 0407 juju-log "IBM WAS Base: Server Starting"
342 fi408 ./startServer.sh server1
343409 if [ "$?" -ne "0" ]; then
344 juju-log "IBM WAS Base: creating a profile"410 juju-log "IBM WAS Base: Error while starting the server"
345 #sh does not work in ubuntu so linking to bash411 else
346412 juju-log "IBM WAS Base: Server started successfully"
347 juju-log "IBM WAS Base: Unlink /bin/sh"413 fi
348 unlink /bin/sh414
349 ln -s /bin/bash /bin/sh415
350 juju-log "IBM WAS Base: creating a profile"
351
352 $WAS_BASE_INSTALL_PATH/bin/manageprofiles.sh -create -profileName "test" -profilePath "$WAS_BASE_INSTALL_PATH/profiles/test" -templatePath "$WAS_BASE_INSTALL_PATH/profileTemplates/default" -nodeName "node1" -cellName "cell1" -serverName "server1" -adminUserName "wasadmin" -adminPassword "wasadmin"
353 juju-log "IBM WAS Base: Profile creation completed"
354
355 #Apply fixpack 8.5.5.4 to upgrade was base version from 8.5.5.0 to 8.5.5.4
356
357 juju-log "IBM WAS Base: Upgrading WAS Base by installing WAS fixpack"
358 $IM_INSTALL_PATH/eclipse/tools/imcl install com.ibm.websphere.BASE.v85_8.5.5004.20141119_1746 -repositories $CHARM_DIR/files/archives/was_fixpack -installationDirectory $WAS_BASE_INSTALL_PATH -acceptLicense -showProgress
359 if [ $? == 0 ];
360 then
361 juju-log " IBM WAS Base: WAS fixpack installed successfully"
362 else416 else
363 juju-log "IBM WAS Base: Error while installing WAS fixpack"417 juju-log "IBM WAS Base: WAS BASE Packages are not available"
364 exit 1
365 fi418 fi
366 else419 else
367 juju-log "IBM WAS Base: WAS BASE Packages are not available"420 juju-log "IBM WAS Base: IBM WAS Base Software installed already"
368 fi421 fi
369else422else
370 juju-log "IBM WAS Base: Acceptable values for license is 'True' or 'False'"423 juju-log "IBM WAS Base: Acceptable values for license is 'True' or 'False'"
371fi424fi
372425juju-log "IBM WAS Base: End Config-Changed hook..."
373#starting the server
374 cd $WAS_BASE_INSTALL_PATH/profiles/test/bin/
375 juju-log "IBM WAS Base: Server Starting"
376 ./startServer.sh server1
377 if [ "$?" -ne "0" ]; then
378 juju-log "IBM WAS Base: Error while starting the server"
379 else
380 juju-log "IBM WAS Base: Server started successfully"
381
382 fi
383
384426
=== modified file 'hooks/install'
--- hooks/install 2015-07-13 10:13:52 +0000
+++ hooks/install 2015-08-04 08:54:53 +0000
@@ -9,28 +9,15 @@
9apt-get install -y wget 9apt-get install -y wget
10juju-log "IBM WAS Base: wget downloaded and installed."10juju-log "IBM WAS Base: wget downloaded and installed."
1111
12# Need to update hostname in /etc/hosts
13 private_address=`unit-get private-address`
14 juju-log "private_address : $private_address"
15 echo "$private_address `hostname`" >> /etc/hosts
16 if [ $? == 0 ];
17 then
18 juju-log "hostname updated"
19 else
20 juju-log "Error while updating /etc/hosts"
21 fi
22
23#Install unzip12#Install unzip
24juju-log "IBM WAS Base: Downloading and installng unzip."13juju-log "IBM WAS Base: Downloading and installng unzip."
25apt-get install -y unzip14apt-get install -y unzip
26juju-log "IBM WAS Base: unzip downloaded and installed."15juju-log "IBM WAS Base: unzip downloaded and installed."
2716
28ARCHITECTURE=`uname -m`17ARCHITECTURE=`uname -m`
29if [ "$ARCHITECTURE" != "x86_64" ] || [ "$ARCHITECTURE" = "ppc64le" ]; then18if [ "$ARCHITECTURE" != "x86_64" -a "$ARCHITECTURE" != "ppc64le" ]; then
30juju-log "IBM WAS Base: Unsupported platform. IBM WAS Base installed with this Charm supports only the x86_64 and ppc64le platforms."19 juju-log "IBM WAS Base: Unsupported platform. IBM WAS Base installed with this Charm supports only the x86_64 and ppc64le platforms."
31exit 120 exit 1
32fi21fi
3322
34juju-log "IBM WAS Base: IM and WAS packages downloaded. Awaiting acceptance of license (see README on how to accept the license)."
35
36juju-log "IBM WAS Base: End Install."23juju-log "IBM WAS Base: End Install."
3724
=== modified file 'hooks/start'
--- hooks/start 2015-07-13 10:13:52 +0000
+++ hooks/start 2015-08-04 08:54:53 +0000
@@ -5,16 +5,20 @@
5#server_status=` ps -ef | grep '$WAS_BASE_INSTALL_PATH'`5#server_status=` ps -ef | grep '$WAS_BASE_INSTALL_PATH'`
6netstat -nltp | grep 9060 6netstat -nltp | grep 9060
7if [ "$?" -eq "0" ];then7if [ "$?" -eq "0" ];then
8juju-log "IBM WAS Base: WAS Base Server already started"8 juju-log "IBM WAS Base: WAS Base Server already started"
9else9else
10cd $WAS_BASE_INSTALL_PATH/profiles/test/bin/10 if [ -d $WAS_BASE_INSTALL_PATH/profiles/test/bin ]; then
11 ./startServer.sh server111 cd $WAS_BASE_INSTALL_PATH/profiles/test/bin/
12 if [ "$?" -ne "0" ]; then12 ./startServer.sh server1
13 juju-log "IBM WAS Base: Error while starting the server"13 if [ "$?" -ne "0" ]; then
14 else14 juju-log "IBM WAS Base: Error while starting the server"
15 juju-log "IBM WAS Base: Server started successfully"15 else
1616 juju-log "IBM WAS Base: Server started successfully"
17 fi17 fi
18 else
19 juju-log "IBM WAS Base: No server to start, exiting."
20 exit 0
21 fi
18fi22fi
1923
20open-port 906024open-port 9060
2125
=== modified file 'hooks/stop'
--- hooks/stop 2015-07-08 05:29:41 +0000
+++ hooks/stop 2015-08-04 08:54:53 +0000
@@ -3,12 +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 ./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
13close-port 906018close-port 9060
14close-port 944319close-port 9443
1520
=== modified file 'hooks/website-relation-changed'
--- hooks/website-relation-changed 2015-07-13 10:13:52 +0000
+++ hooks/website-relation-changed 2015-08-04 08:54:53 +0000
@@ -1,3 +1,3 @@
1#!/bin/sh1#!/bin/sh
2relation-set hostname=`unit-get private-address` port=9060 https-port=9443
23
3relation-set hostname=`unit-get private-address` port=9060
44
=== modified file 'hooks/website-relation-joined'
--- hooks/website-relation-joined 2015-07-13 10:13:52 +0000
+++ hooks/website-relation-joined 2015-08-04 08:54:53 +0000
@@ -8,5 +8,5 @@
8 juju-log "Delete the relation. Accept the IBM WAS Base License, as per the README, before setting up any relation."8 juju-log "Delete the relation. Accept the IBM WAS Base License, as per the README, before setting up any relation."
9 exit 09 exit 0
10fi10fi
11relation-set hostname=`unit-get private-address` port=906011relation-set hostname=`unit-get private-address` port=9060 https-port=9443
12juju-log "IBM WAS Base: End website-relation-joined hook."12juju-log "IBM WAS Base: End website-relation-joined hook."
1313
=== modified file 'tests/10-bundles-test.py'
--- tests/10-bundles-test.py 2015-07-13 10:13:52 +0000
+++ tests/10-bundles-test.py 2015-08-04 08:54:53 +0000
@@ -12,67 +12,64 @@
12# 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
13seconds_to_wait = 240013seconds_to_wait = 2400
1414
15
16class BundleTest(unittest.TestCase):15class BundleTest(unittest.TestCase):
17 """ Create a class for testing the charm in the unit test framework. """
18 @classmethod16 @classmethod
19 def setUpClass(cls):17 def setUpClass(cls):
20 """ Set up an amulet deployment using the bundle. """18 d = amulet.Deployment()
21 d=amulet.Deployment()19
2220 local_path = os.path.join(os.path.dirname(__file__), 'local.yaml')
23 local_path = os.path.join(os.path.dirname(__file__), 'local.yaml')21 with open(local_path, "r") as fd:
24 with open(local_path, "r") as fd:22 config = yaml.safe_load(fd)
25 config = yaml.safe_load(fd)23
2624 url = config.get('wasbase').get('was_url')
27 url = config.get('wasbase').get('was_url')25 print('Using URL %s' % url)
28 print('Using URL %s' % url)26 # Test if a IB url for the repository is defined
29 # Test if a IB url for the repository is defined27 if not url:
30 if not url:
31 print("You need to define a url for the WAS Base packages repository.\n"28 print("You need to define a url for the WAS Base packages repository.\n"
32 "Edit local.yaml or tests/00-setup and run it again.")29 "Edit local.yaml or tests/00-setup and run it again.")
33 sys.exit(1)30 sys.exit(1)
3431
35 pkg = config.get('wasbase').get('im_file_name')32 pkg = config.get('wasbase').get('im_file_name')
36 print('Using IBM IM package %s' % pkg)33 print('Using IBM IM package %s' % pkg)
37 if not pkg:34 if not pkg:
38 print("You need to define a package name for IBM IM.\n"35 print("You need to define a package name for IBM IM.\n"
39 "Edit local.yaml or tests/00-setup and run it again.")36 "Edit local.yaml or tests/00-setup and run it again.")
40 sys.exit(1)37 sys.exit(1)
4138
42 bundle_path = os.path.join(os.path.dirname(__file__), 'bundles.yaml')39 bundle_path = os.path.join(os.path.dirname(__file__), 'bundles.yaml')
43 with open(bundle_path, 'r') as bundle_file:40 with open(bundle_path, 'r') as bundle_file:
44 contents = yaml.safe_load(bundle_file)41 contents = yaml.safe_load(bundle_file)
45 d.load(contents)42 d.load(contents)
46 d.add("haproxy")43 d.add('haproxy')
47
48 # Software doesn't actually install until you accept the license
49 d.configure('was-base', {'accept-ibm-websphere-license': True, 'accept-ibm-im-license': True,'was_url': url, 'im_file_name': pkg })
50 d.configure('haproxy', {'enable_monitoring': True })
51 d.relate('haproxy:reverseproxy', 'was-base:website')
52 d.setup(seconds_to_wait)
53 d.sentry.wait(seconds_to_wait)
54 cls.d = d
5544
45 # Software doesn't actually install until you accept the license
46 d.configure('was-base', {'accept-ibm-websphere-license': True, 'accept-ibm-im-license': True,'was_url': url, 'im_file_name': pkg })
47 d.configure('haproxy', {'services': '- { service_name: was-base-service, service_host: 0.0.0.0, service_port: 9060, service_options: [balance leastconn, cookie SRVNAME insert], server_options: maxconn 100 cookie S check }'})
48 d.relate('haproxy:reverseproxy', 'was-base:website')
49 d.expose('haproxy')
50 d.setup(seconds_to_wait)
51 d.sentry.wait(seconds_to_wait)
52 cls.d = d
53
56 def test_deployed(self):54 def test_deployed(self):
57 """ Test to see if the bundle deployed successfully. """55 self.assertTrue(self.d.deployed)
58 self.assertTrue(self.d.deployed)
5956
60 def test_website(self):57 def test_website(self):
61 unit = self.d.sentry.unit['was-base/0']58 unit = self.d.sentry.unit['was-base/0']
62 url = 'http://%s:9060/ibm/console' % unit.info['public-address']59 url = 'http://%s:9060/ibm/console' % unit.info['public-address']
63 response = requests.get(url)60 response = requests.get(url)
64 # Raise an exception if the url was not a valid web page.61 # Raise an exception if the url was not a valid web page.
65 response.raise_for_status()62 response.raise_for_status()
6663
67 def test_reverseproxy(self):64 def test_reverseproxy(self):
68 unit = self.d.sentry.unit['haproxy/0']65 unit = self.d.sentry.unit['haproxy/0']
69 url = 'http://%s:80/ibm/console' % unit.info['public-address']66 haproxy_address = unit.info['public-address']
70 response = requests.get(url)67 haurl = 'http://%s:9060/ibm/console' % haproxy_address
71 # Raise an exception if the url was not a valid web page.68 page = requests.get(haurl)
72 response.raise_for_status()69 # Raise an exception if the url was not a valid web page.
7370 page.raise_for_status()
74 71 print('Successfully got the WAS Base web page through haproxy IP address.')
7572
76if __name__ == '__main__':73if __name__ == '__main__':
77 unittest.main()74 unittest.main()
7875
7976
=== removed file 'tests/local.yaml'
--- tests/local.yaml 2015-07-13 10:13:52 +0000
+++ tests/local.yaml 1970-01-01 00:00:00 +0000
@@ -1,3 +0,0 @@
1wasbase:
2 was_url: "http://9.124.100.99/debs/WAS-BASE"
3 im_file_name: "Install_Mgr_v1.6.2_Lnx_WASv8.5.5.zip"

Subscribers

People subscribed via source and target branches

to all changes: