This is a simple demo Java Spark application, with continuous delivery integration, using GitFlow, CircleCI, EB cli and AWS ElasticBeanstalk.
- Spark
- Gradle
- Jar with dependencies (shadowJar)
- AWS ElasticBeanstalk deployment with EB cli
- CircleCI integration with EB cli
- EB cli and GitFlow branch integration
- Code coverage
- Swagger documentation
- SwaggerUI
- Spark Auto-reload
- eb deploy -l $(gradle properties | grep version | cut -c 10-)
To start deployment this application to your AWS ElasticBeanstalk environments, you will need:
- Create an AWS account
- Gerenate an AWS security credentials
- Configure this credential into your CircleCI project
- Create your application in AWS ElasticBeanstalk
Then by simply making changes and pushing to theese branches (<master>
, <release>
and <develop>
), CircleCI will update your enviroments automatically.
Git branch | ElasticBeanstalk enviroment |
---|---|
master | demo-spark-eb-ci |
release | demo-spark-eb-ci-hml |
develop | demo-spark-eb-ci-dev |
- Java JDK 8
- Gradle
- EB cli
To deploy to your enviroments manually you will need:
Then run the eb cli deploy command:
eb deploy <your-eb-enviroment> --profile <your-eb-cli-profile>
Description | Command |
---|---|
Build | ./gradlew build |
Build w/ dependencies (shadow/jar) | ./gradlew shadowJar |
Test | ./gradlew test |
Run | ./gradlew run or java -jar ./build/libs/demo-spark-eb-ci-shadow.jar |
ElasticBeanstalk initialization | eb init |
Create EB application | eb create <your-eb-enviroment> |
After your environment has been create/deployed, you need to edit your security groups rules
Type | Protocol | Port range | Source | Description |
---|---|---|---|---|
Custom TCP Rule | TCP | 4567 | 0.0.0.0/0 |
(with load balancer)
Type | Protocol | Port range | Source | Description |
---|---|---|---|---|
Custom TCP Rule | TCP | 4567 | <your-sg-elb> |
Type | Protocol | Port range | Source | Description |
---|---|---|---|---|
Custom TCP Rule | TCP | 4567 | <your-sg-ec2> |
Load Balancer Protocol | Load Balancer Port | Instance Protocol | Instance Port | Cipher | SSL Certificate |
---|---|---|---|---|---|
HTTP | 80 | HTTP | 4567 |