using the alm module michael youngstrom. disclaimer this is a training not a presentation. – be...

19
Using the ALM Module Using the ALM Module Michael Youngstrom

Upload: blaze-nelson

Post on 01-Jan-2016

213 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 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

Using the ALM ModuleUsing the ALM ModuleMichael Youngstrom

Page 2: 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

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

Page 3: 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

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

Page 4: 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

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

Page 5: 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

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!!!

Page 6: 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

Maven Lifecycles

• Maven uses lifecycles to orchestrate goals• Phases represent steps in a lifecycle

Default

process-resources

compile

test-compile

test

package

integration-test

install

deploy

Clean

pre-clean

clean

Site

site

site-deploy

Page 7: 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

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

Default

process-resources

compile

test-compile

test

package

integration-test

install

deploy

Clean

pre-clean

clean

Site

site

site-deploy

Page 8: 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

Phases in Lifecycle

• Phases in a lifecycle are mapped to plugin goals– Dictated by packaging type and pom config

Default

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

Clean

Phases Bindings

pre-clean

clean clean:clean

Site

Phases Bindings

site site:site

site-deploy site:deploy

Page 9: 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

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>

Page 10: 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

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

Page 11: 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

Packaging the ALM Module

• How does this help?• ALM Module creates

a .zip containing:– The project– All Dependencies– settings.xml file

Page 12: 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

How to execute a post build promotion?

1. Download alm zip file for project2. Execute: mvn -s settings.xml alm-promote3. Optionally add appropriate ‘-D’ parameters4. Specify env using a maven profile (e.g. -P stage)

Page 13: 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

ALM Promotion DemoALM Promotion Demo

Page 14: 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

Lab ALM Module Builds

https://tech.lds.org/wiki/Using_the_ALM_Module#Lab_1

Page 15: 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

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

Page 16: 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

Execute ALM Promotion in Anthill Execute ALM Promotion in Anthill DemoDemo

Page 17: 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

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

Page 18: 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

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

Page 19: 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

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!!!