Maven - more than a build tool  Using Maven for automated configuration management and deployment Harald Søvik Sr. Knowled...
Agenda  <ul><li>Goal and objectives </li></ul><ul><li>Infrastructure </li></ul><ul><ul><li>Configure the AS </li></ul></ul...
Pragma: <ul><li>“ The software” is  </li></ul><ul><ul><li>code and build code </li></ul></ul><ul><ul><li>checked out from ...
<ul><li>Strategical goal: </li></ul><ul><ul><li>Automate manual, labourous tasks to reduce time spent on non-productive wo...
<ul><li>Objective : </li></ul><ul><ul><li>3-tier application: db, ejb-server and client + webserver.  </li></ul></ul><ul><...
Agenda  <ul><li>Goal and objectives </li></ul><ul><li>Infrastructure </li></ul><ul><ul><li>Configure the AS </li></ul></ul...
<ul><li>Step 1: Environmental configuration in build system </li></ul><ul><ul><li>Maven POM contains properties and profil...
The default profile: localhost. <profile> <id>default</id> <properties> <ejbServer>localhost</ejbServer> <webServer>localh...
An example profile: <profile> <id>test</id> <properties> <ejbServer>vm-utst3jb01</ejbServer> <webServer>vm-utst3jbweb01</w...
Runtime configuration <ul><li>Ad-hoc configuration can be defined run-time: </li></ul><ul><li>mvn  </li></ul><ul><ul><li>c...
<ul><li>Configuration of AS </li></ul><ul><li>Now, when the hosts are known, they can be configured. </li></ul><ul><ul><li...
<ul><li>Stop and start the AS </li></ul><ul><ul><li>invoke the native start/stop script via java runtime </li></ul></ul><u...
<ul><li>Deployment </li></ul><ul><ul><li>copy the application file to the application server </li></ul></ul><ul><ul><li>lo...
CI lifecycle Update from ci <scheduled> Build, package Stop the AS Clean, configure Deploy to AS Start the AS Deploy clien...
Agenda  <ul><li>Goal and objectives </li></ul><ul><li>Infrastructure </li></ul><ul><ul><li>Configure the AS </li></ul></ul...
<ul><li>Drawbacks : </li></ul><ul><ul><li>developers become oblivious to AS configuration/deployment </li></ul></ul><ul><u...
Agenda  <ul><li>Goal and objectives </li></ul><ul><li>Infrastructure </li></ul><ul><ul><li>Configure the AS </li></ul></ul...
<ul><li>Future: </li></ul><ul><ul><li>short term </li></ul></ul><ul><ul><ul><li>use in other projects </li></ul></ul></ul>...
Summary <ul><li>Simple, tool for configuration management </li></ul><ul><li>Easy to implement new requirements </li></ul><...
For More Information <ul><li>[email_address] </li></ul><ul><li>http://www.computas.com </li></ul>
Maven – more than a build tool Harald Søvik [email_address] Using Maven for automated configuration management and deploym...
Upcoming SlideShare
Loading in …5
×

Maven 2 - more than a build tool

662 views

Published on

