developer and fusion middleware 1 | mark nelson | continuous integration for soa bpm 11g.pdf
DESCRIPTION
TRANSCRIPT
<Insert Picture Here>
Continuous Integration for Oracle SOA Suite and Oracle Unified Business Process Management Suite Mark Nelson Consulting Solution Architect The A-Team
2
THE FOLLOWING IS INTENDED TO OUTLINE OUR GENERAL PRODUCT DIRECTION. IT IS INTENDED FOR INFORMATION PURPOSES ONLY, AND MAY NOT BE INCORPORATED INTO ANY CONTRACT. IT IS NOT A COMMITMENT TO DELIVER ANY MATERIAL, CODE, OR FUNCTIONALITY, AND SHOULD NOT BE RELIED UPON IN MAKING PURCHASING DECISION. THE DEVELOPMENT, RELEASE, AND TIMING OF ANY FEATURES OR FUNCTIONALITY DESCRIBED FOR ORACLE'S PRODUCTS REMAINS AT THE SOLE DISCRETION OF ORACLE.
3
Who are the A-Team?
4
We’re these guys!
5
Agenda
• Introduction – What is Continuous Integration? • Building Blocks
• Subversion • Maven • Hudson • Alternatives
• The WebLogic Maven Plugin • The SCA build process • Handling MDS • Handling Task Forms • Putting it all together
6
Continuous Integration
• Continuous Integration is a software engineering practice which attempts to improve quality and reduce time to deliver
• This is done by applying small, frequent quality control efforts
ORACLE CONFIDENTIAL
Let’s see an example…
7
Without Continuous Integration
ORACLE CONFIDENTIAL
1 ”HEAD”
We want to make some changes to an artifact in our project…
8
Without Continuous Integration
ORACLE CONFIDENTIAL
1 ”HEAD”
1
Check out
… so we check out the artifact from the version control system …
9
Without Continuous Integration
ORACLE CONFIDENTIAL
1 ”HEAD”
1
Check out
1’ Change
… and we make our changes. This may take several days …
10
Without Continuous Integration
ORACLE CONFIDENTIAL
1 2 3 4 5 ”HEAD”
1
Check out
1’ Change
… meanwhile, other developers have made changes too, and have checked them in to the version control system …
11
Without Continuous Integration
ORACLE CONFIDENTIAL
1 2 3 4 5 6 ”HEAD”
1
Check out
1’ Change
Integrate
… when we are ready to check our changes back in to the version control system (“integrate”) there is a big difference between our version and the HEAD version. This means integration will likely be difficult and time consuming …
12
Without Continuous Integration
ORACLE CONFIDENTIAL
1 2 3 4 5 6 ”HEAD”
1
Check out
1’ Change
Integrate
… it also means that when the next build happens, it is much more likely to have errors due to inconsistencies introduced by all these small changes made by different developers.
Build
13
With Continuous Integration
ORACLE CONFIDENTIAL
1 ”HEAD”
1
Check out
With continuous integration, we build every time there is a commit to HEAD. When we want to make changes we check out from version control …
Build
14
With Continuous Integration
ORACLE CONFIDENTIAL
1 2 ”HEAD”
1
Check out
1’ Change
… and make our changes. We should make fewer changes between commits to minimize the integration burden. Other developers will still be making changes in parallel and we will build when they commit ...
Build Build
15
With Continuous Integration
ORACLE CONFIDENTIAL
1 2 ”HEAD”
1
Check out
1’ Change
Integrate
… so when we come to integrate our changes, there is (so the theory goes) less work for us to do. We will also know very quickly if we have broken the build (minutes instead of days/weeks).
Build 3 Build 4 Build
16
Continuous Integration – Key Practices
• Continuous Integration is characterized by these key practices:
• Use of version control system • All developers commit to the HEAD every day • Build on every commit • The build must be automated and fast • Automated deployment to a production-like environment • Automated testing • Results of all builds are published (so everyone can see who
broke the build) • Deliverables are easily available (for developers, testers,
other stakeholders)
ORACLE CONFIDENTIAL
17
Agenda
• Introduction – What is Continuous Integration? • Building Blocks
• Subversion • Maven • Hudson • Alternatives
• The WebLogic Maven Plugin • The SCA build process • Handling MDS • Handling Task Forms • Putting it all together
18
Building Blocks - Subversion
• We need a version control system and Subversion is arguably the best choice for us today
• It is widely used and understood • It is well integrated with our other building blocks (Maven,
Hudson) • It is well integrated with JDeveloper • It can be used with strong authentication and through proxies,
VPNs, etc.
ORACLE CONFIDENTIAL
19
Building Blocks - Subversion
• Subversion is used to:
• Store our source artifacts • Share them between developers • Manage versions of artifacts
ORACLE CONFIDENTIAL
20
Agenda
• Introduction – What is Continuous Integration? • Building Blocks
• Subversion • Maven • Hudson • Alternatives
• The WebLogic Maven Plugin • The SCA build process • Handling MDS • Handling Task Forms • Putting it all together
21
Building Blocks - Maven
• Maven is a project management and build management system
• Project management in terms of: • Managing naming and version numbering • Managing dependencies • Managing where source code is stored • Managing where builds are stored • Managing templates for project types • Managing the release process
ORACLE CONFIDENTIAL
22
Building Blocks - Maven
• Maven is a project management and build management system
• Build management in terms of:
• How to execute the build • What to do in each phase • Parameterization of the build • An extensible framework
ORACLE CONFIDENTIAL
23
Maven Build Lifecycle
• Maven is based around the central concept of a build lifecycle • The process for building and distributing a particular artifact
(project) is clearly defined • Only necessary to learn a small set of commands to build any
Maven project, the POM ensures the project is built correctly • default, clean, site !
• Build lifecycles are further defined by a set of build phases • A build phase represents a stage in the lifecycle • Executed sequentially to complete the default lifecycle
• Build phase made up of goals • Phases are composed of goals that perform actual tasks • Default goal bindings for standard lifecycle phases • Plugins contribute additional goals to project
24
Maven Default Lifecycle
validate: ensure the project is correct and all necessary information is available
compile: compile the source code of the project
test: test the compiled source code using a suitable unit testing framework; tests should not require the code be packaged or deployed
package: take the compiled code and package it in its distributable format, such as a JAR, WAR, etc.
integration-test: process and deploy the package if necessary into an environment where integration tests can be run
verify: run checks to verify the package is valid and meets quality criteria
install: install the package into the local repository, for use as a dependency in other projects locally
deploy: for final release, copies the final package to the remote repository for sharing with other developers and projects.
h"p://maven.apache.org/guides/introduc5on/introduc5on-‐to-‐the-‐lifecycle.html
25
The Maven Process: End-to-End
Project pom.xml
Local repository
Custom plugins
Maven Build package
Maven Plugins
Input Output
26
Agenda
• Introduction – What is Continuous Integration? • Building Blocks
• Subversion • Maven • Hudson • Alternatives
• The WebLogic Maven Plugin • The SCA build process • Handling MDS • Handling Task Forms • Putting it all together
27
• Hudson is a common Continuous Integration server
• It is based around the concept of a ‘job’
• The Hudson dashboard displays status of all jobs
Building Blocks - Hudson
28
• Builds can be automatically triggered from SCM changes
• Jobs can be created directly from a Maven project
• Can execute any combination of Maven goals
Building Blocks - Hudson
29
• Allows automatic deployment to WLS and SOA on an SCM change
• Integration tests can be run against applications and composites on WLS/SOA
• Results reported in build status
Building Blocks - Hudson
30
Agenda
• Introduction – What is Continuous Integration? • Building Blocks
• Subversion • Maven • Hudson • Alternatives
• The WebLogic Maven Plugin • The SCA build process • Handling MDS • Handling Task Forms • Putting it all together
31
Alternatives
• Version control • git
• Allows distributed version control and offline commit • Seen as becoming more popular • Has some integration with JDeveloper too
• CVS • Works fine, but recommend not using the SCM polling in
Hudson/Jenkins with CVS due to CVS versioning model (every file)
• Continuous Integration • Hudson/Jenkins • Continuum
ORACLE CONFIDENTIAL
32
Agenda
• Introduction – What is Continuous Integration? • Building Blocks
• Subversion • Maven • Hudson • Alternatives
• The WebLogic Maven Plugin • The SCA build process • Handling MDS • Handling Task Forms • Putting it all together
33
The WebLogic Maven Plugin
• WebLogic Server 11g R1 (10.3.4) provides an official Maven plugin to perform application deployment operations • Maven Mojo + WebLogic Deployer + WebLogic Client
• Supports the deployment of Maven projects to WebLogic Server directly from Maven • No need to use console or command line deployment
utility • Can be wired into Maven lifecycle to automate
deployment for specific goals
34
WebLogic Maven Plugin Goals
35
Agenda
• Introduction – What is Continuous Integration? • Building Blocks
• Subversion • Maven • Hudson • Alternatives
• The WebLogic Maven Plugin • The SCA build process • Handling MDS • Handling Task Forms • Putting it all together
36
The SCA build process
ORACLE CONFIDENTIAL
• SCA builds are done using a set of ANT build files and tasks • Called ‘under the covers’ by JDeveloper • Or from the command line (so they can be automated)
37
The SCA build process
ant-sca-compile.xml, target: scac
scac.input: The location of the composite.xml
scac.application.home: The location of the Application directory
ant-sca-package.xml, target: package
compositeName: The name of the composite (will show up in EM)
compositeDir: The directory containing the composite
revision: The version number for the composite
scac.application.home: The location of the Application directory
ORACLE CONFIDENTIAL
38
The SCA build process
ant-sca-deploy.xml, target: deploy serverURL: The URL of the SOA instance
user: The user to do the deployment
password: The deploying user's password
sarLocation: The location of the SAR file
overwrite: Overwrite existing deployments with
same revision?
forceDefault: Make this version the default version?
partition: Which SOA partition to deploy into
ant-sca-test.xml, target: test
jndi.properties.input The name of the JNDI properties file
scatest.input The name of the composite to test
scatest.format The format for the results – “junit”
scatest.result The relative path to store the results in
ORACLE CONFIDENTIAL
39
Agenda
• Introduction – What is Continuous Integration? • Building Blocks
• Subversion • Maven • Hudson • Alternatives
• The WebLogic Maven Plugin • The SCA build process • Handling MDS • Handling Task Forms • Putting it all together
40
Some service components depend on Metadata Services (MDS)
• For example: • Human Tasks consume XSD from MDS • Rules consume XSD from MDS
• You may also choose to deploy canonical data models, abstract service definitions, etc. to MDS
• Your project will need an MDS connection defined in adf-config.xml, either: • File-based MDS, or • Database MDS
• And you must specify scac.application.home
ORACLE CONFIDENTIAL
41
Agenda
• Introduction – What is Continuous Integration? • Building Blocks
• Subversion • Maven • Hudson • Alternatives
• The WebLogic Maven Plugin • The SCA build process • Handling MDS • Handling Task Forms • Putting it all together
42
Handling Task Forms
• To build task form UI projects, we need to use the ojdeploy utility which is part of JDeveloper
• This means the build servers need access to an installation of JDeveloper
• We call ojdeploy using the exec-maven-plugin and pass in: • workspace The name of the JWS file • Profile The name of the deployment profile • Clean To rebuild all
ORACLE CONFIDENTIAL
43
Agenda
• Introduction – What is Continuous Integration? • Building Blocks
• Subversion • Maven • Hudson • Alternatives
• The WebLogic Maven Plugin • The SCA build process • Handling MDS • Handling Task Forms • Putting it all together
44
Putting it all together (without ADF)
ORACLE CONFIDENTIAL
MDS
ADF config
refers to
contains
45
Putting it all together (with ADF)
ORACLE CONFIDENTIAL
46
Agenda
• Introduction – What is Continuous Integration? • Building Blocks
• Subversion • Maven • Hudson • Alternatives
• The WebLogic Maven Plugin • The SCA build process • Handling MDS • Handling Task Forms • Putting it all together
47
More information about Continuous Integration for Oracle Fusion Middleware is available on my blog:
http://redstack.wordpress.com
Watch the blog for more detail leading up to OpenWorld and also for coverage of other products – OSB, ADF, WebCenter…
ORACLE CONFIDENTIAL
48
Join us at Oracle OpenWorld 2011
• Learn more about Continuous Integration for SOA/BPM at Oracle Develop, including:
• Handling resources (JDBC, JMS, etc) • Parameterization of the build • Dependencies between projects • Using Maven Archetypes • Harvesting assets into OER
ORACLE CONFIDENTIAL
<Insert Picture Here>
Continuous Integration for Oracle SOA Suite and Oracle Unified Business Process Management Suite Mark Nelson Consulting Solution Architect The A-Team