emerge-deploy

Guides building, migrating, rolling, smoke-testing, and rolling back Docker deployments across the Emerge estate.

Updated Sep 1, 2026
One-click install
npx skills add https://github.com/Harbour-Emerge/skills --skill emerge-deploy-harbour-emerge
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: emerge-deploy
Source: https://github.com/Harbour-Emerge/skills/tree/main/emerge-deploy
Command: npx skills add https://github.com/Harbour-Emerge/skills --skill emerge-deploy-harbour-emerge

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Deploying services on a shared multi-tenant box fails silently in ways that cost hours to diagnose: port conflicts with other tenants, CRLF line endings breaking bash scripts, env mismatches boot-looping containers, and CI suites that go green by skipping tests. This Skill encodes the verified deploy patterns, preflight checks, and known traps for the Emerge estate so each failure mode is caught before it ships. ## Core Features & Use Cases - Golden-path deploy workflow: Documents the exact build, migrate, roll, and smoke-test sequence used by the reference implementation, including SHA-tagged images for one-command rollback. - Preflight check catalog: Lists the checks that catch silent failures, such as PUBLIC_ORIGIN/APP_ENV agreement, raw '#' in database passwords, and effective env verification via docker compose config. - Trap and gap registry: Records known issues like port 80 being owned by another tenant, TLS-ALPN-01 certificate issuance, pinned compose subnets, and repos missing .gitattributes. - Use Case: Before pushing a change to main that triggers a production deploy, consult this Skill to confirm the branch state, verify the on-box .env, check port ownership across the four tenants, and know the current image tag for rollback. ## Quick Start Ask the AI to walk you through deploying the emerge-forms stack to the demo box, including the preflight checks and rollback command.

Frequently Asked Questions about emerge-deploy

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I deploy a Docker Compose stack to a production server safely?

Run the deploy script from the repository root on the box: it preflights silent-failure risks, builds images tagged with the commit SHA, runs migrations as a separate step, rolls services, then smoke-tests the public origin. Any failure leaves previous containers running and prints the rollback command.

How do I roll back a failed Docker deployment?

Roll back by re-tagging: because images carry the commit SHA, run docker compose up -d with IMAGE_TAG set to the previous SHA. The deploy script prints the exact rollback command with the prior tag filled in when a deploy fails.

Why does my bash deploy script fail with 'bash\r': No such file or directory?

The script was checked out with CRLF line endings from a Windows-edited repo. Add a .gitattributes file forcing LF for .sh, .yml, .sql, Dockerfile, and similar files so Linux tools can parse them after checkout.

Can Caddy get a certificate when port 80 is already in use?

Yes, via the TLS-ALPN-01 challenge over port 443. Move Caddy's HTTP listener to a loopback port, ensure TCP 443 is open on the firewall, and set SITE_ADDRESS to the real hostname so ACME falls through to TLS-ALPN.

Why does my CI test suite pass when the database is unreachable?

Tests that skip when TEST_DATABASE_URL is unset make the suite green by skipping instead of failing. Add a CI step that greps the test log for the skip message and fails the build, so a green run actually proves the database-backed tests ran.

Should database migrations run as a container entrypoint?

No. Run migrations as a separate step before rolling services, never as a container entrypoint. This ordering is a core convention in the deploy pattern and prevents partially migrated states during rollouts.