Maven is basically a system for compiling code, packing code and publishing packed code, but the flexibility of plugins allows it to carry out a wide selection of tasks. Most often, these tasks are very developer-centric, assisting in the development- and deployment process. We have successfully implemented a plugin that extend the build system to also handle configuration management of various test-environments, nightly deployment of new versions from CI with a single parameter and easy, centrally controlled configuration of developers environments.
Even though the implementation is bound to our choice of infrastructure, the ideas and experiences should apply to a wide range of configurations.

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
662
On SlideShare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
1
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Maven 2 - more than a build tool

  1. 1. Maven - more than a build tool Using Maven for automated configuration management and deployment Harald Søvik Sr. Knowledge Engineer, Computas AS
  2. 2. Agenda <ul><li>Goal and objectives </li></ul><ul><li>Infrastructure </li></ul><ul><ul><li>Configure the AS </li></ul></ul><ul><ul><li>Deploy to AS </li></ul></ul><ul><ul><li>Manage AS lifecycle </li></ul></ul><ul><li>Drawbacks </li></ul><ul><li>Future </li></ul>
  3. 3. Pragma: <ul><li>“ The software” is </li></ul><ul><ul><li>code and build code </li></ul></ul><ul><ul><li>checked out from your VCS </li></ul></ul><ul><ul><li>that can be assembled </li></ul></ul><ul><ul><li>in a repeatable manner </li></ul></ul><ul><ul><li>and deployed to an application server </li></ul></ul>
  4. 4. <ul><li>Strategical goal: </li></ul><ul><ul><li>Automate manual, labourous tasks to reduce time spent on non-productive work in a software development project. </li></ul></ul><ul><li>Tactical goal: </li></ul><ul><ul><li>Automate configuration management of a system installation on a remote or local host. </li></ul></ul><ul><ul><li>Automate deployment of any version of the software to a defined envionment. </li></ul></ul><ul><ul><li>Automate the life cycle of application servers </li></ul></ul>
  5. 5. <ul><li>Objective : </li></ul><ul><ul><li>3-tier application: db, ejb-server and client + webserver. </li></ul></ul><ul><ul><li>De- and configure a existing JBoss installation. Client installation. No database intervention. </li></ul></ul><ul><ul><li>(Could have been installation of baseline datbase, patching with changes, validation of views/procedures/functions) </li></ul></ul><ul><ul><li>Multiple software branches: maintenance of production code, development of next major release, maybe a separate branch for a major change (should require no major reconfiguration) </li></ul></ul><ul><ul><li>Multiple stageing envrionments: development, test, systems/customer representative test, acceptance test. </li></ul></ul>
  6. 6. Agenda <ul><li>Goal and objectives </li></ul><ul><li>Infrastructure </li></ul><ul><ul><li>Configure the AS </li></ul></ul><ul><ul><li>Deploy to AS </li></ul></ul><ul><ul><li>Manage AS lifecycle </li></ul></ul><ul><li>Drawbacks </li></ul><ul><li>Future </li></ul>
  7. 7. <ul><li>Step 1: Environmental configuration in build system </li></ul><ul><ul><li>Maven POM contains properties and profiles. Profiles lets you select and possibly override a set of properties. And there is always the default profile. </li></ul></ul><ul><ul><li>The POM is under version control, and can be modified across branches. </li></ul></ul><ul><ul><li>Thus: profiles can correspond to &quot;physical&quot; environments, and let each profile have a set of hosts involved. </li></ul></ul>VCS VCS VCS Branch A pom.xml Branch A profile test: - host a - host b VCS VCS Branch A pom.xml Branch A VCS VCS Branch A pom.xml Branch A profile test: - ejb host A - web host B VCS VCS Branch A pom.xml v3.0 VCS VCS Branch A pom.xml Branch A profile test: - host a - host b VCS VCS Branch A pom.xml Branch A VCS VCS Branch A pom.xml Branch A profile test: - ejb host X - web host Y VCS VCS Branch A pom.xml v4.0
  8. 8. The default profile: localhost. <profile> <id>default</id> <properties> <ejbServer>localhost</ejbServer> <webServer>localhost</webServer> <clientHost>localhost</clientHost> <jbossHome>${JBOSS_HOME}</jbossHome> </properties> </profile>
  9. 9. An example profile: <profile> <id>test</id> <properties> <ejbServer>vm-utst3jb01</ejbServer> <webServer>vm-utst3jbweb01</webServer> <clientHost>ustts02</clientHost> <jbossHome>/usr/local/java/jboss</jbossHome> </properties> </profile>
  10. 10. Runtime configuration <ul><li>Ad-hoc configuration can be defined run-time: </li></ul><ul><li>mvn </li></ul><ul><ul><li>clean install </li></ul></ul><ul><ul><li>-Ptest </li></ul></ul><ul><ul><li>-DejbServer=vm-utst4jb01 </li></ul></ul><ul><ul><li>-DwebServer=vm-utst2jbweb01 </li></ul></ul>
  11. 11. <ul><li>Configuration of AS </li></ul><ul><li>Now, when the hosts are known, they can be configured. </li></ul><ul><ul><li>Remove previous configuration files and unneccessary files (whitelist/blacklist) </li></ul></ul><ul><ul><li>Copy libraries and configuration files </li></ul></ul><ul><ul><li>Each host has a folder in VCS where config and libs are stored as files </li></ul></ul><ul><ul><li>Clean the installation. Remove temporary files and serialized data. Remove prevous deployments. </li></ul></ul><ejbDeleteFiles> <string> deploy/hsqldb-ds.xml </string> <string> conf/jbossmq.xml </string> </ejbDeleteFiles> 3.0/ conf/ vm-utv3jb01/ JBoss/ lib/ itext.jar jasper.jar conf/ ojdbc-ds.xml log4j.xml
  12. 12. <ul><li>Stop and start the AS </li></ul><ul><ul><li>invoke the native start/stop script via java runtime </li></ul></ul><ul><ul><li>requires some AS-dependent knowledge </li></ul></ul><ul><ul><li>automated deployments must work: kill -9 if neccessary. </li></ul></ul>ssh <host> sudo /etc/init.d/jboss stop // read output stream and assert result // sleep ssh <host> ps -ef // read output and check status // possibly: ssh <host> kill <pid> ssh <host> kill -9 <pid>
  13. 13. <ul><li>Deployment </li></ul><ul><ul><li>copy the application file to the application server </li></ul></ul><ul><ul><li>locally, you can use java.io </li></ul></ul><ul><ul><li>scp to a remote server (but requires stuff beyond maven) </li></ul></ul><ul><ul><li>optionally </li></ul></ul><ul><ul><ul><li>scp in java </li></ul></ul></ul><ul><ul><ul><li>integrate with AS hot deploy </li></ul></ul></ul>
  14. 14. CI lifecycle Update from ci <scheduled> Build, package Stop the AS Clean, configure Deploy to AS Start the AS Deploy client Assert status
  15. 15. Agenda <ul><li>Goal and objectives </li></ul><ul><li>Infrastructure </li></ul><ul><ul><li>Configure the AS </li></ul></ul><ul><ul><li>Deploy to AS </li></ul></ul><ul><ul><li>Manage AS lifecycle </li></ul></ul><ul><li>Drawbacks </li></ul><ul><li>Future </li></ul>
  16. 16. <ul><li>Drawbacks : </li></ul><ul><ul><li>developers become oblivious to AS configuration/deployment </li></ul></ul><ul><ul><li>very generic - has few shortcuts </li></ul></ul><ul><ul><li>somewhat time consuming, but good for CI </li></ul></ul><ul><ul><li>already implemented by i.e. oracle grid control </li></ul></ul>
  17. 17. Agenda <ul><li>Goal and objectives </li></ul><ul><li>Infrastructure </li></ul><ul><ul><li>Configure the AS </li></ul></ul><ul><ul><li>Deploy to AS </li></ul></ul><ul><ul><li>Manage AS lifecycle </li></ul></ul><ul><li>Drawbacks </li></ul><ul><li>Future </li></ul>
  18. 18. <ul><li>Future: </li></ul><ul><ul><li>short term </li></ul></ul><ul><ul><ul><li>use in other projects </li></ul></ul></ul><ul><ul><ul><li>make available as open source </li></ul></ul></ul><ul><ul><ul><li>doc </li></ul></ul></ul><ul><ul><ul><li>remove dependencies on external tools </li></ul></ul></ul><ul><ul><li>long term </li></ul></ul><ul><ul><ul><li>must support multiple arcitectures </li></ul></ul></ul><ul><ul><ul><li>must support multiple application servers </li></ul></ul></ul>
  19. 19. Summary <ul><li>Simple, tool for configuration management </li></ul><ul><li>Easy to implement new requirements </li></ul><ul><li>Quick tool for developers </li></ul>
  20. 20. For More Information <ul><li>[email_address] </li></ul><ul><li>http://www.computas.com </li></ul>
  21. 21. Maven – more than a build tool Harald Søvik [email_address] Using Maven for automated configuration management and deployment

×