Merge lp:~sradhara/charms/trusty/mobilefirst-server/mobilefirst-serverfix into lp:~ibmcharmers/charms/trusty/mobilefirst-server/devel

Proposed by sunitha
Status: Merged
Approved by: vsr
Approved revision: 38
Merged at revision: 39
Proposed branch: lp:~sradhara/charms/trusty/mobilefirst-server/mobilefirst-serverfix
Merge into: lp:~ibmcharmers/charms/trusty/mobilefirst-server/devel
Diff against target: 956 lines (+327/-250)
13 files modified
README.md (+183/-147)
config.yaml (+8/-3)
files/archives/install-MFS-responsefile.xml (+4/-4)
files/archives/uninstall-worklight-responsefile.xml (+2/-2)
hooks/config-changed (+3/-1)
hooks/db-relation-changed (+26/-23)
hooks/db-relation-departed (+16/-8)
hooks/stop (+22/-14)
hooks/website-relation-changed (+51/-46)
metadata.yaml (+2/-0)
tests/00-setup (+3/-0)
tests/10-deploy.py (+4/-1)
tests/local.yaml (+3/-1)
To merge this branch: bzr merge lp:~sradhara/charms/trusty/mobilefirst-server/mobilefirst-serverfix
Reviewer Review Type Date Requested Status
vsr Approve
Review via email: mp+265948@code.launchpad.net
To post a comment you must log in.
Revision history for this message
vsr (vsasi) :
review: Approve
39. By sunitha

