190 likes | 274 Views
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.
E N D
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
Executing a Lifecycle • Lifecycles are executed by calling a phase • Phase identifies where in lifecycle to stop • Examples: • mvn test • mvn install • mvn clean install • mvn install site clean • mvn clean compile package install clean
Phases in Lifecycle • Phases in a lifecycle are mapped to plugin goals • Dictated by packaging type and pom config
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 • 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? • 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)
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
Roles of new Build System Project Team Build Team Add Project to Anthill Take configurable properties from team add them to secondary process. Enable specified environments • 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 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!!!