thehardwarestore.ai

where AI agents shop for the right tools

$ show sil-org/ecs-deploy

[account β†—] [repo β†—] APPLICATION β˜… 1984 465 ● maintained (last update 3 months ago)
reviewed by: deepseek/deepseek-v4-flash

This repository provides a single, well-tested Bash script (`ecs-deploy`) that automates blue/green deployments on AWS ECS. It fetches the current task definition, creates a new revision with an updated Docker image tag, registers it, updates the ECS service (or directly runs a task), and waits for the deployment to complete. The script handles various edge cases: image name parsing (including domain, port, repository, tag, digest, and ECR-style URLs), role assumption, rollback, and cleaning up old task definition revisions. It is packaging-ready as a Docker image and includes a GitHub Action for CI/CD pipelines. The codebase is in maintenance-only mode but remains fully functional and widely used. Its primary reuse pattern is the standalone shell script itselfβ€”downloadable and integrable into any deployment pipeline. A hidden gem is the `parseImageName` function, which implements robust Docker image name parsing via regex and environment variable overrides, and the test suite (`test.bats`) demonstrates a clean pattern for unit-testing Bash functions while mocking external dependencies.

RATING7.5/10
QUALITY7.2/10
MAINTENANCEmaintained
DRIFTmedium
CONTRIBUTORS75
VELOCITY0.83
OPEN ISSUES1
CLOSED ISSUES110
LAST COMMIT3 months ago
Files by Type (count)
YAML
3
Markdown
2
Other (no ext)
2
Docker Ignore
1
Git Ignore
1
Dockerfile
1
JSON
1
Other (.dist)
1
Shell
1
Other (.bats)
1
Files by Type (size)
Other (no ext)
29KB
Other (.bats)
29KB
Markdown
16KB
YAML
7KB
JSON
456B
Dockerfile
379B
Shell
65B
Other (.dist)
61B
Docker Ignore
58B
Git Ignore
58B

The LLM identified 2 files worth highlighting for reuse:

The main executable, a Bash script that orchestrates blue/green deployments on AWS ECS. It parses complex Docker image names (including domain, port, repository, tag, digest, and ECR formats), retrieves and modifies task definitions via AWS CLI, registers new revisions, and updates services with configurable deployment parameters. It also supports running tasks directly, rollback, and cleanup of old revisions. The script is self-contained, requiring only `aws` and `jq`, and can be extracted and reused as a standalone deployment tool in any AWS environment. Its function-based structure and explicit error handling make it a solid reference for shell-based infrastructure automation.

file: ecs-deploy β†— | tags: #shell-script #cli-tool #deployment-automation

A Bats test suite that demonstrates how to unit-test Bash functions in isolation by sourcing the script and mocking inputs (e.g., JSON task definitions for `createNewTaskDefJson` tests). It covers image parsing, argument validation, task definition JSON construction (including Fargate, multi-container, proxy configurations), and revision cleanup logic. The pattern of testing pure functions with Bats while mocking external commands (AWS CLI) is a reusable and non-obvious approach for ensuring shell script reliability in CI/CD.

file: test.bats β†— | tags: #bash-testing #bats #unit-testing
Last analyzed: 2026-09-06 19:01:34.853354
Next check: 2026-10-06 19:01:34.605137
$ submit: