k8s-bitbucket-pipeline
v0.5.32
Published
Pipeline runner scripts for Edular backend services on Bitbucket Pipelines.
Readme
k8s-bitbucket-pipeline
Pipeline runner scripts for Edular backend services on Bitbucket Pipelines.
Structure
bin/
├── deploy.js # build + push Docker image + kubectl apply (legacy)
├── pr.js # lint + unitTest + smokeTest + aiReview (PR pipeline)
├── staging.js # lint + unitTest + smokeTest + migrations + aiReview (develop/staging)
└── production.js # lint + unitTest + smokeTest + migrations (master/production)
lib/
├── shared/
│ ├── install-cmd.js # installCmd(useYarn, flags)
│ ├── script-cmd.js # scriptCmd(script, useYarn)
│ ├── run.js # run(cmd, label) — shell.exec wrapper
│ ├── use-yarn.js # useYarn boolean
│ └── package-scripts.js # hasPackageScript, isPlaceholderScript
└── steps/
├── lint.js # install + build + prettier + tsc
├── unit-test.js # edular-ci pr-check + yarn test
├── smoke-test.js # yarn test:smoke (if defined)
├── ai-review.js # docker run pr-agent
└── migrations.js # migrations:main:migrate + migrations:client:migrateUsage
# PR pipeline
npx pr deployment.json
# Staging (develop branch)
npx staging deployment.json
npx deploy deployment.json staging
# Production (master branch)
npx production deployment.json
npx deploy deployment.json productionStep Functions
Each lib/steps/*.js exports an async function. They are independently testable.
| Function | What it does |
|----------|--------------|
| lint() | install + build:production + prettier:list + tsc |
| unitTest() | edular-ci pr-check + yarn test |
| smokeTest() | yarn test:smoke (if defined) |
| aiReview() | docker run pr-agent |
| migrations(branch) | main + client migrations |
Tests
yarn test