mobilefirst-server charm code checkin

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-23 09:25:57 +0000
+++ README.md 2015-10-09 16:12:21 +0000
@@ -2,161 +2,195 @@
22
3Overview3Overview
4--------4--------
5 5This charm installs IBM Installation Manager and IBM MobileFirst Server products.
6 IBM MobileFirst Server 7.06
77IBM MobileFirst Server 7.0
8 IBM MobileFirst Server is the middleware tier that provides a gateway between back-end systems and services and the mobile client applications.8
9 The server enables application authentication, data endpoints/services, data optimization and transformation, push notification management.9IBM MobileFirst Server is the middleware tier that provides a gateway between back-end systems and services and the mobile client applications.
1010The server enables application authentication, data endpoints/services, data optimization and transformation, push notification management.
11 This charm installs IBM Installation Manager and IBM MoobileFirst Server product.11
12 12For details on IBM MobileFirst Server, as well as information on purchasing the product,
13 13please visit: [Product Page] [mfs-product-page] and [IBM Knowledge Center] [mfs-v7-info]
14 IBM Installation Manager14
15 15
16 IBM Installation Manager is a tool that you can use to install and maintain your IBM software packages.16IBM Installation Manager
17
18IBM Installation Manager is a tool that you can use to install and maintain your IBM software packages.
19
20For details on IBM Installation Manager, as well as information on purchasing the product,
21please visit: [IMProduct Info] [im-product-page] and [IBM Knowledge Center] [im-v1.7-info]
22
23For Ubuntu(Power and x86_64), IBM MobileFirst Server package and part numbers is:
24
25 IBM MobileFirst Server 7.0 Installer (CN4V2EN)
26
1727
18Usage28Usage
19-------29-------
2030Download packages for IBM MobileFirst Server and IBM Installation Manager for Linux and upload it to your apache
21 To install IBM MobileFirst Server you need to install IBM Installation Manager software as prerequisite.31repository. To download and install the code contained in this charm you must agree to the IBM license.
22 To install IBM Installation Manager and MobileFirst Server packeges for Ubuntu and put up it's contents on a web server like Apache and configure Apache to serve thi s package. 32
23 These package can be then be accessed using a URL from the web server.33IBM Installation Manager license file(s) can be found under the `files/archives/licenses` directory on extraction of IBM IM software using the following command.
24 34
25 To create repositories in Apache run steps below with admin access35To view IBM MobileFirst Server license file(s), please visit: [mfsproduct LicenseInfo] [license-page]
2636
27 Install needed packages using below command37
28 apt-get install dpkg-dev apache238# Creating the repositories in Apache
2939Run below steps with admin access
30 Create a repository on Apache server under your Apache repository directory.40
31 Configure Apache server to allow access to the repository.41Install the required packages
32 42 apt-get install dpkg-dev apache2
33 To install the downloaded binaries for IBM Installtion Manager you must agree to the IBM license. The license file(s) can be found under the `files/archives/licenses` directory on extraction of IBM IM software using the following command.43
3444Create a repository on Apache server under your Apache repository directory.
35 tar xvfz *.gz --strip-components=145
36 License can be viewed under the `files/archives/IM/license` directory.46 cd <apache-repository-directory>
3747 mkdir mobilefirst-server
38 To install the downloaded binaries for IBM MobileFirst Server you must agree to the IBM license. The license file(s) can be found in below link.48
39 49Place the downloaded IBM MobileFirst Server and IBM Installation Manager packages in the above directory and Configure Apache server to allow access to the repository.
40 (http://www14.software.ibm.com/cgi-bin/weblap/lap.pl?la_formnum=&li_formnum=L-BVID-9TCPPM&title=IBM%20MobileFirst%20Platform%20Foundation%20V7.0%20zip%20of%20Installation%20Manager%20Repository%20for%20IBM%20MobileFirst%20Server%20Multiplatform%20English)50
4151Configure config.yaml with the repository url
42 Database management system and an application server are required as prerequisites and must be installed before you start the MobileFirst Server installer.52
43 This charm uses Database management system as "IBM DB2" and application server as "websphere-liberty", so Deploy IBM DB2 and websphere-liberty charms before you deploy MobileFisrt Server on same machine.53 Example : `mobilefirstserver_url: "http://<server-name>/<REPOSITORY_DIR>/mobilefirst-server"`
44 54
4555 Verify repository is set correctly otherwise charm might throw errors.
46 First we need to add a juju machine using below command to deploy IBM-DB2, websphere-liberty and MobileFirst Server charms.56
47 juju add-machine #This command will create new juju machine.57
4858Deploy
49 Deploy charms as below:59------
50 juju deploy --to <machine number> websphere-liberty60
51 juju deploy --to <machine number> db261The MobileFirst Server charm has to be deployed to a container that has the IBM WebSphere Liberty software installed.
52 juju deploy --to <machine number> mobilefirst-server 62
5363Deploy the IBM DB2 charm and IBM WebSphere Liberty charm then this MobileFirst Server charm.
54 At this point the charm will wait until the user accepts the license.If you agree to the license for IBM Installation Manager and IBM MobileFirst server products, run the following commands:64
5565IBM DB2 charm can be deployed in the same container where your WebSphere liberty and MobileFirst Server charm deployed or it can be deployed in different container.
56 juju set mobilefirst-server accept-ibm-im-license=True66
57 juju set mobilefirst-server accept-ibm-mobilefirstserver-license=True67Steps to deploy mobilefirst-server charm, If you use remote db.
58 68
59 After deploying 3 charms run the relation commands as below 69 - juju deploy mobilefirst-server --to <machine-id1>
60 70 At this point IBM MobileFirst Server and IBM Installation Manager install
61 1)setup a relation between IBM DB2 and IBM MobileFirst Server:71 will wait for you to accept the License.
62 juju add-relation db2 mobilefirst-server 72 To install the downloaded binaries you must agree to the IBM license.
63 At this point it will create a 'APPCNTR' database, with out this database MobileFirst Server will not be installed. 73
64 74If the URL and package is configured in the config.yaml:
65 2)setup a relation between IBM Websphere-liberty and IBM MobileFirst Server:75
66 juju add-relation websphere-liberty mobilefirst-server76 juju set mobilefirst-server accept-ibm-im-license=True
67 At this point it will install MobileFirst Server software.77 juju set mobilefirst-server accept-ibm-mobilefirstserver-license=True
6878
6979If not,
70 After installing IBM MobileFirst server software open appcenter/worklight consoles as below80
7181 juju set mobilefirst-server accept-ibm-im-license=True mobilefirstserver_url=<repository URL> im_package_name=<Installation package name> sha_im=<sha sum of the IM package>
72 https://<public IP>:9443/worklightconsole82 juju set mobilefirst-server accept-ibm-mobilefirstserver-license=True mobilefirstserver_url=<repository URL> mobilefirstserver_package_name=<Installation package name> sha_im=<sha sum of the mobilefirst server package>
73 http://<public IP>:9081/worklightconsole83
74 https://<public IP>:9443/appcenterconsole84 - juju deploy websphere-liberty --to <machine-id1>
75 http://<public IP>:9081/appcenterconsole85 Please go through the websphere-liberty README file to deploy
7686 websphere-liberty charm.
7787
78 In case after installing the software, If you set license to "False" mobilefirst server will get uninstalled and to reinstall it you need to accept the license first using "juju set mobilefirst-server accept-ibm-mobilefirstserver-license=True" command and run below relation command to reinstall the product.88 - juju deploy db2 --to <machine-id2>
7989 Please go through the db2 README file to deploy the db2 charm.
80 juju add-relation websphere-liberty mobilefirst-server90
8191 - juju deploy mfs-helper --to <machine-id2>
82 (Note: you need to remove the relation using "juju remove-relation websphere-liberty mobilefirst-server" command,if any relation exists between these )92 Please go through the mfs-helper README file to deploy the mfs-helper charm.
8393
84 To remove a relation between db2 and mobilefirst-server run below command.94Now add relations between these charms:
85 juju remove-relation db2 mobilefirst-server 95
86 At this point it will remove ''APPCNTR' database. 96 1. juju add-relation mfs-helper mobilefirst-server
8797 Please go through the websphere-liberty README file to deploy
88 To remove the relation between websphere-liberty and mobilefirst-server run below command98 websphere-liberty charm.
89 juju remove-relation websphere-liberty mobilefirst-server 99
90100 2. juju add-relation db2 mobilefirst-server
101
102 3. juju add-relation websphere-liberty mobilefirst-server
103 At this point it will install mobilefirst server software.
104
105
106Steps to deploy mobilefirst sever charm, If you use local db.
107
108 juju deploy mobilefirst-server --to <machine-id1>
109 juju deploy db2 --to <machine-id1>
110 juju deploy websphere-liberty --to <machine-id1>
111
112Now add relations between these charms:
113
114 1. juju add-relation db2 mobilefirst-server
115 2. juju add-relation websphere-liberty mobilefirst-server
116
117
118After installing IBM MobileFirst server software open appcenter/worklight consoles as below
119
120 `https://<public IP>:9443/worklightconsole`
121 `http://<public IP>:9081/worklightconsole`
122 To login worklightconsole use admin/admin as id/password.
123
124 `https://<public IP>:9443/appcenterconsole`
125 `http://<public IP>:9081/appcenterconsole`
126 To login appcenterconsole use appcenteradmin/admin as id/password.
91127
92128
93Configuration129Configuration
94--------------130-------------
95 `MobileFirstServer_url`131See config.yaml file for more information.
96 URL where lies the repository packages for IBM MobileFirst Server and IBM InstallationManager.132
97133`MobileFirstServer_url`
98134
99 `accept-ibm-mobilefirstserver-license`135URL to download IBM MobileFirst Server and IBM Installation Manager packages.
100 Before you can use or install IBM MobileFirst Server,you must accept the terms of International License agreement for Non-Warranted Programs and additional license information.Please read the license agreement carefully. 136
101 137`accept-ibm-mobilefirstserver-license`
102 IBM MobileFirst Server license file(s) can be found in below link.138
103139The IBM MobileFirst Server software can only be used by accepting the terms and conditions for IBM
104 (http://www14.software.ibm.com/cgi-bin/weblap/lap.pl?la_formnum=&li_formnum=L-BVID-9TCPPM&title=IBM%20MobileFirst%20Platform%20Foundation%20V7.0%20zip%20of%20Installation%20Manager%20Repository%20for%20IBM%20MobileFirst%20Server%20Multiplatform%20English)140MobileFirst Server License. Setting this option to True indicates that you have read and accepted the
105 141IBM MobileFirst Server terms and conditions found in the license file.
106 Set the value of accept-ibm-mobilefirstserver-license to True if you agree to IBM MobileFirst Server license.142
107 **The IBM MobileFirst Server software cannot be installed until the terms and conditions are accepted. The charm will not function correctly until this configuration option is set to True.**143`mobilefirstserver_package_name`
108144
109145IBM MobileFirst Server package name.
110 146
111 `accept-ibm-im-license`147`im_package_name`
112 Before you can use or install IBM Installation Manager,you must accept the terms of International License agreement for Non-Warranted Programs and additional license information.Please read the license agreement carefully.148
113149IBM Installation Manager package name.
114 IBM Installation Manager license file(s) can be found in `files/archives//IM/license` directory.150
115 151`accept-ibm-im-license`
116 Set the value of accept-ibm-im-license to True if you agree to IBM Installation Manager license.152
117 **The IBM Installation Manager Server software cannot be installed until the terms and conditions are accepted.The charm will not function correctly until this configuration option is set to True.**153The IBM Installation Manager software can only be used by accepting the terms and conditions for IBM
118154Installation Manager License. Setting this option to True indicates that you have read and accepted the
119155IBM Installation Manager terms and conditions found in the license file.
120 `mobilefirstserver_package_name`156
121 MobileFirst Server package name.If its not set,It will take assigned package "MFPF_7.0_INST_MGR_REP_MF_SVR_EN.zip".157`sha_im`
122 158
123159Checksum value to check integrity of IBM Installation Manager package. The Charm uses
124 `im_package_name'160sha1sum to check the integrity. If empty, it does not carry out the integrity check.
125 IBM Installation Manager package name.If its not set,It will take assigned package for x86_64 "agent.installer.linux.gtk.x86_64_1.7.1000.20131119_2219.zip" and for ppc64le "agent.installer.linux.gtk.ppc64le_1.8.1000.20141126_2002.zip" 161The command to find the checksum is : sha1sum <Package Name> | cut -d" " -f1
126 162
127163`sha_mfs`
128 `sha_im`164
129 Checksum value to check integrity of IBM Installation Manager package.The Charm uses sha1sum to check the integrity. If empty, it does not carry out the integrity check.165Checksum value to check integrity of IBM MobileFirst Server package. The Charm uses
130 166sha1sum to check the integrity. If empty, it does not carry out the integrity check.
131 167The command to find the checksum is : sha1sum <Package Name> | cut -d" " -f1
132 `sha_mfs`168
133 Checksum value to check integrity of IBM MobileFirst Server package.The Charm uses sha1sum to check the integrity.If empty, it does not carry out the integrity check.169`liberty-install-path`
134170
135 Use sha1sum command as below to find out Checksum value for downloaded package.171IBM WebSphere Liberty install path.
136 `sha1sum <Package Location/Package Name> | cut -d" " -f1`172
137 173
138
139IBM Installation Manager(IM) Information174IBM Installation Manager(IM) Information
140-----------------------------------------175-----------------------------------------
141176(1) General Information
142 Details about IM available [here][im-info].177Details about IM available [here][im-info].
143178
144 Details about IM Version 1.7 available at [IBM Knowledge Center][im-v1.7-info].179Details about IM Version 1.7 available at [IBM Knowledge Center][im-v1.7-info].
145180
146 ### (2) Download Information181(2) Download Information
147182Information on procuring IM product is available at the [Product Page][im-product-page]
148 Information on procuring IM product is available at the [Product Page][im-product-page]183and at the [Passport Advantage Site][passport].
149 and at the [Passport Advantage Site][passport].
150184
151185
152IBM MobileFirst Server information186IBM MobileFirst Server information
153---------------------------------------187-----------------------------------
154 Details about MobileFirst Server 7.0 available at [IBM Knowledge Center][mfs-v7-info].188(1) General Information
155189Details about MobileFirst Server 7.0 available at [IBM Knowledge Center][mfs-v7-info].
156 ### (2) Download Information190
157191(2) Download Information
158 Information on procuring IM product is available at the [Product Page][mfs-product-page]192Information on procuring IM product is available at the [Product Page][mfs-product-page]
159 and at the [Passport Advantage Site][passport].193and at the [Passport Advantage Site][passport].
160194
161Contact Information195Contact Information
162------------------196------------------
@@ -165,14 +199,16 @@
165 199
166<!-- Links -->200<!-- Links -->
167201
168 [im-v1.7-info]: http://www-01.ibm.com/support/knowledgecenter/SSDV2W_1.7.0/com.ibm.cic.agent.ui.doc/helpindex_imic.html?cp=SSDV2W_1.7.0%2F0 "IM Version 1.7"202 [im-v1.7-info]: http://www-01.ibm.com/support/knowledgecenter/SSDV2W_1.7.0/com.ibm.cic.agent.ui.doc/helpindex_imic.html?cp=SSDV2W_1.7.0%2F0
169203
170 [im-product-page]: http://www-01.ibm.com/support/docview.wss?uid=swg27025142 "im-product-page Product Page"204 [im-product-page]: http://www-01.ibm.com/support/docview.wss?uid=swg27025142
171205
172 [mfs-product-page]: http://www.ibm.com/software/products/en/mobilefirstfoundation "MFS Info"206 [mfs-product-page]: http://www.ibm.com/software/products/en/mobilefirstfoundation "MFS Info"
173207
174 [mfs-v7-info]: https://www-01.ibm.com/support/knowledgecenter/SSHS8R_7.0.0/com.ibm.worklight.installconfig.doc/install_config/t_ov_server_install.html208 [mfs-v7-info]: https://www-01.ibm.com/support/knowledgecenter/SSHS8R_7.0.0/com.ibm.worklight.installconfig.doc/install_config/t_ov_server_install.html
209
210 [license-page]: http://www14.software.ibm.com/cgi-bin/weblap/lap.pl?la_formnum=&li_formnum=L-BVID-9TCPPM&title=IBM%20MobileFirst%20Platform%20Foundation%20V7.0%20zip%20of%20Installation%20Manager%20Repository%20for%20IBM%20MobileFirst%20Server%20Multiplatform%20English
175 211
176 [passport]: http://www-01.ibm.com/software/passportadvantage/ "Passport Advantage"212
177213
178 214
179215
=== modified file 'config.yaml'
--- config.yaml 2015-07-21 11:33:08 +0000
+++ config.yaml 2015-10-09 16:12:21 +0000
@@ -1,17 +1,17 @@
1options:1options:
2 mobilefirstserver_url:2 mobilefirstserver_url:
3 type: string3 type: string
4 default: ""4 default: "http://9.124.100.99/debs/mobilefirst-server/"
5 description: |5 description: |
6 Download url for MobileFirst Server packages6 Download url for MobileFirst Server packages
7 mobilefirstserver_package_name:7 mobilefirstserver_package_name:
8 type: string8 type: string
9 default: "" 9 default: "MFPF_7.0_INST_MGR_REP_MF_SVR_EN.zip"
10 description: |10 description: |
11 MobileFirstServer package name11 MobileFirstServer package name
12 im_package_name:12 im_package_name:
13 type: string13 type: string
14 default: ""14 default: "agent.installer.linux.gtk.x86_64_1.7.1000.20131119_2219.zip"
15 description: |15 description: |
16 Installation Manager package Name16 Installation Manager package Name
17 accept-ibm-mobilefirstserver-license:17 accept-ibm-mobilefirstserver-license:
@@ -42,4 +42,9 @@
42 <sha1sum MFPF_7.0_INST_MGR_REP_MF_SVR_EN.zip | cut -d " " -f1>42 <sha1sum MFPF_7.0_INST_MGR_REP_MF_SVR_EN.zip | cut -d " " -f1>
43 to get the checksum value for IBM Installation Manager pacakage.43 to get the checksum value for IBM Installation Manager pacakage.
44 If empty, it does not carry out the integrity check.44 If empty, it does not carry out the integrity check.
45 liberty-install-path:
46 type: string
47 default: "/opt/ibm/wlp"
48 description: |
49 IBM websphere liberty installation path.
4550
4651
=== modified file 'files/archives/install-MFS-responsefile.xml'
--- files/archives/install-MFS-responsefile.xml 2015-07-23 16:20:34 +0000
+++ files/archives/install-MFS-responsefile.xml 2015-10-09 16:12:21 +0000
@@ -6,17 +6,17 @@
6 <server>6 <server>
7 <repository location='/root/Installfiles/MobileFirst_Platform_Server/disk1'/>7 <repository location='/root/Installfiles/MobileFirst_Platform_Server/disk1'/>
8 </server>8 </server>
9 <profile id='IBM MobileFirst Platform Server_1' installLocation='/opt/ibm/MobileFirst_Platform_Server_1_liberty'>9 <profile id='IBM MobileFirst Platform Server_1' installLocation='/opt/ibm/MobileFirst_Platform_Server_liberty'>
10 <data key='eclipseLocation' value='/opt/ibm/MobileFirst_Platform_Server_1_liberty'/>10 <data key='eclipseLocation' value='/opt/ibm/MobileFirst_Platform_Server_liberty'/>
11 <data key='user.import.profile' value='false'/>11 <data key='user.import.profile' value='false'/>
12 <data key='cic.selector.os' value='linux'/>12 <data key='cic.selector.os' value='linux'/>
13 <data key='user.windows.profilesubdir' value='ibm\MobileFirst Platform Server_1'/>13 <data key='user.windows.profilesubdir' value='ibm\MobileFirst Platform Server'/>
14 <data key='user.shortcuts.folder3' value='IBM MobileFirst Platform Server 7.0_1'/>14 <data key='user.shortcuts.folder3' value='IBM MobileFirst Platform Server 7.0_1'/>
15 <data key='user.update.minimal' value='false'/>15 <data key='user.update.minimal' value='false'/>
16 <data key='user.update.from.version' value=''/>16 <data key='user.update.from.version' value=''/>
17 <data key='user.writable.data.user' value='root'/>17 <data key='user.writable.data.user' value='root'/>
18 <data key='user.database.db2.port' value='50000'/>18 <data key='user.database.db2.port' value='50000'/>
19 <data key='user.database.db2.appcenter.dbname' value='APPCNTRA'/>19 <data key='user.database.db2.appcenter.dbname' value='APPCNTRA'/>
20 <data key='user.database.db2.appcenter.schema' value=''/>20 <data key='user.database.db2.appcenter.schema' value=''/>
21 <data key='user.database.db2.appcenter.password' value='{xyzzy}7Z2T47W3538X52295I'/>21 <data key='user.database.db2.appcenter.password' value='{xyzzy}7Z2T47W3538X52295I'/>
22 <data key='user.database.db2.password2' value='{xyzzy}7Z2T47W3538X52295I'/>22 <data key='user.database.db2.password2' value='{xyzzy}7Z2T47W3538X52295I'/>
2323
=== modified file 'files/archives/uninstall-worklight-responsefile.xml'
--- files/archives/uninstall-worklight-responsefile.xml 2015-05-08 09:08:40 +0000
+++ files/archives/uninstall-worklight-responsefile.xml 2015-10-09 16:12:21 +0000
@@ -33,7 +33,7 @@
33 <!-- The declaration of the Installation Manager package group, a.k.a. profile.33 <!-- The declaration of the Installation Manager package group, a.k.a. profile.
34 Make sure that the installLocation, if it exists, is empty. -->34 Make sure that the installLocation, if it exists, is empty. -->
35 <!--<profile id='IBM Worklight' installLocation='/opt/IBM/Worklight'> -->35 <!--<profile id='IBM Worklight' installLocation='/opt/IBM/Worklight'> -->
36 <profile id='IBM MobileFirst Platform Server_1' installLocation='/opt/ibm/MobileFirst_Platform_Server_1_liberty'>36 <profile id='IBM MobileFirst Platform Server' installLocation='/opt/ibm/MobileFirst_Platform_Server_liberty'>
3737
38 <!-- The settings 'eclipseLocation', 'user.import.profile',38 <!-- The settings 'eclipseLocation', 'user.import.profile',
39 'cic.selector.os', 'cic.selector.ws', 'cic.selector.arch',39 'cic.selector.os', 'cic.selector.ws', 'cic.selector.arch',
@@ -43,7 +43,7 @@
4343
44 <!-- Specify what Installation Manager should uninstall. -->44 <!-- Specify what Installation Manager should uninstall. -->
45 <uninstall modify='false'>45 <uninstall modify='false'>
46 <offering id='com.ibm.mobilefirst.foundation.server' profile='IBM MobileFirst Platform Server_1'/>46 <offering id='com.ibm.mobilefirst.foundation.server' profile='IBM MobileFirst Platform Server'/>
47 </uninstall>47 </uninstall>
4848
49</agent-input>49</agent-input>
5050
=== modified file 'hooks/config-changed'
--- hooks/config-changed 2015-07-27 10:35:02 +0000
+++ hooks/config-changed 2015-10-09 16:12:21 +0000
@@ -283,6 +283,9 @@
283 #Remove corrupt archive file283 #Remove corrupt archive file
284 rm -rf $ARCHIVE_DIR/agent*.zip284 rm -rf $ARCHIVE_DIR/agent*.zip
285 exit 0285 exit 0
286 else
287 juju-log "IBM MFSVR: Installation Manager extracted successfully."
288
286 fi289 fi
287 290
288 fi291 fi
@@ -314,7 +317,6 @@
314 juju-log "IBM MFSVR: Acceptable values for license is 'True' or 'False'"317 juju-log "IBM MFSVR: Acceptable values for license is 'True' or 'False'"
315fi318fi
316319
317juju-log "IBM MFSVR: Installation Manager downloaded and installed sucessfully."
318320
319juju-log "IBM MFSVR: Config change hook completed." 321juju-log "IBM MFSVR: Config change hook completed."
320####################################################################################322####################################################################################
321323
=== modified file 'hooks/db-relation-changed'
--- hooks/db-relation-changed 2015-07-27 10:35:02 +0000
+++ hooks/db-relation-changed 2015-10-09 16:12:21 +0000
@@ -1,45 +1,48 @@
1#!/bin/bash1#!/bin/bash
22
3set -e3set -e
4hooksdir=$PWD4#hooksdir=$PWD
5DB2_INSTALL_PATH=/opt/ibm/db2/V10.5
6db2user=`relation-get dbusername`5db2user=`relation-get dbusername`
7db2password=`relation-get dbuserpw`6db2password=`relation-get dbuserpw`
8db2instancename=`relation-get db2_instance_name`7db2instancename=`relation-get db2_instance_name`
9db2port=`relation-get port`8db2port=`relation-get port`
10db2_address=`relation-get hostname`9db2_address=`relation-get hostname`
10db2_install_path=/opt/ibm/db2
1111
12#Copy db2 details in db2values.dat file"12#Copy db2 details in to "db2values.dat" file"
13echo "dbusrname=$db2user" > db2values.dat ; echo "dbpwd=$db2password" >> db2values.dat ; echo "db2_address=$db2_address" >> db2values.dat ; echo "db2instancename=$db2instancename" >> db2values.dat ; echo "db2port=$db2port" >> db2values.dat 13echo "dbusrname=$db2user" > db2values.dat ; echo "dbpwd=$db2password" >> db2values.dat ; echo "db2_address=$db2_address" >> db2values.dat ; echo "db2instancename=$db2instancename" >> db2values.dat ; echo "db2port=$db2port" >> db2values.dat
1414
15#Check if db2 exist
16if ! [ -d "$DB2_INSTALL_PATH"/bin ]; then
17 juju-log "IBM MFSVR: DB2 Not found.Exiting!!"
18 exit 0
19else
20 juju-log "IBM MFSVR: DB2 found."
21fi
22
23
2415
25if [ -z "$db2_address" ]; then16if [ -z "$db2_address" ]; then
26 juju-log "No data sent yet"17 juju-log "No data sent yet"
27 exit 018 exit 0
28fi19fi
2920
21juju-log "db2_address : $db2_address"
22private_address=`unit-get private-address`
23juju-log "private_address : $private_address"
3024
31#check whether db2 is already started or not if not started it will exit25if [ "$db2_address" == "$private_address" ]; then
32if su - $db2user -c 'netstat -an | grep '$db2port; then26 database1=`su - $db2user -c 'db2 list db directory' | grep "APPCNTR" | cut -d"=" -f2`
33 juju-log "IBM MFSVR: DB2 started in port $db2port"27 if [ "$database1" == "" ]; then
34else28 juju-log "IBM MFSVR: Create APPCNTR database"
35 juju-log "IBM MFSVR: DB2 not started in port $db2port"29 juju-log "IBM MFSVR: Creating APPCNTR database for MobileFirstServer,without APPCNTR database MobileFirst Server will not be installed"
36 exit 130 su - $db2user -c 'db2 ATTACH TO '$db2user''
31 su - $db2user -c 'db2 CREATE DATABASE APPCNTR USING CODESET UTF-8 TERRITORY US'
32 juju-log "IBM MFSVR: APPCNTR database created "
33 su - $db2user -c "db2 CONNECT TO APPCNTR"
34 else
35 juju-log "IBM MFSVR: APPCNTR database is exist"
36 fi
37 #Copy db2 jar file
38 juju-log "IBM MFSVR: Copying db2jar files"
39 cp $db2_install_path/V10.5/java/db2jcc.jar $CHARM_DIR/files/archives
40 cp $db2_install_path/V10.5/java/db2jcc4.jar $CHARM_DIR/files/archives
41 cp $db2_install_path/V10.5/java/db2jcc_license_*.jar $CHARM_DIR/files/archives
42
37fi43fi
44
45
3846
39juju-log "IBM MFSVR: creating APPCNTR database for MobileFirstServer,without APPCNTR database MobileFirst Server will not be installed"
40su - $db2user -c 'db2 ATTACH TO '$db2user''
41su - $db2user -c 'db2 CREATE DATABASE APPCNTR USING CODESET UTF-8 TERRITORY US'
42juju-log "Database created "
43su - $db2user -c "db2 CONNECT TO APPCNTR"
44juju-log "IBM MFSVR: db-relation-change hook completed"47juju-log "IBM MFSVR: db-relation-change hook completed"
4548
4649
=== modified file 'hooks/db-relation-departed'
--- hooks/db-relation-departed 2015-07-27 10:35:02 +0000
+++ hooks/db-relation-departed 2015-10-09 16:12:21 +0000
@@ -1,16 +1,24 @@
1#!/bin/bash1#!/bin/bash
2set -e2set -e
3juju-log "starting db-relation-departed hook"3juju-log "IBM MFSVR: Starting db-relation-departed hook"
4DB2_INSTALL_PATH=/opt/ibm/db2/V10.54db2user=`relation-get dbusername`
5dbusrname=`relation-get dbusername`5db2_address=`relation-get hostname`
6private_address=`unit-get private-address`
7juju-log "private_address : $private_address"
68
7#while removing relation, it will remove APPCNTR database9juju-log "db2_address :$db2_address"
8if [ -d "$DB2_INSTALL_PATH"/bin ]; then10if [ "$db2_address" == "$private_address" ]; then
9 juju-log "IBM MFSVR: Dropping the APPCNTR DB ..."11 database1=`su - $db2user -c 'db2 list db directory' | grep "APPCNTR" | cut -d"=" -f2`
10 su - $dbusrname -c 'db2 drop database APPCNTR'12
11 juju-log "IBM MFSVR: Dropped APPCNTR db"13 if [ "$database"== "" ]; then
14 juju-log "IBM MFSVR: APPCNTR database is not exist"
15 else
16 juju-log "MFS HELPER: Removing APPCNTR database"
17 su - $db2user -c 'db2 drop database APPCNTR'
18 fi
12fi19fi
1320
21
14juju-log "IBM MFSVR: db-relation-departed completed sucessfully"22juju-log "IBM MFSVR: db-relation-departed completed sucessfully"
1523
16 24
1725
=== modified file 'hooks/stop'
--- hooks/stop 2015-07-27 10:35:02 +0000
+++ hooks/stop 2015-10-09 16:12:21 +0000
@@ -1,20 +1,28 @@
1#!/bin/bash1#!/bin/bash
2set -e2set -e
33juju-log "IBM MFSVR: Starting stop hook"
4LIBERTY_INSTALL_PATH=/opt/ibm/wlp4
55LIBERTY_INSTALL_PATH=`config-get liberty-install-path`
6juju-log "Stop worklight server"
7
8if [ -d $LIBERTY_INSTALL_PATH/usr/servers/worklight ]; then6if [ -d $LIBERTY_INSTALL_PATH/usr/servers/worklight ]; then
9 $LIBERTY_INSTALL_PATH/bin/server stop worklight7 juju-log "IBM MFSVR: Removing liberty server"
10 if [ $? == 0 ]; then8 rm -rf $LIBERTY_INSTALL_PATH/usr/servers/worklight
11 juju-log "worklight server stopped sucessfully"9 if [ $? == 0 ]; then
12 else10 juju-log "IBM MFSVR: worklight server removed successfully"
13 juju-log "worklight server not running"11 else
14 exit 012 juju-log "IBM MFSVR: Failed to remove worklight server"
15 fi13 fi
14
15 rm -rf $LIBERTY_INSTALL_PATH/output/servers/worklight
16 if [ $? == 0 ]; then
17 juju-log "IBM MFSVR: worklight server removed successfully from output folder"
18 else
19 juju-log "IBM MFSVR: Failed to remove worklight server from oputput folder"
20 fi
21
16else22else
17 juju-log "Worklight server not created yet"23
18 exit 024 juju-log "IBM MFSVR: Server is not exist"
19fi25fi
2026
27
28juju-log "IBM MFSVR: Completed stop hook"
2129
=== modified file 'hooks/website-relation-changed'
--- hooks/website-relation-changed 2015-07-27 10:35:02 +0000
+++ hooks/website-relation-changed 2015-10-09 16:12:21 +0000
@@ -1,14 +1,15 @@
1#!/bin/bash1#!/bin/bash
22
3set -e3set -e
4LIBERTY_INSTALL_PATH=/opt/ibm/wlp4LIBERTY_INSTALL_PATH=`config-get liberty-install-path`
5MobileFirstServer_PATH=/opt/ibm/MobileFirst_Platform_Server_1_liberty5MobileFirstServer_PATH=/opt/ibm/MobileFirst_Platform_Server_liberty
6IM_INSTALL_PATH=/opt/IBM/InstallationManager6IM_INSTALL_PATH=/opt/IBM/InstallationManager
7DB2_INSTALL_PATH=/opt/ibm/db2/V10.57DB2_INSTALL_PATH=/opt/ibm/db2/V10.5
8MOBILEFIRSTSERVER_ARCHIVE_DIR=`pwd`8MOBILEFIRSTSERVER_ARCHIVE_DIR=`pwd`
9hooksdir=$PWD9hooksdir=$PWD
1010
11#Get db2 values from db2values.dat file11
12#Get db2 details from db2values.dat file
12if [ -f "$hooksdir"/db2values.dat ]; then13if [ -f "$hooksdir"/db2values.dat ]; then
13 . db2values.dat14 . db2values.dat
14 echo "dbusrname is $dbusrname"15 echo "dbusrname is $dbusrname"
@@ -50,14 +51,15 @@
50#Edit install responsefile with Liberty and db2 details51#Edit install responsefile with Liberty and db2 details
51edit_responsefile()52edit_responsefile()
52{53{
53 echo " Editing the response file"54 juju-log "IBM MFSR: Editing response file"
54 sed -i 's|/root/IBM/IBMIMShared|/opt/ibm/IBMIMShared|g' $CHARM_DIR/files/archives/install-MFS-responsefile.xml55 sed -i 's|/root/IBM/IBMIMShared|/opt/ibm/IBMIMShared|g' $CHARM_DIR/files/archives/install-MFS-responsefile.xml
55 sed -i 's|/root/Installfiles/MobileFirst_Platform_Server/disk1|'$CHARM_DIR'/files/archives/MobileFirst_Platform_Server/disk1|g' $CHARM_DIR/files/archives/install-MFS-responsefile.xml56 sed -i 's|/root/Installfiles/MobileFirst_Platform_Server/disk1|'$CHARM_DIR'/files/archives/MobileFirst_Platform_Server/disk1|g' $CHARM_DIR/files/archives/install-MFS-responsefile.xml
56 sed -i 's/APPCNTRA/APPCNTR/' $CHARM_DIR/files/archives/install-MFS-responsefile.xml57 sed -i 's/APPCNTRA/APPCNTR/' $CHARM_DIR/files/archives/install-MFS-responsefile.xml
57 sed -i 's/50000/'$db2port'/' $CHARM_DIR/files/archives/install-MFS-responsefile.xml58 sed -i 's/50000/'$db2port'/' $CHARM_DIR/files/archives/install-MFS-responsefile.xml
58 sed -i 's/db2inst1/'$dbusrname'/' $CHARM_DIR/files/archives/install-MFS-responsefile.xml59 sed -i 's/db2inst1/'$dbusrname'/' $CHARM_DIR/files/archives/install-MFS-responsefile.xml
59 sed -i 's/localhost/'$db2_address'/' $CHARM_DIR/files/archives/install-MFS-responsefile.xml60 sed -i 's/localhost/'$db2_address'/' $CHARM_DIR/files/archives/install-MFS-responsefile.xml
60 sed -i 's|/opt/ibm/db2/V10.5/java/db2jcc.jar|'$DB2_INSTALL_PATH'/java/db2jcc.jar|g' $CHARM_DIR/files/archives/install-MFS-responsefile.xml61 #sed -i 's|/opt/ibm/db2/V10.5/java/db2jcc.jar|'$DB2_INSTALL_PATH'/java/db2jcc.jar|g' $CHARM_DIR/files/archives/install-MFS-responsefile.xml
62 sed -i 's|/opt/ibm/db2/V10.5/java/db2jcc.jar|'$CHARM_DIR'/files/archives/db2jcc.jar|g' $CHARM_DIR/files/archives/install-MFS-responsefile.xml
61 sed -i 's/waserver1/worklight/' $CHARM_DIR/files/archives/install-MFS-responsefile.xml63 sed -i 's/waserver1/worklight/' $CHARM_DIR/files/archives/install-MFS-responsefile.xml
62 sed -i 's|/root/IBM/WebSphere/wlp|'$LIBERTY_INSTALL_PATH'|g' $CHARM_DIR/files/archives/install-MFS-responsefile.xml64 sed -i 's|/root/IBM/WebSphere/wlp|'$LIBERTY_INSTALL_PATH'|g' $CHARM_DIR/files/archives/install-MFS-responsefile.xml
63 }65 }
@@ -65,16 +67,16 @@
65#update configure_liberty_db2_file with IBM Mobile first server details after installing the product67#update configure_liberty_db2_file with IBM Mobile first server details after installing the product
66edit_configure_liberty_db2_file()68edit_configure_liberty_db2_file()
67{69{
68 echo " Editing configure_liberty_db2.xml file"70 juju-log "IBM MFSR: Editing configure_liberty_db2.xml file"
69 sed -i '/"database.db2.wladmin.password"/c\<property name="database.db2.wladmin.password" value="'$dbpwd'"/>' $MobileFirstServer_PATH/WorklightServer/configuration-samples/configure-liberty-db2.xml71 sed -i '/"database.db2.wladmin.password"/c\<property name="database.db2.wladmin.password" value="'$dbpwd'"/>' $MobileFirstServer_PATH/WorklightServer/configuration-samples/configure-liberty-db2.xml
70 sed -i '/"database.db2.worklight.password"/c\<property name="database.db2.worklight.password" value="'$dbpwd'"/>' $MobileFirstServer_PATH/WorklightServer/configuration-samples/configure-liberty-db2.xml72 sed -i '/"database.db2.worklight.password"/c\<property name="database.db2.worklight.password" value="'$dbpwd'"/>' $MobileFirstServer_PATH/WorklightServer/configuration-samples/configure-liberty-db2.xml
71 sed -i '/"database.db2.worklightreports.password"/c\<property name="database.db2.worklightreports.password" value="'$dbpwd'"/>' $MobileFirstServer_PATH/WorklightServer/configuration-samples/configure-liberty-db2.xml73 sed -i '/"database.db2.worklightreports.password"/c\<property name="database.db2.worklightreports.password" value="'$dbpwd'"/>' $MobileFirstServer_PATH/WorklightServer/configuration-samples/configure-liberty-db2.xml
72 sed -i '/"worklight.server.install.dir"/c\<property name="worklight.server.install.dir" value="'$MobileFirstServer_PATH'"/>' $MobileFirstServer_PATH/WorklightServer/configuration-samples/configure-liberty-db2.xml74 sed -i '/"worklight.server.install.dir"/c\<property name="worklight.server.install.dir" value="'$MobileFirstServer_PATH'"/>' $MobileFirstServer_PATH/WorklightServer/configuration-samples/configure-liberty-db2.xml
73 sed -i '/"worklight.contextroot"/c\<property name="worklight.contextroot" value="/worklight"/>' $MobileFirstServer_PATH/WorklightServer/configuration-samples/configure-liberty-db2.xml75 sed -i '/"worklight.contextroot"/c\<property name="worklight.contextroot" value="/worklight"/>' $MobileFirstServer_PATH/WorklightServer/configuration-samples/configure-liberty-db2.xml
74 sed -i '/"database.db2.host"/c\<property name="database.db2.host" value="localhost"/>' $MobileFirstServer_PATH/WorklightServer/configuration-samples/configure-liberty-db2.xml76 sed -i '/"database.db2.host"/c\<property name="database.db2.host" value="'$db2_address'"/>' $MobileFirstServer_PATH/WorklightServer/configuration-samples/configure-liberty-db2.xml
75 sed -i '/"database.db2.port"/c\<property name="database.db2.port" value="'$db2port'"/>' $MobileFirstServer_PATH/WorklightServer/configuration-samples/configure-liberty-db2.xml77 sed -i '/"database.db2.port"/c\<property name="database.db2.port" value="'$db2port'"/>' $MobileFirstServer_PATH/WorklightServer/configuration-samples/configure-liberty-db2.xml
76 sed -i '/"database.db2.instance"/c\<property name="database.db2.instance" value="db2inst1"/>' $MobileFirstServer_PATH/WorklightServer/configuration-samples/configure-liberty-db2.xml78 sed -i '/"database.db2.instance"/c\<property name="database.db2.instance" value="db2inst1"/>' $MobileFirstServer_PATH/WorklightServer/configuration-samples/configure-liberty-db2.xml
77 sed -i '/"database.db2.driver.dir"/c\<property name="database.db2.driver.dir" value="'$DB2_INSTALL_PATH'/java"/>' $MobileFirstServer_PATH/WorklightServer/configuration-samples/configure-liberty-db2.xml79 sed -i '/"database.db2.driver.dir"/c\<property name="database.db2.driver.dir" value="'$CHARM_DIR'/files/archives"/>' $MobileFirstServer_PATH/WorklightServer/configuration-samples/configure-liberty-db2.xml
78 sed -i '/"database.db2.wladmin.dbname"/c\<property name="database.db2.wladmin.dbname" value="WRKLGHT"/>' $MobileFirstServer_PATH/WorklightServer/configuration-samples/configure-liberty-db2.xml80 sed -i '/"database.db2.wladmin.dbname"/c\<property name="database.db2.wladmin.dbname" value="WRKLGHT"/>' $MobileFirstServer_PATH/WorklightServer/configuration-samples/configure-liberty-db2.xml
79 sed -i '/"database.db2.wladmin.schema"/c\<property name="database.db2.wladmin.schema" value="WLADMIN"/>' $MobileFirstServer_PATH/WorklightServer/configuration-samples/configure-liberty-db2.xml81 sed -i '/"database.db2.wladmin.schema"/c\<property name="database.db2.wladmin.schema" value="WLADMIN"/>' $MobileFirstServer_PATH/WorklightServer/configuration-samples/configure-liberty-db2.xml
80 sed -i '/"database.db2.wladmin.username"/c\<property name="database.db2.wladmin.username" value="'$dbusrname'"/>' $MobileFirstServer_PATH/WorklightServer/configuration-samples/configure-liberty-db2.xml82 sed -i '/"database.db2.wladmin.username"/c\<property name="database.db2.wladmin.username" value="'$dbusrname'"/>' $MobileFirstServer_PATH/WorklightServer/configuration-samples/configure-liberty-db2.xml
@@ -86,22 +88,22 @@
86 sed -i '/"database.db2.worklightreports.username"/c\<property name="database.db2.worklightreports.username" value="'$dbusrname'"/>' $MobileFirstServer_PATH/WorklightServer/configuration-samples/configure-liberty-db2.xml88 sed -i '/"database.db2.worklightreports.username"/c\<property name="database.db2.worklightreports.username" value="'$dbusrname'"/>' $MobileFirstServer_PATH/WorklightServer/configuration-samples/configure-liberty-db2.xml
87 sed -i '/"appserver.was.installdir"/c\<property name="appserver.was.installdir" value="'$LIBERTY_INSTALL_PATH'"/>' $MobileFirstServer_PATH/WorklightServer/configuration-samples/configure-liberty-db2.xml89 sed -i '/"appserver.was.installdir"/c\<property name="appserver.was.installdir" value="'$LIBERTY_INSTALL_PATH'"/>' $MobileFirstServer_PATH/WorklightServer/configuration-samples/configure-liberty-db2.xml
88 sed -i '/"appserver.was85liberty.serverInstance"/c\<property name="appserver.was85liberty.serverInstance" value="worklight"/>' $MobileFirstServer_PATH/WorklightServer/configuration-samples/configure-liberty-db2.xml90 sed -i '/"appserver.was85liberty.serverInstance"/c\<property name="appserver.was85liberty.serverInstance" value="worklight"/>' $MobileFirstServer_PATH/WorklightServer/configuration-samples/configure-liberty-db2.xml
89juju-log "configure_liberty_db2_file file edit done"91 sed -i '/"worklight.project.war.file"/c\<property name="worklight.project.war.file" value="'$CHARM_DIR'/files/archives/test.war"/>' $MobileFirstServer_PATH/WorklightServer/configuration-samples/configure-liberty-db2.xml
90}92}
9193
92#update create_database_db2_file with IBM Mobile first server details after installing the product94#update create_database_db2_file with IBM Mobile first server details after installing the product
93edit_create_database_db2_file()95edit_create_database_db2_file()
94{96{
95 echo " Editing create-database-db2.xml file"97 juju-log "IBM MFSR: Editing create-database-db2.xml file"
96 sed -i '/"database.db2.admin.password"/c\<property name="database.db2.admin.password" value="'$dbpwd'"/>' $MobileFirstServer_PATH/WorklightServer/configuration-samples/create-database-db2.xml98 sed -i '/"database.db2.admin.password"/c\<property name="database.db2.admin.password" value="'$dbpwd'"/>' $MobileFirstServer_PATH/WorklightServer/configuration-samples/create-database-db2.xml
97 sed -i '/"database.db2.wladmin.password"/c\<property name="database.db2.wladmin.password" value="'$dbpwd'"/>' $MobileFirstServer_PATH/WorklightServer/configuration-samples/create-database-db2.xml99 sed -i '/"database.db2.wladmin.password"/c\<property name="database.db2.wladmin.password" value="'$dbpwd'"/>' $MobileFirstServer_PATH/WorklightServer/configuration-samples/create-database-db2.xml
98 sed -i '/"database.db2.worklight.password"/c\<property name="database.db2.worklight.password" value="'$dbpwd'"/>' $MobileFirstServer_PATH/WorklightServer/configuration-samples/create-database-db2.xml100 sed -i '/"database.db2.worklight.password"/c\<property name="database.db2.worklight.password" value="'$dbpwd'"/>' $MobileFirstServer_PATH/WorklightServer/configuration-samples/create-database-db2.xml
99 sed -i '/"database.db2.worklightreports.password"/c\<property name="database.db2.worklightreports.password" value="'$dbpwd'"/>' $MobileFirstServer_PATH/WorklightServer/configuration-samples/create-database-db2.xml101 sed -i '/"database.db2.worklightreports.password"/c\<property name="database.db2.worklightreports.password" value="'$dbpwd'"/>' $MobileFirstServer_PATH/WorklightServer/configuration-samples/create-database-db2.xml
100 sed -i '/"worklight.server.install.dir"/c\<property name="worklight.server.install.dir" value="'$MobileFirstServer_PATH'"/>' $MobileFirstServer_PATH/WorklightServer/configuration-samples/create-database-db2.xml102 sed -i '/"worklight.server.install.dir"/c\<property name="worklight.server.install.dir" value="'$MobileFirstServer_PATH'"/>' $MobileFirstServer_PATH/WorklightServer/configuration-samples/create-database-db2.xml
101 sed -i '/"database.db2.host"/c\<property name="database.db2.host" value="localhost"/>' $MobileFirstServer_PATH/WorklightServer/configuration-samples/create-database-db2.xml103 sed -i '/"database.db2.host"/c\<property name="database.db2.host" value="'$db2_address'"/>' $MobileFirstServer_PATH/WorklightServer/configuration-samples/create-database-db2.xml
102 sed -i '/"database.db2.port"/c\<property name="database.db2.port" value="'$db2port'"/>' $MobileFirstServer_PATH/WorklightServer/configuration-samples/create-database-db2.xml104 sed -i '/"database.db2.port"/c\<property name="database.db2.port" value="'$db2port'"/>' $MobileFirstServer_PATH/WorklightServer/configuration-samples/create-database-db2.xml
103 sed -i '/"database.db2.instance"/c\<property name="database.db2.instance" value="db2inst1"/>' $MobileFirstServer_PATH/WorklightServer/configuration-samples/create-database-db2.xml105 sed -i '/"database.db2.instance"/c\<property name="database.db2.instance" value="db2inst1"/>' $MobileFirstServer_PATH/WorklightServer/configuration-samples/create-database-db2.xml
104 sed -i '/"database.db2.driver.dir"/c\<property name="database.db2.driver.dir" value="'$DB2_INSTALL_PATH'/java"/>' $MobileFirstServer_PATH/WorklightServer/configuration-samples/create-database-db2.xml106 sed -i '/"database.db2.driver.dir"/c\<property name="database.db2.driver.dir" value="'$CHARM_DIR'/files/archives"/>' $MobileFirstServer_PATH/WorklightServer/configuration-samples/create-database-db2.xml
105 sed -i '/"database.db2.admin.username"/c\<property name="database.db2.admin.username" value="'$dbusrname'"/>' $MobileFirstServer_PATH/WorklightServer/configuration-samples/create-database-db2.xml107 sed -i '/"database.db2.admin.username"/c\<property name="database.db2.admin.username" value="'$dbusrname'"/>' $MobileFirstServer_PATH/WorklightServer/configuration-samples/create-database-db2.xml
106 sed -i '/"database.db2.wladmin.dbname"/c\<property name="database.db2.wladmin.dbname" value="WRKLGHT"/>' $MobileFirstServer_PATH/WorklightServer/configuration-samples/create-database-db2.xml108 sed -i '/"database.db2.wladmin.dbname"/c\<property name="database.db2.wladmin.dbname" value="WRKLGHT"/>' $MobileFirstServer_PATH/WorklightServer/configuration-samples/create-database-db2.xml
107 sed -i '/"database.db2.wladmin.schema"/c\<property name="database.db2.wladmin.schema" value="WLADMIN"/>' $MobileFirstServer_PATH/WorklightServer/configuration-samples/create-database-db2.xml109 sed -i '/"database.db2.wladmin.schema"/c\<property name="database.db2.wladmin.schema" value="WLADMIN"/>' $MobileFirstServer_PATH/WorklightServer/configuration-samples/create-database-db2.xml
@@ -132,43 +134,45 @@
132 fi134 fi
133135
134 else136 else
135 juju-log "Liberty is not installed"137 juju-log "IBM MFSVR: Liberty is not installed"
138 exit 0
136 fi139 fi
137140
138}141}
139142
140#After installing the product we need to run ant commands to create WORKLIGHT database143#Post install configurations.
141postworklightinstall_configuration()144postworklightinstall_configuration()
142{145{
143146
144 juju-log "editing_configure-liberty-db2.xml file"147 juju-log "IBM MFSVR: Editing configure-liberty-db2.xml file"
145 edit_configure_liberty_db2_file148 edit_configure_liberty_db2_file
146 juju-log "editing create-database-db2.xml file"149 juju-log "IBM MFSVR: Editing create-database-db2.xml file"
147 edit_create_database_db2_file150 edit_create_database_db2_file
148 juju-log "Running ant commands"151
152 juju-log "IBM MFSVR: Running ant commands"
149 cd $MobileFirstServer_PATH/WorklightServer/configuration-samples153 cd $MobileFirstServer_PATH/WorklightServer/configuration-samples
150 #Run create admdatabases command154 #Run create admdatabases command
151 ant -f create-database-db2.xml admdatabases155 ant -f create-database-db2.xml admdatabases
152 if [ $? -eq 0 ]; then156 if [ $? -eq 0 ]; then
153 juju-log "IBM MFSVR: ant create admddatabase command ran sucessfully"157 juju-log "IBM MFSVR: ant create admddatabase command ran successfully"
154 else158 else
155 juju-log "IBM MFSVR: ant create admddatabase command failed to run"159 juju-log "IBM MFSVR: ant create admddatabase command failed to run"
156 exit 1 160 exit 1
157 fi161 fi
158162
159 #Run create-database-db2.xml databases command163 #Run create-database-db2.xml databases command
160 ant -f create-database-db2.xml databases164 ant -f create-database-db2.xml databases
161 if [ $? -eq 0 ]; then165 if [ $? -eq 0 ]; then
162 juju-log "IBM MFSVR: ant create database command ran sucessfully"166 juju-log "IBM MFSVR: ant create database command ran successfully"
163 else167 else
164 juju-log "IBM MFSVR: ant create database failed to run"168 juju-log "IBM MFSVR: ant create database command failed to run"
165 exit 1169 exit 1
166 fi170 fi
167171
168 #Run configure admdatabases command172 #Run configure admdatabases command
169 ant -f configure-liberty-db2.xml admdatabases173 ant -f configure-liberty-db2.xml admdatabases
170 if [ $? -eq 0 ]; then174 if [ $? -eq 0 ]; then
171 juju-log "IBM MFSVR: ant configure liberty admddatabase command ran sucessfully"175 juju-log "IBM MFSVR: ant configure liberty admddatabase command ran successfully"
172 else176 else
173 juju-log "IBM MFSVR: ant configure liberty admddatabase command failed to run"177 juju-log "IBM MFSVR: ant configure liberty admddatabase command failed to run"
174 exit 1178 exit 1
@@ -177,16 +181,26 @@
177 #Run configure databases command181 #Run configure databases command
178 ant -f configure-liberty-db2.xml databases182 ant -f configure-liberty-db2.xml databases
179 if [ $? -eq 0 ]; then183 if [ $? -eq 0 ]; then
180 juju-log "IBM MFSVR: ant configure liberty database command ran sucessfully"184 juju-log "IBM MFSVR: ant configure liberty database command ran successfully"
181 else185 else
182 juju-log "IBM MFSVR: ant configure liberty database command failed to run"186 juju-log "IBM MFSVR: ant configure liberty database command failed to run"
183 exit 1187 exit 1
184 fi188 fi
185 189
186 #Run configure databases adminstall command190 #Run adminstall command
187 ant -f configure-liberty-db2.xml adminstall 191 ant -f configure-liberty-db2.xml adminstall
188 if [ $? -eq 0 ]; then192 if [ $? -eq 0 ]; then
189 juju-log "IBM MFSVR: ant configure liberty database command ran sucessfully"193 juju-log "IBM MFSVR: ant adminstall command ran successfully"
194 else
195 juju-log "IBM MFSVR: ant adminstall command failed to run"
196 exit 1
197 fi
198
199
200 #Run install command to configure sample runtime environment
201 ant -f configure-liberty-db2.xml install
202 if [ $? -eq 0 ]; then
203 juju-log "IBM MFSVR: ant configure liberty database command ran successfully"
190 else204 else
191 juju-log "IBM MFSVR: ant configure liberty database command failed to run"205 juju-log "IBM MFSVR: ant configure liberty database command failed to run"
192 exit 1206 exit 1
@@ -194,7 +208,7 @@
194208
195 }209 }
196210
197#restart liberty server after installing the software to launch webconsole/Appcenterconsole211#Restart liberty server after post install configuration to launch webconsole/Appcenterconsole
198restart_worklightserver()212restart_worklightserver()
199{213{
200 214
@@ -224,7 +238,7 @@
224juju-log "IBM MFSVR: Begin website-relation-change hook "238juju-log "IBM MFSVR: Begin website-relation-change hook "
225mobilefirstserver_license_accepted=`config-get accept-ibm-mobilefirstserver-license`239mobilefirstserver_license_accepted=`config-get accept-ibm-mobilefirstserver-license`
226240
227#checks if liberty is exist or not241#Check if liberty is installed
228if ! [ -d $LIBERTY_INSTALL_PATH ]; then242if ! [ -d $LIBERTY_INSTALL_PATH ]; then
229 juju-log "IBM MFSVR: WebSphere Liberty Not found.Exiting!!"243 juju-log "IBM MFSVR: WebSphere Liberty Not found.Exiting!!"
230 exit 0244 exit 0
@@ -233,19 +247,9 @@
233fi247fi
234248
235249
236#checks if db2 is exist or not
237if ! [ -d $DB2_INSTALL_PATH ]; then
238 juju-log "IBM MFSVR: Db2 Not found.Exiting!!"
239 exit 0
240else
241
242 juju-log "IBM MFSVR: Db2 found."
243fi
244
245
246httpsport=`relation-get https-port`250httpsport=`relation-get https-port`
247if [ -z "$httpsport" ]; then251if [ -z "$httpsport" ]; then
248 juju-log "No data sent yet"252 juju-log "IBM MFSVR: No data sent yet"
249 exit 0253 exit 0
250fi254fi
251255
@@ -253,30 +257,32 @@
253juju-log "IBM MFSVR: IBM MobileFirst Server install START:"257juju-log "IBM MFSVR: IBM MobileFirst Server install START:"
254if [ $mobilefirstserver_license_accepted == False ]; then258if [ $mobilefirstserver_license_accepted == False ]; then
255 juju-log "IBM MFSVR: IBM mobilefirstserver License not accepted."259 juju-log "IBM MFSVR: IBM mobilefirstserver License not accepted."
260 exit 0
256261
257elif [ $mobilefirstserver_license_accepted == True ]; then262elif [ $mobilefirstserver_license_accepted == True ]; then
258 juju-log "License accepted"263 juju-log "License accepted"
259 #create worklight server264 #Create worklight server
260 create_worklightserver265 create_worklightserver
261 WL_installed=`is_worklight_installed`266 WL_installed=`is_worklight_installed`
262 juju-log $WL_installed267 juju-log $WL_installed
263 if [ $WL_installed == False ]; then268 if [ $WL_installed == False ]; then
264 #Check MobileFirst Server package availability269 #Check MobileFirst Server package availability
265 if [ -d $CHARM_DIR/files/archives/MobileFirst_Platform_Server/disk1 ]; then270 if [ -d $CHARM_DIR/files/archives/MobileFirst_Platform_Server/disk1 ]; then
266 juju-log "MobileFirst server Packages are available for installation."271 juju-log "IBM MFSVR: MobileFirst server Packages are available for installation."
267 #edit install response file."272 #Edit install response file."
268 edit_responsefile273 edit_responsefile
269 cd $IM_INSTALL_PATH/eclipse/tools274 cd $IM_INSTALL_PATH/eclipse/tools
270 juju-log "IBM MFSVR: Installing MobileFirst Server package."275 juju-log "IBM MFSVR: Installing MobileFirst Server package."
271 ./imcl input $CHARM_DIR/files/archives/install-MFS-responsefile.xml -acceptLicense -showProgress276 ./imcl input $CHARM_DIR/files/archives/install-MFS-responsefile.xml -acceptLicense -showProgress
272 juju-log "IBM MFSVR: Installation of MobileFirst server complete."277 juju-log "IBM MFSVR: Installation of MobileFirst server complete."
273 #check install sucessful or not278
279 #Check install successful or not
274 if [ -d $MobileFirstServer_PATH/WorklightServer ]; then280 if [ -d $MobileFirstServer_PATH/WorklightServer ]; then
275 juju-log "IBM MFSVR: Install Sucessful and moving to post install configuration"281 juju-log "IBM MFSVR: Install Sucessful and moving to post install configuration"
276 #Configure system values for IBM MobileFirst Server282 #Configure system values for IBM MobileFirst Server
277 postworklightinstall_configuration283 postworklightinstall_configuration
278 juju-log "IBM MFSVR: updated create_database_db2_file and configure_liberty_db2_file files"284 juju-log "IBM MFSVR: Modified create_database_db2_file and configure_liberty_db2_file files"
279 #restart worklight server 285 #Restart worklight server
280 restart_worklightserver286 restart_worklightserver
281 else287 else
282 juju-log "IBM MFSVR: Install failed"288 juju-log "IBM MFSVR: Install failed"
@@ -285,7 +291,6 @@
285 291
286 else292 else
287 juju-log "MobileFirst server Packages are missing. Please check README file."293 juju-log "MobileFirst server Packages are missing. Please check README file."
288 juju-log "Upgrade MobileFirst server charm after adding the MobileFirst server packages"
289 exit 1294 exit 1
290 fi295 fi
291 fi296 fi
292297
=== modified file 'metadata.yaml'
--- metadata.yaml 2015-07-23 06:49:52 +0000
+++ metadata.yaml 2015-10-09 16:12:21 +0000
@@ -7,6 +7,8 @@
7 - misc7 - misc
8subordinate: false8subordinate: false
9requires:9requires:
10 helper:
11 interface: helper
10 db:12 db:
11 interface: db213 interface: db2
12 website:14 website:
1315
=== modified file 'tests/00-setup'
--- tests/00-setup 2015-07-21 11:33:08 +0000
+++ tests/00-setup 2015-10-09 16:12:21 +0000
@@ -9,6 +9,7 @@
9MFS_URL=${MFS_URL?Error: IBM MFS repository must be defined in tests/00-setup}9MFS_URL=${MFS_URL?Error: IBM MFS repository must be defined in tests/00-setup}
10MFS_PKG=${MFS_PKG?Error: IBM MFS package be defined in tests/00-setup}10MFS_PKG=${MFS_PKG?Error: IBM MFS package be defined in tests/00-setup}
11IM_PKG=${IM_PKG?Error: IBM MFS package be defined in tests/00-setup}11IM_PKG=${IM_PKG?Error: IBM MFS package be defined in tests/00-setup}
12WLP_URL=${WLP_URL}
1213
13# Add a local configuration file14# Add a local configuration file
14cat << EOF > local.yaml15cat << EOF > local.yaml
@@ -19,6 +20,8 @@
19 mobilefirstserver_url: "$MFS_URL"20 mobilefirstserver_url: "$MFS_URL"
20 mobilefirstserver_package_name: "$MFS_PKG"21 mobilefirstserver_package_name: "$MFS_PKG"
21 im_package_name: "$IM_PKG"22 im_package_name: "$IM_PKG"
23Liberty:
24 liberty-install-path: "$WLP_URL"
2225
23EOF26EOF
2427
2528
=== modified file 'tests/10-deploy.py'
--- tests/10-deploy.py 2015-07-23 16:20:34 +0000
+++ tests/10-deploy.py 2015-10-09 16:12:21 +0000
@@ -61,10 +61,13 @@
61 d.add('websphere-liberty' , placement="mobilefirst-server")61 d.add('websphere-liberty' , placement="mobilefirst-server")
62 d.configure('websphere-liberty', { 'accept-ibm-websphere-license': True })62 d.configure('websphere-liberty', { 'accept-ibm-websphere-license': True })
63 d.configure('websphere-liberty', { 'accept-ibm-java-license': True })63 d.configure('websphere-liberty', { 'accept-ibm-java-license': True })
64 d.add('db2' , placement="mobilefirst-server")64 d.add('db2')
65 d.add('mfs-helper' , placement="db2")
65 d.configure('db2', { 'accept-ibm-db2-license': True, 'db2_url': url, 'db2_package_name' : pkg })66 d.configure('db2', { 'accept-ibm-db2-license': True, 'db2_url': url, 'db2_package_name' : pkg })
66 d.configure('mobilefirst-server', { 'accept-ibm-im-license': True, 'mobilefirstserver_url': mfsurl, 'im_package_name' : impkg })67 d.configure('mobilefirst-server', { 'accept-ibm-im-license': True, 'mobilefirstserver_url': mfsurl, 'im_package_name' : impkg })
67 d.configure('mobilefirst-server', { 'accept-ibm-mobilefirstserver-license': True, 'mobilefirstserver_url': mfsurl, 'mobilefirstserver_package_name' : mfspkg })68 d.configure('mobilefirst-server', { 'accept-ibm-mobilefirstserver-license': True, 'mobilefirstserver_url': mfsurl, 'mobilefirstserver_package_name' : mfspkg })
69 # Add relation mobilefirst server to mfs-helper
70 d.relate('mobilefirst-server:helper', 'mfs-helper:helper')
68 # Add relation mobilefirst server to db271 # Add relation mobilefirst server to db2
69 d.relate('mobilefirst-server:db', 'db2:db')72 d.relate('mobilefirst-server:db', 'db2:db')
70 # Add relation mobilefirst server to websphere-liberty73 # Add relation mobilefirst server to websphere-liberty
7174
=== modified file 'tests/local.yaml'
--- tests/local.yaml 2015-07-21 11:33:08 +0000
+++ tests/local.yaml 2015-10-09 16:12:21 +0000
@@ -2,7 +2,9 @@
2 db2_url: "http://9.124.100.99/debs/DB2"2 db2_url: "http://9.124.100.99/debs/DB2"
3 db2_package: "DB2_Svr_10.5.0.3_Linux_x86-64.tar.gz"3 db2_package: "DB2_Svr_10.5.0.3_Linux_x86-64.tar.gz"
4mobilefirst-server:4mobilefirst-server:
5 mobilefirstserver_url: "http://9.124.100.99/debs/WORKLIGHT"5 mobilefirstserver_url: "http://9.124.100.99/debs/mobilefirst-server"
6 mobilefirstserver_package_name: "MFPF_7.0_INST_MGR_REP_MF_SVR_EN.zip"6 mobilefirstserver_package_name: "MFPF_7.0_INST_MGR_REP_MF_SVR_EN.zip"
7 im_package_name: "agent.installer.linux.gtk.x86_64_1.7.1000.20131119_2219.zip"7 im_package_name: "agent.installer.linux.gtk.x86_64_1.7.1000.20131119_2219.zip"
8Liberty:
9 liberty-install-path: "opt/ibm/wlp"
810

Subscribers

People subscribed via source and target branches

to all changes: