Title: EAS306 - Automating the Build and Deployment Process of EAServer
1Automating the Build and Deployment Process of
EAServer Components
Marty Jones Senior Software Engineer Marty_Jones_at_
DailyAccess.com Doug Porter Programmer Doug_Porte
r_at_DailyAccess.com August 17, 2004
2Who We Are
- DailyAccess Corporation (www.dailyaccess.com) is
a leading Third-Party RecordKeeper for retirement
plans with holdings in excess of 2.1 Billion - Specialize in EAServer, PowerBuilder, and Java
technologies, automating back-office aspects of
mutual-fund trading, settlement, and management - Certified Developers on Staff
- PowerBuilder
- Java
3Agenda
- Automated Builds What? Why?
- Project Scope and Expectations
- Automation Overview
- Setup Requirements
- Build Process
- Interactive Demonstration
- Future Direction and Enhancements
- References
- Technologies Used
- Questions?
- Contact Information
4Automated Builds What?
Typical EAServer Development Cycle
Design
Implementation
Fail
Build / Unit Test
Deploy
Q.A.
Pass
Integration Test
Production Release
5Automated Builds Why?
- Build Integrity
- The build process will highlight any components
affected by IDL changes in existing components - Consistency
- Repeatable, consistent builds are critical for
quality assurance - Integrated Unit Testing
- Suites of Unit Tests can be applied as part of
the build process to ensure source code
correctness and prevent regression bugs - Time Savings
- Saves an enormous amount of time building a
complete server from a version control system - Allows for continuous integration periodic
builds highlight integration issues early
6Project Scope and Expectations
- PowerBuilder source stored at PBL-level
(StarTeam integration) - IDL is considered contractual design
- No overloaded methods IDL-mangling discouraged
- Camelback naming convention
Component Models
Supported
Not Supported
- CORBA-Java
- PowerBuilder NVO
- Enterprise JavaBeans (EJB)
- C
- ActiveX
7Automation Overview - Java
Build Server
Source Control
8Automation Overview - PowerBuilder
Build Server
Source Control
Proxies and Stubs
9Setup Requirements
- EAServer Baseline build server
- Clean copies of the following folders
- ltEAServer Install Dirgt/Java/Classes
- ltEAServer Install Dirgt/Repository/Component
- ltEAServer Install Dirgt/Repository/Package
- ltEAServer Install Dirgt/Repository/Server
- ltEAServer Install Dirgt/Repository/IDL
- These clean copies are used to revert the
build server to a known good baseline
installation. - Note Registry settings are not preserved as
part of this clean server, and are not
generally recommended for use in component
development.
10Setup Requirements (Cont.)
- Source Control Folder Layout
- Create a directory structure that will hold the
package and component source to be retrieved from
the version control system. Below is an example
of this directory structure.
11Build Process
- Define Master Component Processing File
- Establish baseline clean server
- Create IDL Definitions on EAServer
- Generate Stubs and PowerBuilder Proxy libraries
- Component Compilation and Deployment
- (Optional) Recreate IDL Definitions for
correctness - Re-deploy Component props (PB only)
- Synchronize build server to target deployment
server
12Build Process (Cont.)
- Define Master Component Processing File
- Create an XML file that contains the packages and
components that are to be deployed to Jaguar. - This file is used for Stub generation as well as
Package and Component generation.
13Build Process (Cont.)
- Establish baseline clean server
- Shutdown the Build Jaguar server if it is
currently running - Delete the following folders
- ltEAServer Install Dirgt/java/classes
- ltEAServer Install Dirgt/Repository/Server
- ltEAServer Install Dirgt/Repository/Package
- ltEAServer Install Dirgt/Repository/Component
- ltEAServer Install Dirgt/Repository/IDL
- Copy the following clean folders to the
ltEAServer Install Dirgt - /java/classes
- /Repository/Server
- /Repository/Package
- /Repository/Component
- /Repository/IDL
- Start Build Jaguar server.
14Build Process (Cont.)
- Create IDL Definitions on EAServer
- Retrieve IDL files from Project in Version
Control. - Use custom Ant task to define IDL within the
Build Jaguar Server. This Ant task takes into
account any IDL dependencies and will define all
dependent IDL entities prior to defining the
parent entity. - IDL dependencies are determined by parsing the
parent IDL file and retrieving all the include
directives. - For each dependency, the Repository is checked
for its existence. - If no IDL exists for this dependency, then the
task defines the IDL entity.
15Build Process (Cont.)
- Generate Stubs and PowerBuilder Proxy libraries
- Use custom Ant task to iterate the Master
Component Processing file. - Use custom Ant task to generate Java Stubs for
each package entry that is found within the file.
A custom Ant task is needed here because JagAnt
does not support generating stubs from a Module
entity type. The Java Stubs are compiled
directly into the Build Jaguar Server. - Use custom Ant task to generate a PowerBuilder
Proxy library. - Create temporary PowerBuilder library with an
application object - Create proxy project object and import it into
temporary PowerBuilder library file - Retrieve proxies from Build Jaguar Server into
new PowerBuilder library by executing the proxy
project object
16Build Process (Cont.)
- Component Compilation and Deployment
- Use custom Ant task to iterate the Master
Component Processing file. - Use JagAnt to create Package entities on Build
Jaguar Server. - Java Components
- Source code is retrieved from Version Control and
compiled into the /java/classes folder of the
Build Jaguar Server. - PowerBuilder Components
- Source code is retrieved from Version Control.
- Any project objects listed within the target are
deployed using the OrcaScript - command interpreter (orcascr9.exe) to the Build
Jaguar Server.
17Build Process (Cont.)
- (Optional) Recreate IDL Definitions for
correctness - This step is only necessary if you deploy
PowerBuilder component and care about keeping
consistent IDL naming conventions - The deployment of PowerBuilder Components will
change the IDL to have lower case method names
and data types - Use custom Ant task to overwrite the current IDL
for the package being processed. - This process occurs on a package level if a
PowerBuilder component was processed within that
package. - Re-deploy Component props (PB only)
- Use JagAnt task to update components properties
- Any user defined or system defined properties
that are not supported by PowerBuilders
deployment process. Ex Maximum number of pooled
components property.
18Build Process (Cont.)
- Synchronize build server to target deployment
server - Use custom Ant task to iterate the Master
Component Processing file. - Use JagAnt task to synchronize each package
within the Master Component Processing file.
19Interactive Demonstration
LoanProcessing/InterestCalculator (PB)
PowerBuilder Client
calculateInterest double principal double
duration
getRate
calculateInterest double principal double
duration
PowerBuilder Client used to determine total
interest on a loan. Client calls
calculateInterest method on LoanProcessing/Interes
tCalculator component passing loan principal and
duration. InterestCalculator component makes an
intercomponent call to Util/InterestRate
component getRate method to determine interest
rate of loan. Run Client
Util/InterestRate (Java)
getRate
20Scenario 1
LoanProcessing/InterestCalculator (PB)
PowerBuilder Client
calculateInterest double principal double
duration
getRate
calculateInterest double principal double
duration
Util/InterestRate getRate( ) method modified to
accept amount argument of type double. IDL and
implementation change. Outcome
LoanProcessing/InterestCalculator will raise
BuildException since intercomponent call in
LoanProcessing/InterestCalculator component
calculateInterest( ) method not updated to
reflect new argument.
Util/InterestRate (Java)
getRate double amount
21Scenario 2
LoanProcessing/InterestCalculator (PB)
PowerBuilder Client
calculateInterest double principal double
duration
getRate double amount
calculateInterest double principal double
duration
LoanProcessing/InterestCalculator
calculateInterest( ) method intercomponent call
to Util/InterestRate getRate( ) method updated to
match Util/InterestRate method signature. Outcome
Successful Server Components Build
Util/InterestRate (Java)
getRate double amount
22Scenario 3
LoanProcessing/InterestCalculator (PB)
PowerBuilder Client
calculateInterest double principal double
duration string frequency
getRate double amount
calculateInterest double principal double
duration
LoanProcessing/InterestCalculator
calculateInterest( ) method modified to accept
new frequency argument of type string. IDL and
implementation change. Outcome PowerBuilder
client will fail with BuildException
Util/InterestRate (Java)
getRate double amount
23Scenario 4
LoanProcessing/InterestCalculator (PB)
PowerBuilder Client
calculateInterest double principal double
duration string frequency
getRate double amount
calculateInterest double principal double
duration string frequency
PowerBuilder Client update call to
LoanProcessing/InterestCalculator component
calculateInterest( ) method to match component
method signature Outcome Successful Client
Build
Util/InterestRate (Java)
getRate double amount
24Future Direction and Enhancements
- Add support for EJBs
- Add a user interface to allow a user to
selectively choose a version / branch from source
control for building - Add full integration testing support for
components
- PowerBuilder build local component as a
Jaguar JAR - PowerBuilder option to generate pbd only
- jagtool create stubs for Module entity type,
not just Package and Component entity types - jagtool start server
25References
- Ant Web site
- http//ant.apache.org
- Orca SDK download
- http//powerbuilder.codexchange.sybase.com/servlet
s/ProjectDocumentList?folderID465 - OrcaScript reference
- http//sybooks.sybase.com/onlinebooks/group-pb/pbg
0900e/pbug/_at_Generic__BookTextView/56982 - Command-Line Deployment With OrcaScript article
- http//www.samspublishing.com/articles/article.asp
?p98852seqNum4 - Benefits of Continuous Integration (article by
Martin Fowler) - http//www.martinfowler.com/articles/continuousInt
egration.html
26Technologies Used
- Apache Ant 1.6.1
- Open source Java-based build tool, similar to
make - Sybase EAServer 5.1 Build 51016
- jagtool Command-line deployment/development
automation tool - jagant EAServer extensions to Ant, providing
access to jagtool - Sybase PowerBuilder 9.01 Build 6533
- pborc90.dll - native dll that exposes, via ORCA
(Open Repository Case API), PowerBuilder IDE
functionality that is not available via command
line (import, export). - orcascr9.exe ORCAscript command processor which
can sequentially process ORCA commands stored in
a text file - Borland StarTeam 5.3 Build 214
- Enterprise version control system
- JDK 1.4.2_03
27Questions?
- Will you be releasing any of this as open-source?
28Contact Information
- Send E-mail and Questions to
- marty_jones_at_dailyaccess.com
- doug_porter_at_dailyaccess.com
- Visit Our Website
- www.dailyaccess.com
- To download this presentation and related code
- www.dailyaccess.com/corp/techwave2004.vm