Plugin Information |
---|
View WAS Builder on the plugin site for more information. |
This plugin allows Jenkins to invoke IBM WebSphere Application Server's wsadmin as a build step.
About this plugin
This plugin allows to invoke the wsadmin command of IBM WebSphere Application Server (WAS) 6.0/6.1/7.0 as a build step. It can be used for example to deploy a freshly built application (self-promo: using the RAD Builder Plugin).
This plugin supports:
- WAS 6.0 (versions 1.0 to 1.6 successfully tested with WAS 6.0.2.15 – should work with other 6.0.2.x versions)
- WAS 6.1 (not yet tested)
- WAS 7.0 (version 1.1 to 1.6 successfully tested with Administration Thin Client built from WAS 7.0.0.7 – should work with other 7.0.0.x versions)
- WAS 8.0 (version 1.6 successfully tested with full WebSphere v8 non-ND installation – thanks Ilko Iliev for the feedback)
User guide
Before adding a WAS build step to a job, the WAS Builder plugin must be configured as follow:
- First, one or several WAS installations must be defined in Jenkins' main configuration panel (cf. upper part of the screenshot below). These WAS installations must not necessarily correspond to some running WAS servers: The plugin simply uses their wsadmin command (the one located in the
bin
folder of the installed product) to connect to remote servers.
- Once at least one installation is defined, you need to save the changes and to go back to Jenkins' main configuration panel to be able to define the servers that the jobs will use (lower part of the screenshot above).
Once at least one server is defined, it's possible to add some "IBM WebSphere Application Server 6.x/7.x" build steps to your jobs (cf. screenshot below). Most of wsadmin options can be controlled through the GUI. Take a look at the inline help (the little question marks located on the right of each field) to know more about each feature.
The Run if field doesn't correspond to a wsadmin option. It can be used to dynamically enable/disable a build step for a particular run: If Run if is defined (let's say with the STOP_SERVER
value) for a build step, then the build step will be run if and only if:
- a build variable with the same name (in our case,
STOP_SERVER
) is defined and has a value, - or (exclusive) if no build variable with the same name is defined and an environment variable with the same name (still
STOP_SERVER
in our example) is defined, whether it has a value or nor.
When defining a build step for WAS 6.0, be sure to refer to the inline help to know if you can use it: Some options (job ID, trace file, etc.) are available only for WAS 6.1 or greater.
Check-out this post on IBM developerWorks to get an introduction on how this plugin can be used (thanks Ilko).
Version history
Version 1.6.1 (10/20/2011)
- Fixed JENKINS-11104:
wsadmin
was not working when used withsudo
Version 1.6 (08/07/2011)
- Update for Jenkins
Version 1.5 (04/23/2010)
- Added a new Wsadmin command field (at the WAS installation level) allowing to tweak the
wsadmin.bat
/wsadmin.sh
command actually run, for example to prefix it withsudo
. - The list of WAS servers is now alphabetically sorted when saving the global configuration.
Version 1.4 (04/13/2010)
- The Run if option now allows to use boolean parameters in addition to build or environment variables.
Version 1.3 (04/13/2010)
- Added an option which allows creating automatically, if the locks-and-latches plugin is installed, one lock per defined WAS server.
Version 1.2 (04/06/2010)
- Added an option for allowing the wsadmin user/password at the build step level.
Version 1.1 (03/30/2010)
- Added the support for administration thin clients.
Version 1.0.1 (01/24/2010)
- Bug fix: Installations defined for slave nodes were not taken into account; The plugin was always referring to the installation on the master node.
Version 1.0 (12/18/2009)
- Initial release
48 Comments
abrugger -
Is it possible to know when this plugin will be available? We want to use Hudson to make some WAS deployment (WAS 6.1) and it will be useful for us.
Antony
Romain Seguy
Hello Antony,
The plugin seems to work fine on Windows XP, I just need to do some testing on Linux to see if the "Run if" stuff works fine (which I have a doubt). Once done, I'll release the plugin, maybe at the end of this week.
Anyway, if you want to get it in advance, the source code is available in the SVN repository.
Romain Seguy
The plugin has been released this morning (18/12/2009), it should appear soon in Hudson's plugins center.
Unknown User (paul.cleary@oracle.com)
I have this plugin installed on the latest hudson release on linux.
I have Websphere 6.1.0.21 installed locally as well.
I would like to deploy to a remote websphere instance also running Websphere 6.1.0.21.
I setup a WAS installation and WAS server, but I don't see where I configure the step in my Hudson Job. It is a Maven 2 job, can I only add the step in a freestyle project?
Now, the tough question, I need to auto deploy to a remote server, any details on what should be in the Websphere step in my job to do that? I guess I need to Update the application, save everything, and restart the application server.
Any help is greatly appreciated.
Regards,
Paul
Romain Seguy
You're right, the plugin is currently restricted to freestyle projects as I don't have M2 projects to ensure it would work fine with it (I prefer restricting functionalities rather than providing buggy ones).
If you wish, I can pack & send an "unlimited" version of the plugin for you to test so that I can officialy expand the scope of the plugin.
For your last question, I use to do the following to deploy apps on a remote WAS server:
Stopping/starting the node makes sense only the first time JAAS auth data are created or when the value of the password changes.
Additional point: I always create two jobs to build apps: The first builds and unit-tests the app, the second one does the deployment on WAS.
Regards,
Romain
Unknown User (vrspraveen.atluri@gmail.com)
Hello Romain,
1) Are you using Power Shell plugin to invoke remote Websphere Installation Scripts?
2) I am trying to build and deploy maven project. Can you provide me the unlimited version of the plugin?
Regards,
Praveen Atluri
Romain Seguy
The plugin uses wsadmin.bat/wsadmin.sh to administer WAS and, normally, version 1.0.1 of the plugin is no more restricted to free style jobs.
To use it directly from a Maven job, you need to install the M2 Extra Steps Plugin. But I would recommend splitting it to another downstream job since, IMO, build and deployment are clearly two different things.
zzstore -
Is there any way to run the wsadmin.sh script using sudo on unix?
Romain Seguy
If you describe exactly what you expect, I may integrate it.
zzstore -
The plugin runs the following command:
/usr/IBM/WAS61/AppServer/bin/wsadmin.sh -conntype SOAP -host hostname -port 61000 -user.....
The unix permissions of the WAS installation at our place are set such that I cannot run the wsadmin script without using sudo.
Is there anyway you could run it as:
/usr/sudo/sudo /usr/IBM/WAS61/AppServer/bin/wsadmin.sh -conntype SOAP -host ...
Romain Seguy
What I'm going to do is adding a new field in the global config page to be able to override the wsadmin command for each WAS installation.
Romain Seguy
I've implemented your enhancement request, it's part of release 1.5.
zzstore -
Thanks, When can I expect release 1.5 to be available to download?
Romain Seguy
I've released it last Friday, the SVN tag is in place (https://hudson.dev.java.net/svn/hudson/tags/was-builder-1.5/), the announcement too, so it might be the update center which is a little bit late.
Heleno Valle
Hi,
I'm trying to use this "Wsadmin Command" feature, but it is not working. It seems Jenkins is treating the field content as a single command.
This is the Console Output I'm receiving (note the quotation marks around what came from the "Wsadmin Command" field):Using user admin defined at the server level
$ "/usr/bin/sudo /home/was/IBM/WebSphere/AppServer01/bin/wsadmin.sh" -conntype SOAP -host zefiro.cit -port 8880 -user admin -password ******** -lang jython -f "/var/lib/jenkins/jobs/AVD ZEFIRO/workspace/newDeploy.py" "AVD ZEFIRO" zefiro Vendas
FATAL: Wsadmin execution failed
Build step 'IBM WebSphere Application Server 6.x/7.x' marked build as failure
Checking console output
Finished: FAILURE
I'm using Jenkins 1.430 and WAS Builder Plugin 1.6.
Can any one help me?
Thanks in advance.
Romain Seguy
Is there more information displayed in Jenkins' log (accessible from the main configuration screen)?
Heleno Valle
I'm afraid it doesn't say much thing...
Sep 19, 2011 4:18:01 PM hudson.model.Run runINFO: AVD ZEFIRO #12 main build action completed: FAILURE
and that's all.... :-(
Heleno Valle
My only clue is still the quotation marks around de "sudo wsadmin" pair... :-/
Romain Seguy
Can you create an issue in JIRA? I'll fix that, I think you're right regarding the quotes. I'll remove them.
Heleno Valle
Issues created (https://issues.jenkins-ci.org/browse/JENKINS-11104).
I'm looking forward to a solution! Thank you very much!
Romain Seguy
I've just attached a fix to the JIRA issue. Can you please give a try with it? If it works for you (on my side it works), I'll release 1.6.1.
Unknown User (kirthish kulkarni)
Hi ,
My requirement is to deploy the application in Websphere Cluster environment , so following are the steps i followed in ant build file which i call in Hudson job
1. checkout code from CVS
2. run a CMD file for building the application ear file , using wesphere python script .
3. finally , restarting the manager and nodes
which seems to be a hectic job
how can i configure the WEBSPHERE - Cluster setup into Hudson using WAS-Plugin , and add pre-setup and post-setup steps which will run
my python script and publish the deployment details.
Thanks & Regards ,
Kirthish Kulkarni.
Unknown User (jvorpahl)
Romain,
Thanks for building the plug-in. It works great but I'm having a small issue. When a deployment fails, it still says the build is successful. Is there something I can do to pass the value back to Hudson? When I run wsadmin outside of the plugin see that the %ERRORLEVEL% parameter is > 0 (105 to exact) when it exits on error. But the plugin must be preventing Hudson from recognizing the error code of the wsadmin.bat program. I could use the windows batch command build option but the plugin makes everything much easier to setup and read and also the plugin hides the password to the server. That is a huge plus.
Thanks in advance for the help.
Unknown User (ilkomiliev@gmail.com)
I wrote short post about my experience setting up CI infrastructure based on Jenkins, using this plugin to deploy remotely between different WAS8 environments. The post can be found here.
At Enfe
Hi,
We have a doubt as WAS Think Client integration with WAS Server. Our system have a machine with jenkins (with WAS builder plugin) and a lot of remote WAS. The WAS Think client versión is 7.0.0.12 (instaled in Jenkins machine) and we want deploy aplications in WAS servers with other versions like 7.0.0.13, 7.0.0.14. ¿Is this a problem? ¿Have one experience about it?
And the second, in all the WAS we have a security enabled, ¿Could be a problem?
Thanks a lot,
AtEnfe
Romain Seguy
==> No, it's not a problem, it will work fine.
==> No, the plugin handles security nicely as long as signers have been added to the trust store.
Walter Kacynski
I have a situation where I need the username and password defined at the server level available to use inside of a wsadmin script. This will be used to configure LDAP security. Is there a way that these can be externalized so they are available inside of a admin script and hopefully keep them secure?
Romain Seguy
It's possible: You can use variables within the user and password fields at the build step level.
Auro Rolle
Is it possible to pass a variable as "Was Server" instead of selecting it from a combo at the build step level? This is useful in case of parametrized builds.
If it is not possible, could I ask for that feature?
Romain Seguy
In fact this feature has already been implemented in the next version of the plugin. There's a $SERVER entry in the list, which picks the value from the SERVER variable. I'll tell about your comment to the new maintainer of the plugin, Daniel.
Auro Rolle
Great! Thank you. Auro
Chris Hennigfeld
Is it possible to use a WebSphere installation that has spaces in the path? Mine is installed under C:\Program Files and I want to invoke a python script via wsadmin.bat.
Here is the Jenkins console output:
I tried putting quotation marks, either single or double, around the path in the main Jenkins configuration. Doesn't work, the configuration complains it's not a folder and the build step won't even start. Is there any other way to make it work despite the spaces?
Romain Seguy
I suggest you user a DOS-style notation, like
C:\Progra~1
rather thanC:\Program Files
. As this, there won't be any spaces, and it will work.Chris Hennigfeld
Thanks for the quick answer, that works.
Another question came up though:
In our environment, Jenkins and WebSphere are running on the same machine and wsadmin through SOAP etc. isn't set up. Running from the command line, I can simply not specify the -conntype, -host and -port options or use -conntype NONE. The plugin apparently doesn't allow that, I have to specify a connection type and can only choose SOAP, RMI, or JSR160RMI. Can I get NONE in there somehow?
Romain Seguy
Yep, this is something which can be done. I just don't know why I didn't put it in place.
Would you go ahead and develop the corresponding patch? That's something easy to do.
Chris Hennigfeld
I changed the build to invoke wsadmin via the command line instead. Works, I just need to remember to update it separately if something about the WAS configuration changes later. I haven't worked on any Jenkins plugins before, so I'd rather not spend the time I need to configure my IDE etc. to make the change, even if in the code it's just a small issue.
Walter Kacynski
Is there a timeline of when version 2.0 will be released? I am really interested in the Message Broker support.
troy town
How do you get this to work??
My WAS is located on my remote windows server and Jenkins is on Linux. I don't understand the part were it says the "Installation directory" the wsadmin file would be located on my remote WAS under the /bin directory... so what exactly would i put in "Installation directory" field ?? I just want to run a jacl script that needs to execute the "wsadmin" command that is located on the windows server that will replace my .ear file after my build deployment is complete. Thank you for your help.
Michael Wan
I have a similar problem where Jenkins is on one Red Hat box while WebSphere 8 is on another Red Hat box. How should I config this thing? Or I have to install another WebSphere 8 instance on the first Red Hat?
Walter Kacynski
To do this, you must either install WAS on the Jenkins Slave or use the AdminThin client on the Jenkins Slave.
See: http://pic.dhe.ibm.com/infocenter/wasinfo/v7r0/topic/com.ibm.websphere.base.doc/info/aes/ae/txml_adminclient.html
Ioana Creanga
Hello.
Can you put in some lines about how to make it work with administration thin client?
We are trying to achieve the following:
We need to automatically deploy one ear from jenkins to a remote WAS installation but we cannot afford ( well, people won`t let us) install a full instance of WAS.
After we have installed the plugin, we need to create a WAS instance on jenkins in order to use WAS builder plugin, but we do not have one.
I can see that you have support for administration thin clients but I am not sure how the path should look like so it can be recognised as a WAS instance.
Can you help me with that?
Also, the user name and password which needs to be provided on the plugin configuration panel should it have a deployer role on the remote WAS instance? Or should it be an user that connects locally to the administration thin client?
Very much appreciated.
Thanks,
Ioana.
Walter Kacynski
I have attached a sample script to this wiki page that I have used to launch the thin client. The IBM doc is fairly detailed on the requirements for this. You need to establish the trust.p12 and configure the soap.client.properties to make the connections.
Ioana Creanga
Hello.
I can see that you attached the thin client bat file. It`s very much appreciated. I did manage to setup the plugin and query some stuff remotely on the WAS instance. What I wasn`t able to do though was to actually deploy an ear, which was in fact my target.The thin client is on a Windows machine while WAS is installed on Aix and I get this error while using AdminApp.install:
ADMA0043E:
C:\Temp\app23320.ear does not exist for installation.
I assume that it tries to transfer the ear file to the remote machine and it is looking for the ear in a temporary folder on a windows machine, but the remote machine is an AIX. I`ve googled around, the only information I could find is that this might happen if I have WAS 5.1, that does not support the transfer,which is not the case or the 2 machines,the one with the thin client and the remote one run on different OS, which is my case but seems ridiculous to have that constraint.
Do you happen to know anything about it? I would really appreciate it. I know there are other ways of doing it, but some other methods require wasadmin password or having a root user on the remote machine, which we`re not allowed to have.
Thanks a lot for answering to my comment.
Cheers,
Ioana C.
Ioana Creanga
Hello.
I can see that you attached the thin client bat file. It`s very much appreciated. I did manage to setup the plugin and query some stuff remotely on the WAS instance. What I wasn`t able to do though was to actually deploy an ear, which was in fact my target.The thin client is on a Windows machine while WAS is installed on Aix and I get this error while using AdminApp.install:
ADMA0043E:
C:\Temp\app23320.ear does not exist for installation.
I assume that it tries to transfer the ear file to the remote machine and it is looking for the ear in a temporary folder on a windows machine, but the remote machine is an AIX. I`ve googled around, the only information I could find is that this might happen if I have WAS 5.1, that does not support the transfer,which is not the case or the 2 machines,the one with the thin client and the remote one run on different OS, which is my case but seems ridiculous to have that constraint.
Do you happen to know anything about it? I would really appreciate it. I know there are other ways of doing it, but some other methods require wasadmin password or having a root user on the remote machine, which we`re not allowed to have.
Thanks a lot for answering to my comment.
Cheers,
Ioana C.
Walter Kacynski
Your Jython script would specify the path of the EAR to deploy and that should be local to the Thin client because as you have said the Thin client does a transfer to the remote host.
Ioana Creanga
It does specify the path to the EAR locally. But when it tries to make the transfer, the ear is saved in C:/temp and it gets immediately deleted. And then I get the ear does not exist in C:/temp for installation error.
Pretty much like in this thread:
https://www.ibm.com/developerworks/community/forums/html/topic?id=77777777-0000-0000-0000-000002500699
Walter Kacynski
Hmm, I'm not sure, have you enable wsadmin tracing before the deployment command to analyze the failure point? AdminControl.trace('*=all=enabled')
Thomas Fieschi
Hello,
Is there any prevision regarding the 2.0 plugin release?
Thank you,
Thomas