
What
- Build über jar (jar with all dependencies) file and upload to Maven artifact repository
- Download jar file and upload to S3.
- Deploy lambda
Strategy for DevTest, Systest and Prod environment
We want to support three environments; Dev, Test and Production. Dev environment will automatically be updated with latest and greatest. Test environment will be automatically updated with the latest release. Manual deploy to production. This set up supports continuous delivery, and it is easy to enable continuous deployment when/if we want.
Continuous deployment means that every change is automatically deployed to production. Continuous delivery means that the team ensures every change can be deployed to production, but may choose not to do it.
TODO: use complete lambduh:deploy-lambda command lines for each environment later. Easier to read.
Trigger | CI server | Plugin internals | Comment |
---|---|---|---|
1. Developer: push to Git 2. mvn clean deploy |
Post step: mvn lambda:deploy-lambda -Plambda-deploy-devtest |
alias LATEST and withPublish=false is set automatically | |
1. CI server: successful mvn release | Post build action: mvn lambduh:deploy-lambda -Dalias=TEST |
alias <version>* and withPublish=true is set automatically | |
1. CI server: manually | Job: mvn lambduh:deploy-lambda -Dartifact=groupId:artifactId:version[:packaging][:classifier] -Dalias=PROD -DremoteRepositories= |
alias <version>* and withPublish=true is set automatically | If using the same AWS account for test and prod environment, this deployment can easily be done manually without a CI server job. |
- (version is same as version from jar file, but with "-" unstead of ".")
lambda-plugin will use http://maven.apache.org/plugins/maven-dependency-plugin/get-mojo.html under the hood to download artifacts
Dev environment - autodeploy
- Developer: push to Git
- Jenkins: mvn clean deploy
- Jenkins: on successful build, trigger new job: lambduh-maven-plugin
- Download snapshot version from mvn repo and upload to S3
- alias: DEV (reused), LATEST (reused)
- withPublish=false
Test environment - autodeploy
- Developer (in Jenkins): trigger mvn release
- Jenkins: on successful build, trigger new job: lambduh-maven-plugin
- Download release version from mvn repo and upload to S3
- alias: TEST (reused), <version> (version is same as version from jar file, but with "-" unstead of ".")
- withPublish=true
Production environment - manual
- Developer (in Jenkins): trigger new job: lambduh-maven-plugin
- Download release from mvn repo and upload to S3
- alias: PROD (reused), <version> (version is same as version from jar file, but with "-" unstead of ".")
- withPublish=true
Tech
- Git
- Maven
- Maven plugin for deloy to AWS Lambda, https://github.com/Cantara/lambduh-maven-plugin
- Jenkins
Read more
- AWS Lambda
- Maven