ALM_Module_Training

advertisement
Using the ALM Module
Michael Youngstrom
Disclaimer
• This is a training NOT a presentation.
– Be prepared to learn and participate in lab
• Please ask questions
• Prerequisites:
– Maven Knowledge
• https://tech.lds.org/wiki/Java_Stack_Training
Recent Build Landscape Changes
•
•
•
•
•
Build/Deploy Landscape has changed since 3.1
Anthill Pro replaced CruiseControl for builds
Anthill “Secondary Process” use increased
Many teams now use Anthill for deployment
DB Migrator continues to grow
– Some teams executing migrations from Anthill
• Test Runner created for post build test execution
• Many improvements in infrastructure automation
• Some projects deploying UI and CDN content
separate from application
Stack 3.1 Build Problems
• Integrated application deploy, functional test,
and db migration with maven build
– Long build times
– Complex builds
– Build failed if deploy failed
• Poor Anthill “secondary process” support
– Difficult to add unique post build tasks
– Inconsistency between build and post build actions
Goals of Build Improvements
• Simplify build by separating build and post build
processes
– Once per build vs. Many per build
• Give post build power to the team
• Leverage current investment in Maven
• Execute build and post build tasks inside and
outside of Anthill
• Consistent build promotions
• We want fully automated deployments!!!
Maven Lifecycles
• Maven uses lifecycles to orchestrate goals
• Phases represent steps in a lifecycle
Default
process-resources
compile
test-compile
Site
site
site-deploy
test
package
Clean
integration-test
install
pre-clean
deploy
clean
Executing a Lifecycle
• Lifecycles are executed by calling a phase
• Phase identifies where in lifecycle to stop
Default
Site
• Examples:
process-resources
site
– mvn test
site-deploy
– mvn install
Clean
– mvn clean install
pre-clean
– mvn install site clean
clean
– mvn clean compile package install clean
compile
test-compile
test
package
integration-test
install
deploy
Phases in Lifecycle
• Phases in a lifecycle are mapped to plugin goals
– Dictated by packaging type and pom config
Site
Default
Phases
Phases
War Bindings
process-resources
compile
compiler:compile
test-compile
compiler:testCompile
test
surefire:test
package
war:war
integration-test
install
install:install
deploy
deploy:deploy
Bindings
site
site:site
site-deploy
site:deploy
Clean
Phases
Bindings
pre-clean
clean
clean:clean
Example Binding in Pom Config
<project>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>1.0.1</version>
<executions>
<execution>
<goals><goal>enforce</goal></goals>
<phase>compile</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
ALM the Lifecycle for Deployments
• Default Lifecycle builds
and managing artifacts
• What might a lifecycle
for application
deployment look like?
– Migrate database
– Deploy app
– Test deployed app
ALM Lifecycle
Phases
Bindings
alm-db
stack-db:migrate
alm-deploy
stack-tcat:deploy
alm-test
stack-test:functional-test
alm-promote
• Quiz:
– clean install
– alm-promote
– clean install alm-promote
Packaging the ALM Module
• How does this help?
• ALM Module creates a
.zip containing:
– The project
– All Dependencies
– settings.xml file
How to execute a post build promotion?
1.
2.
3.
4.
Download alm zip file for project
Execute: mvn -s settings.xml alm-promote
Optionally add appropriate ‘-D’ parameters
Specify env using a maven profile (e.g. -P stage)
ALM Promotion Demo
Lab ALM Module Builds
https://tech.lds.org/wiki/Using_the_ALM_Module
#Lab_1
Executing through Anthill Pro
• Anthill represents an excellent engine for
executing ALM Modules
– Securely store build artifacts
– Can securely handle passwords
– Easily add parameters to a maven build
– Can track state of builds
– Can record and store results from multiple test runs
Execute ALM Promotion in Anthill Demo
Roles of new Build System
Project Team
• Set Default configuration in
ALM pom.xml for project
– Functional Tests?
– DB Migration?
– Test Groups? (smoke, full, etc)
• Test promotion on local box
• Identify Anthill configurable
properties
– Skip Plugins?
– Usernames and passwords?
• Identify the Environments to
enable
Build Team
• Add Project to Anthill
• Take configurable properties
from team add them to
secondary process.
• Enable specified
environments
Java Stack Team
• Help Customize ALM
Module
Imagine the Possibilities!
• Plugins currently tested and working with alm module:
–
–
–
–
DB Migrator
Tcat Deploy
Vanilla Tomcat Deploy
Test Runner
• Possible future work:
–
–
–
–
–
–
–
Deployment of static content
CDN Deployment/Expiration
Update of WAM Policies
Marklogic Deploy
Enhance Test runner to update QA Test Cases
Putting up Out of Service Page During Deployment
Many more
Conclusion
•
•
•
•
ALM Module provides promotion orchestration
Puts more control in hands of project team
Build process now separate from promotion
Anthill pro is an excellent promotion engine
• We hope to see more fully automated
promotions in the future!!!
Download