Scaffold Rails app with dev/prod infrastructure and CI pipeline #1

Closed
opened 2026-05-23 16:51:52 +00:00 by ldraney · 0 comments
Owner

Type

Feature

Lineage

Standalone -- first ticket for the landscaping-assistant project.

Repo

ldraney/landscaping-assistant

User Story

As a landscaper
I want a working Rails application with a proper CI/CD pipeline
So that all future features (address lookup, property CRUD) can be developed, tested, and deployed reliably from day one.

Context

This is the foundation ticket. The goal is to learn Ruby on Rails by getting the infrastructure right from the start. The app will be a monolithic Rails 8.1.3 application using Hotwire (Turbo + Stimulus) with PostgreSQL. It deploys to the pal-e k3s cluster via ArgoCD with kustomize overlays, matching the pal-enterprises pattern (another Rails app on port 3000).

The three-repo deployment model requires changes across pal-e-platform (NetworkPolicy), pal-e-services (var.services entry), and pal-e-deployments (kustomize overlay). See docs/infrastructure-and-pipeline.md for the exact configs.

File Targets

Files to create in this repo:

  • Gemfile -- Rails 8.1.3, pg, puma, rubocop, rspec-rails
  • Dockerfile -- multi-stage build, ruby:3.4.9-slim, EXPOSE 3000
  • .woodpecker.yaml -- lint, test, build-and-push (harbor-core.harbor.svc.cluster.local)
  • .rubocop.yml -- project lint config
  • config/database.yml -- PostgreSQL for dev/test/prod
  • db/seeds.rb -- 3 service types (Edging & Trimming, Mowing, Weeding)
  • Standard Rails scaffold from rails new

Files to create in other repos (separate PRs):

  • pal-e-platform/terraform/network-policies.tf -- add landscaping-assistant to postgres allowlist
  • pal-e-services/terraform/k3s.tfvars -- add var.services entry
  • pal-e-deployments/overlays/landscaping-assistant/prod/kustomization.yaml
  • pal-e-deployments/overlays/landscaping-assistant/prod/deployment-patch.yaml

Acceptance Criteria

  • rails new scaffold boots locally with rails server on port 3000
  • /up health check returns 200
  • PostgreSQL database connects in development
  • db:seed creates the 3 service types
  • Dockerfile builds and runs the app
  • Woodpecker pipeline passes (lint, test, build)
  • Image pushes to Harbor at landscaping-assistant/app
  • ArgoCD syncs and pod is running in k3s
  • Tailscale funnel serves the app at landscaping-assistant.tail5b443a.ts.net

Test Expectations

  • RSpec: default Rails health check test passes
  • RSpec: seed data creates 3 services
  • Run command: bundle exec rspec

Constraints

  • Port 3000 everywhere (Dockerfile, kustomize, probes, funnel)
  • CI must use internal Harbor URL (harbor-core.harbor.svc.cluster.local)
  • Database on shared CNPG cluster (pal-e-postgres-rw.postgres.svc.cluster.local)
  • Security context: runAsNonRoot, drop: ["ALL"] (match pal-enterprises pattern)
  • Health probes on /up (Rails 8 built-in)

Checklist

  • PR opened (this repo)
  • PR opened (pal-e-platform -- NetworkPolicy)
  • PR opened (pal-e-services -- var.services)
  • PR opened (pal-e-deployments -- kustomize overlay)
  • Tests pass
  • No unrelated changes
  • project-landscaping-assistant -- project page
  • docs/infrastructure-and-pipeline.md -- exact configs for all three repos
### Type Feature ### Lineage Standalone -- first ticket for the landscaping-assistant project. ### Repo `ldraney/landscaping-assistant` ### User Story As a landscaper I want a working Rails application with a proper CI/CD pipeline So that all future features (address lookup, property CRUD) can be developed, tested, and deployed reliably from day one. ### Context This is the foundation ticket. The goal is to learn Ruby on Rails by getting the infrastructure right from the start. The app will be a monolithic Rails 8.1.3 application using Hotwire (Turbo + Stimulus) with PostgreSQL. It deploys to the pal-e k3s cluster via ArgoCD with kustomize overlays, matching the pal-enterprises pattern (another Rails app on port 3000). The three-repo deployment model requires changes across pal-e-platform (NetworkPolicy), pal-e-services (var.services entry), and pal-e-deployments (kustomize overlay). See `docs/infrastructure-and-pipeline.md` for the exact configs. ### File Targets Files to create in this repo: - `Gemfile` -- Rails 8.1.3, pg, puma, rubocop, rspec-rails - `Dockerfile` -- multi-stage build, ruby:3.4.9-slim, EXPOSE 3000 - `.woodpecker.yaml` -- lint, test, build-and-push (harbor-core.harbor.svc.cluster.local) - `.rubocop.yml` -- project lint config - `config/database.yml` -- PostgreSQL for dev/test/prod - `db/seeds.rb` -- 3 service types (Edging & Trimming, Mowing, Weeding) - Standard Rails scaffold from `rails new` Files to create in other repos (separate PRs): - `pal-e-platform/terraform/network-policies.tf` -- add landscaping-assistant to postgres allowlist - `pal-e-services/terraform/k3s.tfvars` -- add var.services entry - `pal-e-deployments/overlays/landscaping-assistant/prod/kustomization.yaml` - `pal-e-deployments/overlays/landscaping-assistant/prod/deployment-patch.yaml` ### Acceptance Criteria - [ ] `rails new` scaffold boots locally with `rails server` on port 3000 - [ ] `/up` health check returns 200 - [ ] PostgreSQL database connects in development - [ ] `db:seed` creates the 3 service types - [ ] Dockerfile builds and runs the app - [ ] Woodpecker pipeline passes (lint, test, build) - [ ] Image pushes to Harbor at `landscaping-assistant/app` - [ ] ArgoCD syncs and pod is running in k3s - [ ] Tailscale funnel serves the app at `landscaping-assistant.tail5b443a.ts.net` ### Test Expectations - [ ] RSpec: default Rails health check test passes - [ ] RSpec: seed data creates 3 services - Run command: `bundle exec rspec` ### Constraints - Port 3000 everywhere (Dockerfile, kustomize, probes, funnel) - CI must use internal Harbor URL (`harbor-core.harbor.svc.cluster.local`) - Database on shared CNPG cluster (`pal-e-postgres-rw.postgres.svc.cluster.local`) - Security context: `runAsNonRoot`, `drop: ["ALL"]` (match pal-enterprises pattern) - Health probes on `/up` (Rails 8 built-in) ### Checklist - [ ] PR opened (this repo) - [ ] PR opened (pal-e-platform -- NetworkPolicy) - [ ] PR opened (pal-e-services -- var.services) - [ ] PR opened (pal-e-deployments -- kustomize overlay) - [ ] Tests pass - [ ] No unrelated changes ### Related - `project-landscaping-assistant` -- project page - `docs/infrastructure-and-pipeline.md` -- exact configs for all three repos
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ldraney/landscaping-assistant#1
No description provided.