From 7915efa2e36d1442df7e70f6279cf71c9a3bf0aa Mon Sep 17 00:00:00 2001 From: Harsh Mishra Date: Wed, 18 Mar 2026 20:50:23 +0530 Subject: [PATCH 1/2] Add README for CodePipeline sample source app --- README.md | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..00fd94c --- /dev/null +++ b/README.md @@ -0,0 +1,53 @@ +# CodePipeline Sample Source — Message Utility Java App + +This repository is a sample source application used to demonstrate [LocalStack's](https://localstack.cloud) AWS CodePipeline emulation. It showcases a full CI/CD workflow with CodeBuild (Maven build + JUnit tests), CodeDeploy (ECS blue/green deployment), and CloudFormation stack provisioning. + +## Overview + +The application is a simple Java utility (`MessageUtil`) built with Maven and packaged as a JAR. The pipeline: + +1. **Source** — pulls this repository as the pipeline source. +2. **Build** — uses CodeBuild with Amazon Corretto 11 to compile the Maven project and run JUnit tests, producing `target/messageUtil-1.0.jar`. +3. **Deploy** — deploys an nginx-based Docker image (serving `index.html`) to an ECS service via CodeDeploy blue/green deployment. +4. **Provision** — optionally creates an SQS queue via the included CloudFormation template. + +## Repository Structure + +``` +. +├── Dockerfile # nginx image serving index.html +├── appspec.yml # CodeDeploy AppSpec for ECS blue/green deployment +├── buildspec.yml # CodeBuild build specification (Java/Maven) +├── cfn_stack.yaml # CloudFormation template — creates an SQS queue +├── index.html # Static HTML page served by nginx +├── pom.xml # Maven project descriptor for Message Utility +└── src/ + ├── main/java/MessageUtil.java # Java utility class + └── test/java/TestMessageUtil.java # JUnit tests +``` + +## Prerequisites + +- [LocalStack](https://localstack.cloud) with a valid `LOCALSTACK_AUTH_TOKEN` +- Docker with access to the Docker socket +- AWS CLI and [`awslocal`](https://github.com/localstack/awscli-local) + +```bash +export LOCALSTACK_AUTH_TOKEN= +``` + +## Usage + +This repository is intended to be used as the **source stage** of a LocalStack CodePipeline sample. Refer to the parent pipeline repository for end-to-end setup instructions. + +When used standalone, you can build the Maven project locally: + +```bash +mvn install +``` + +This compiles `MessageUtil.java`, runs the JUnit tests, and produces `target/messageUtil-1.0.jar`. + +## License + +Licensed under the Apache License 2.0. See [LICENSE](LICENSE). From a017bf5547b3da14d0b6d0815389f23dccde20c0 Mon Sep 17 00:00:00 2001 From: Harsh Mishra Date: Wed, 18 Mar 2026 20:55:58 +0530 Subject: [PATCH 2/2] Update README.md --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 00fd94c..7a2cf9d 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # CodePipeline Sample Source — Message Utility Java App -This repository is a sample source application used to demonstrate [LocalStack's](https://localstack.cloud) AWS CodePipeline emulation. It showcases a full CI/CD workflow with CodeBuild (Maven build + JUnit tests), CodeDeploy (ECS blue/green deployment), and CloudFormation stack provisioning. +This repository is a sample source application used to demonstrate [LocalStack's AWS CodePipeline](https://docs.localstack.cloud/aws/services/codepipeline/) emulation. It showcases a full CI/CD workflow with CodeBuild (Maven build + JUnit tests), CodeDeploy (ECS blue/green deployment), and CloudFormation stack provisioning. ## Overview @@ -13,7 +13,7 @@ The application is a simple Java utility (`MessageUtil`) built with Maven and pa ## Repository Structure -``` +```bash . ├── Dockerfile # nginx image serving index.html ├── appspec.yml # CodeDeploy AppSpec for ECS blue/green deployment @@ -28,9 +28,9 @@ The application is a simple Java utility (`MessageUtil`) built with Maven and pa ## Prerequisites -- [LocalStack](https://localstack.cloud) with a valid `LOCALSTACK_AUTH_TOKEN` -- Docker with access to the Docker socket -- AWS CLI and [`awslocal`](https://github.com/localstack/awscli-local) +- A valid [LocalStack for AWS license](https://localstack.cloud/pricing), which provides a [`LOCALSTACK_AUTH_TOKEN`](https://docs.localstack.cloud/getting-started/auth-token/) required to run these samples. +- [Docker](https://docs.docker.com/get-docker/) with access to the Docker socket. +- - AWS CLI and [`awslocal`](https://github.com/localstack/awscli-local) ```bash export LOCALSTACK_AUTH_TOKEN=