AWS CodePipeline
AWS CodePipeline is a continuous integration and continuous delivery (CI/CD) service for fast and reliable application and infrastructure updates. This guide provides instructions on how to configure AWS CodePipeline to deploy Martini packages from your repository.
Overview
The Martini CI/CD setup supports two workflows:
- Build Docker Images — bundles a specific Martini Server Runtime version together with application packages and publishes the final image to Amazon ECR.
- Upload Martini Packages — zips packages and uploads them directly to a running Martini instance via the Martini API.
Both pipelines are fully automated using Terraform, CodePipeline, CodeBuild, CloudWatch, SSM Parameter Store, and reusable shared modules inside the unified repository.
Pipeline Types
1. Build Docker Images
Buildspec: martini-build-image.yaml
This pipeline produces a reproducible Docker image containing:
- A specified Martini Server Runtime version
- All Martini application packages
The image is pushed to Amazon ECR and is ideal when runtime and package versions must be locked together.
Supporting file:
- Dockerfile
2. Upload Martini Packages
Buildspec: martini-upload-package.yaml
Uploads packages to a Martini runtime instance with regex filtering, async mode, and polling features.
Supporting file:
- upload_packages.sh
Deploying Pipelines with Terraform
All infrastructure and buildspecs reside in a unified repository with shared modules and pre-commit automation.
Steps
1. Clone the repository
1 2 | |
2. Initialize and Deploy
1 2 | |
SSM Parameter Configuration
Build Image Parameters
| Parameter | Required | Description |
|---|---|---|
| MARTINI_VERSION | No | Defaults to latest |
Upload Package Parameters
| Parameter | Required | Description |
|---|---|---|
| BASE_URL | Yes | Martini instance URL |
| MARTINI_ACCESS_TOKEN | Yes | Auth token |
| PACKAGE_NAME_PATTERN | No | Regex, default .* |
| PACKAGE_DIR | No | Default packages |
| ASYNC_UPLOAD | No | Default false |
| SUCCESS_CHECK_TIMEOUT | No | Default 6 |
| SUCCESS_CHECK_DELAY | No | Default 30 |
| SUCCESS_CHECK_PACKAGE_NAME | No | Optional |
Triggering the Pipeline
1 | |