skuba 0.0.0-master-20230318044948
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +67 -0
- package/config/eslint.js +3 -0
- package/config/jest.js +1 -0
- package/config/prettier.d.ts +3 -0
- package/config/prettier.js +5 -0
- package/config/tsconfig.json +9 -0
- package/jest/moduleNameMapper.js +58 -0
- package/jest/moduleNameMapper.test.ts +64 -0
- package/jest/transform.js +50 -0
- package/jest/transform.test.ts +11 -0
- package/jest/tsConfig.js +26 -0
- package/jest-preset.js +34 -0
- package/lib/api/buildkite/annotate.d.ts +26 -0
- package/lib/api/buildkite/annotate.js +49 -0
- package/lib/api/buildkite/annotate.js.map +7 -0
- package/lib/api/buildkite/index.d.ts +3 -0
- package/lib/api/buildkite/index.js +32 -0
- package/lib/api/buildkite/index.js.map +7 -0
- package/lib/api/buildkite/md.d.ts +6 -0
- package/lib/api/buildkite/md.js +33 -0
- package/lib/api/buildkite/md.js.map +7 -0
- package/lib/api/git/commit.d.ts +15 -0
- package/lib/api/git/commit.js +52 -0
- package/lib/api/git/commit.js.map +7 -0
- package/lib/api/git/commitAllChanges.d.ts +19 -0
- package/lib/api/git/commitAllChanges.js +65 -0
- package/lib/api/git/commitAllChanges.js.map +7 -0
- package/lib/api/git/currentBranch.d.ts +10 -0
- package/lib/api/git/currentBranch.js +58 -0
- package/lib/api/git/currentBranch.js.map +7 -0
- package/lib/api/git/getChangedFiles.d.ts +20 -0
- package/lib/api/git/getChangedFiles.js +63 -0
- package/lib/api/git/getChangedFiles.js.map +7 -0
- package/lib/api/git/index.d.ts +10 -0
- package/lib/api/git/index.js +55 -0
- package/lib/api/git/index.js.map +7 -0
- package/lib/api/git/log.d.ts +19 -0
- package/lib/api/git/log.js +71 -0
- package/lib/api/git/log.js.map +7 -0
- package/lib/api/git/pull.d.ts +35 -0
- package/lib/api/git/pull.js +69 -0
- package/lib/api/git/pull.js.map +7 -0
- package/lib/api/git/push.d.ts +43 -0
- package/lib/api/git/push.js +70 -0
- package/lib/api/git/push.js.map +7 -0
- package/lib/api/git/remote.d.ts +20 -0
- package/lib/api/git/remote.js +72 -0
- package/lib/api/git/remote.js.map +7 -0
- package/lib/api/git/reset.d.ts +12 -0
- package/lib/api/git/reset.js +62 -0
- package/lib/api/git/reset.js.map +7 -0
- package/lib/api/git/statusMatrix.d.ts +7 -0
- package/lib/api/git/statusMatrix.js +47 -0
- package/lib/api/git/statusMatrix.js.map +7 -0
- package/lib/api/github/checkRun.d.ts +44 -0
- package/lib/api/github/checkRun.js +81 -0
- package/lib/api/github/checkRun.js.map +7 -0
- package/lib/api/github/environment.d.ts +18 -0
- package/lib/api/github/environment.js +48 -0
- package/lib/api/github/environment.js.map +7 -0
- package/lib/api/github/index.d.ts +7 -0
- package/lib/api/github/index.js +48 -0
- package/lib/api/github/index.js.map +7 -0
- package/lib/api/github/issueComment.d.ts +59 -0
- package/lib/api/github/issueComment.js +83 -0
- package/lib/api/github/issueComment.js.map +7 -0
- package/lib/api/github/pullRequest.d.ts +21 -0
- package/lib/api/github/pullRequest.js +68 -0
- package/lib/api/github/pullRequest.js.map +7 -0
- package/lib/api/github/push.d.ts +79 -0
- package/lib/api/github/push.js +158 -0
- package/lib/api/github/push.js.map +7 -0
- package/lib/api/jest/index.d.ts +144 -0
- package/lib/api/jest/index.js +41 -0
- package/lib/api/jest/index.js.map +7 -0
- package/lib/api/net/compose.d.ts +4 -0
- package/lib/api/net/compose.js +50 -0
- package/lib/api/net/compose.js.map +7 -0
- package/lib/api/net/index.d.ts +1 -0
- package/lib/api/net/index.js +29 -0
- package/lib/api/net/index.js.map +7 -0
- package/lib/api/net/socket.d.ts +5 -0
- package/lib/api/net/socket.js +68 -0
- package/lib/api/net/socket.js.map +7 -0
- package/lib/api/net/waitFor.d.ts +22 -0
- package/lib/api/net/waitFor.js +40 -0
- package/lib/api/net/waitFor.js.map +7 -0
- package/lib/cli/adapter/eslint.d.ts +14 -0
- package/lib/cli/adapter/eslint.js +112 -0
- package/lib/cli/adapter/eslint.js.map +7 -0
- package/lib/cli/adapter/prettier.d.ts +45 -0
- package/lib/cli/adapter/prettier.js +171 -0
- package/lib/cli/adapter/prettier.js.map +7 -0
- package/lib/cli/build/args.d.ts +7 -0
- package/lib/cli/build/args.js +73 -0
- package/lib/cli/build/args.js.map +7 -0
- package/lib/cli/build/esbuild.d.ts +5 -0
- package/lib/cli/build/esbuild.js +133 -0
- package/lib/cli/build/esbuild.js.map +7 -0
- package/lib/cli/build/index.d.ts +1 -0
- package/lib/cli/build/index.js +73 -0
- package/lib/cli/build/index.js.map +7 -0
- package/lib/cli/build/tsc.d.ts +1 -0
- package/lib/cli/build/tsc.js +36 -0
- package/lib/cli/build/tsc.js.map +7 -0
- package/lib/cli/buildPackage.d.ts +1 -0
- package/lib/cli/buildPackage.js +56 -0
- package/lib/cli/buildPackage.js.map +7 -0
- package/lib/cli/configure/addEmptyExports.d.ts +6 -0
- package/lib/cli/configure/addEmptyExports.js +76 -0
- package/lib/cli/configure/addEmptyExports.js.map +7 -0
- package/lib/cli/configure/analyseConfiguration.d.ts +9 -0
- package/lib/cli/configure/analyseConfiguration.js +69 -0
- package/lib/cli/configure/analyseConfiguration.js.map +7 -0
- package/lib/cli/configure/analyseDependencies.d.ts +10 -0
- package/lib/cli/configure/analyseDependencies.js +136 -0
- package/lib/cli/configure/analyseDependencies.js.map +7 -0
- package/lib/cli/configure/analysis/diff.d.ts +1 -0
- package/lib/cli/configure/analysis/diff.js +45 -0
- package/lib/cli/configure/analysis/diff.js.map +7 -0
- package/lib/cli/configure/analysis/files.d.ts +1 -0
- package/lib/cli/configure/analysis/files.js +58 -0
- package/lib/cli/configure/analysis/files.js.map +7 -0
- package/lib/cli/configure/analysis/git.d.ts +1 -0
- package/lib/cli/configure/analysis/git.js +54 -0
- package/lib/cli/configure/analysis/git.js.map +7 -0
- package/lib/cli/configure/analysis/package.d.ts +13 -0
- package/lib/cli/configure/analysis/package.js +110 -0
- package/lib/cli/configure/analysis/package.js.map +7 -0
- package/lib/cli/configure/analysis/project.d.ts +3 -0
- package/lib/cli/configure/analysis/project.js +105 -0
- package/lib/cli/configure/analysis/project.js.map +7 -0
- package/lib/cli/configure/dependencies/index.d.ts +5 -0
- package/lib/cli/configure/dependencies/index.js +41 -0
- package/lib/cli/configure/dependencies/index.js.map +7 -0
- package/lib/cli/configure/dependencies/seekDatadogCustomMetrics.d.ts +2 -0
- package/lib/cli/configure/dependencies/seekDatadogCustomMetrics.js +59 -0
- package/lib/cli/configure/dependencies/seekDatadogCustomMetrics.js.map +7 -0
- package/lib/cli/configure/dependencies/seekKoala.d.ts +2 -0
- package/lib/cli/configure/dependencies/seekKoala.js +56 -0
- package/lib/cli/configure/dependencies/seekKoala.js.map +7 -0
- package/lib/cli/configure/dependencies/skuba.d.ts +2 -0
- package/lib/cli/configure/dependencies/skuba.js +52 -0
- package/lib/cli/configure/dependencies/skuba.js.map +7 -0
- package/lib/cli/configure/dependencies/skubaDeps.d.ts +2 -0
- package/lib/cli/configure/dependencies/skubaDeps.js +56 -0
- package/lib/cli/configure/dependencies/skubaDeps.js.map +7 -0
- package/lib/cli/configure/dependencies/skubaDive.d.ts +3 -0
- package/lib/cli/configure/dependencies/skubaDive.js +70 -0
- package/lib/cli/configure/dependencies/skubaDive.js.map +7 -0
- package/lib/cli/configure/ensureTemplateCompletion.d.ts +9 -0
- package/lib/cli/configure/ensureTemplateCompletion.js +77 -0
- package/lib/cli/configure/ensureTemplateCompletion.js.map +7 -0
- package/lib/cli/configure/getEntryPoint.d.ts +11 -0
- package/lib/cli/configure/getEntryPoint.js +70 -0
- package/lib/cli/configure/getEntryPoint.js.map +7 -0
- package/lib/cli/configure/getProjectType.d.ts +9 -0
- package/lib/cli/configure/getProjectType.js +52 -0
- package/lib/cli/configure/getProjectType.js.map +7 -0
- package/lib/cli/configure/index.d.ts +1 -0
- package/lib/cli/configure/index.js +148 -0
- package/lib/cli/configure/index.js.map +7 -0
- package/lib/cli/configure/modules/eslint.d.ts +2 -0
- package/lib/cli/configure/modules/eslint.js +61 -0
- package/lib/cli/configure/modules/eslint.js.map +7 -0
- package/lib/cli/configure/modules/ignore.d.ts +2 -0
- package/lib/cli/configure/modules/ignore.js +40 -0
- package/lib/cli/configure/modules/ignore.js.map +7 -0
- package/lib/cli/configure/modules/index.d.ts +2 -0
- package/lib/cli/configure/modules/index.js +54 -0
- package/lib/cli/configure/modules/index.js.map +7 -0
- package/lib/cli/configure/modules/jest.d.ts +2 -0
- package/lib/cli/configure/modules/jest.js +86 -0
- package/lib/cli/configure/modules/jest.js.map +7 -0
- package/lib/cli/configure/modules/nodemon.d.ts +2 -0
- package/lib/cli/configure/modules/nodemon.js +30 -0
- package/lib/cli/configure/modules/nodemon.js.map +7 -0
- package/lib/cli/configure/modules/package.d.ts +2 -0
- package/lib/cli/configure/modules/package.js +117 -0
- package/lib/cli/configure/modules/package.js.map +7 -0
- package/lib/cli/configure/modules/prettier.d.ts +2 -0
- package/lib/cli/configure/modules/prettier.js +52 -0
- package/lib/cli/configure/modules/prettier.js.map +7 -0
- package/lib/cli/configure/modules/renovate.d.ts +3 -0
- package/lib/cli/configure/modules/renovate.js +69 -0
- package/lib/cli/configure/modules/renovate.js.map +7 -0
- package/lib/cli/configure/modules/serverless.d.ts +2 -0
- package/lib/cli/configure/modules/serverless.js +36 -0
- package/lib/cli/configure/modules/serverless.js.map +7 -0
- package/lib/cli/configure/modules/skubaDive.d.ts +2 -0
- package/lib/cli/configure/modules/skubaDive.js +72 -0
- package/lib/cli/configure/modules/skubaDive.js.map +7 -0
- package/lib/cli/configure/modules/tsconfig.d.ts +2 -0
- package/lib/cli/configure/modules/tsconfig.js +87 -0
- package/lib/cli/configure/modules/tsconfig.js.map +7 -0
- package/lib/cli/configure/modules/tslint.d.ts +2 -0
- package/lib/cli/configure/modules/tslint.js +30 -0
- package/lib/cli/configure/modules/tslint.js.map +7 -0
- package/lib/cli/configure/patchRenovateConfig.d.ts +1 -0
- package/lib/cli/configure/patchRenovateConfig.js +132 -0
- package/lib/cli/configure/patchRenovateConfig.js.map +7 -0
- package/lib/cli/configure/processing/deleteFiles.d.ts +5 -0
- package/lib/cli/configure/processing/deleteFiles.js +31 -0
- package/lib/cli/configure/processing/deleteFiles.js.map +7 -0
- package/lib/cli/configure/processing/ignoreFile.d.ts +8 -0
- package/lib/cli/configure/processing/ignoreFile.js +74 -0
- package/lib/cli/configure/processing/ignoreFile.js.map +7 -0
- package/lib/cli/configure/processing/javascript.d.ts +2 -0
- package/lib/cli/configure/processing/javascript.js +38 -0
- package/lib/cli/configure/processing/javascript.js.map +7 -0
- package/lib/cli/configure/processing/json.d.ts +2 -0
- package/lib/cli/configure/processing/json.js +57 -0
- package/lib/cli/configure/processing/json.js.map +7 -0
- package/lib/cli/configure/processing/loadFiles.d.ts +5 -0
- package/lib/cli/configure/processing/loadFiles.js +31 -0
- package/lib/cli/configure/processing/loadFiles.js.map +7 -0
- package/lib/cli/configure/processing/module.d.ts +10 -0
- package/lib/cli/configure/processing/module.js +39 -0
- package/lib/cli/configure/processing/module.js.map +7 -0
- package/lib/cli/configure/processing/package.d.ts +73 -0
- package/lib/cli/configure/processing/package.js +87 -0
- package/lib/cli/configure/processing/package.js.map +7 -0
- package/lib/cli/configure/processing/prettier.d.ts +4 -0
- package/lib/cli/configure/processing/prettier.js +44 -0
- package/lib/cli/configure/processing/prettier.js.map +7 -0
- package/lib/cli/configure/processing/record.d.ts +11 -0
- package/lib/cli/configure/processing/record.js +65 -0
- package/lib/cli/configure/processing/record.js.map +7 -0
- package/lib/cli/configure/processing/typescript.d.ts +23 -0
- package/lib/cli/configure/processing/typescript.js +197 -0
- package/lib/cli/configure/processing/typescript.js.map +7 -0
- package/lib/cli/configure/refreshIgnoreFiles.d.ts +3 -0
- package/lib/cli/configure/refreshIgnoreFiles.js +78 -0
- package/lib/cli/configure/refreshIgnoreFiles.js.map +7 -0
- package/lib/cli/configure/types.d.ts +26 -0
- package/lib/cli/configure/types.js +17 -0
- package/lib/cli/configure/types.js.map +7 -0
- package/lib/cli/format.d.ts +1 -0
- package/lib/cli/format.js +70 -0
- package/lib/cli/format.js.map +7 -0
- package/lib/cli/help.d.ts +1 -0
- package/lib/cli/help.js +34 -0
- package/lib/cli/help.js.map +7 -0
- package/lib/cli/init/getConfig.d.ts +26 -0
- package/lib/cli/init/getConfig.js +285 -0
- package/lib/cli/init/getConfig.js.map +7 -0
- package/lib/cli/init/git.d.ts +7 -0
- package/lib/cli/init/git.js +82 -0
- package/lib/cli/init/git.js.map +7 -0
- package/lib/cli/init/index.d.ts +1 -0
- package/lib/cli/init/index.js +146 -0
- package/lib/cli/init/index.js.map +7 -0
- package/lib/cli/init/prompts.d.ts +45 -0
- package/lib/cli/init/prompts.js +97 -0
- package/lib/cli/init/prompts.js.map +7 -0
- package/lib/cli/init/types.d.ts +28 -0
- package/lib/cli/init/types.js +65 -0
- package/lib/cli/init/types.js.map +7 -0
- package/lib/cli/init/validation.d.ts +8 -0
- package/lib/cli/init/validation.js +43 -0
- package/lib/cli/init/validation.js.map +7 -0
- package/lib/cli/init/writePackageJson.d.ts +13 -0
- package/lib/cli/init/writePackageJson.js +58 -0
- package/lib/cli/init/writePackageJson.js.map +7 -0
- package/lib/cli/lint/annotate/buildkite/eslint.d.ts +2 -0
- package/lib/cli/lint/annotate/buildkite/eslint.js +40 -0
- package/lib/cli/lint/annotate/buildkite/eslint.js.map +7 -0
- package/lib/cli/lint/annotate/buildkite/index.d.ts +4 -0
- package/lib/cli/lint/annotate/buildkite/index.js +58 -0
- package/lib/cli/lint/annotate/buildkite/index.js.map +7 -0
- package/lib/cli/lint/annotate/buildkite/prettier.d.ts +2 -0
- package/lib/cli/lint/annotate/buildkite/prettier.js +47 -0
- package/lib/cli/lint/annotate/buildkite/prettier.js.map +7 -0
- package/lib/cli/lint/annotate/buildkite/tsc.d.ts +2 -0
- package/lib/cli/lint/annotate/buildkite/tsc.js +45 -0
- package/lib/cli/lint/annotate/buildkite/tsc.js.map +7 -0
- package/lib/cli/lint/annotate/github/eslint.d.ts +3 -0
- package/lib/cli/lint/annotate/github/eslint.js +45 -0
- package/lib/cli/lint/annotate/github/eslint.js.map +7 -0
- package/lib/cli/lint/annotate/github/index.d.ts +4 -0
- package/lib/cli/lint/annotate/github/index.js +63 -0
- package/lib/cli/lint/annotate/github/index.js.map +7 -0
- package/lib/cli/lint/annotate/github/prettier.d.ts +3 -0
- package/lib/cli/lint/annotate/github/prettier.js +39 -0
- package/lib/cli/lint/annotate/github/prettier.js.map +7 -0
- package/lib/cli/lint/annotate/github/tsc.d.ts +3 -0
- package/lib/cli/lint/annotate/github/tsc.js +63 -0
- package/lib/cli/lint/annotate/github/tsc.js.map +7 -0
- package/lib/cli/lint/annotate/index.d.ts +4 -0
- package/lib/cli/lint/annotate/index.js +36 -0
- package/lib/cli/lint/annotate/index.js.map +7 -0
- package/lib/cli/lint/autofix.d.ts +10 -0
- package/lib/cli/lint/autofix.js +189 -0
- package/lib/cli/lint/autofix.js.map +7 -0
- package/lib/cli/lint/eslint.d.ts +4 -0
- package/lib/cli/lint/eslint.js +55 -0
- package/lib/cli/lint/eslint.js.map +7 -0
- package/lib/cli/lint/external.d.ts +10 -0
- package/lib/cli/lint/external.js +120 -0
- package/lib/cli/lint/external.js.map +7 -0
- package/lib/cli/lint/index.d.ts +2 -0
- package/lib/cli/lint/index.js +49 -0
- package/lib/cli/lint/index.js.map +7 -0
- package/lib/cli/lint/internal.d.ts +1 -0
- package/lib/cli/lint/internal.js +64 -0
- package/lib/cli/lint/internal.js.map +7 -0
- package/lib/cli/lint/prettier.d.ts +4 -0
- package/lib/cli/lint/prettier.js +55 -0
- package/lib/cli/lint/prettier.js.map +7 -0
- package/lib/cli/lint/tsc.d.ts +2 -0
- package/lib/cli/lint/tsc.js +58 -0
- package/lib/cli/lint/tsc.js.map +7 -0
- package/lib/cli/lint/types.d.ts +34 -0
- package/lib/cli/lint/types.js +17 -0
- package/lib/cli/lint/types.js.map +7 -0
- package/lib/cli/node.d.ts +1 -0
- package/lib/cli/node.js +77 -0
- package/lib/cli/node.js.map +7 -0
- package/lib/cli/release.d.ts +1 -0
- package/lib/cli/release.js +32 -0
- package/lib/cli/release.js.map +7 -0
- package/lib/cli/start.d.ts +1 -0
- package/lib/cli/start.js +69 -0
- package/lib/cli/start.js.map +7 -0
- package/lib/cli/test/index.d.ts +1 -0
- package/lib/cli/test/index.js +37 -0
- package/lib/cli/test/index.js.map +7 -0
- package/lib/cli/test/reporters/github/annotations.d.ts +9 -0
- package/lib/cli/test/reporters/github/annotations.js +102 -0
- package/lib/cli/test/reporters/github/annotations.js.map +7 -0
- package/lib/cli/test/reporters/github/index.d.ts +5 -0
- package/lib/cli/test/reporters/github/index.js +77 -0
- package/lib/cli/test/reporters/github/index.js.map +7 -0
- package/lib/cli/version.d.ts +1 -0
- package/lib/cli/version.js +34 -0
- package/lib/cli/version.js.map +7 -0
- package/lib/enquirer.d.js +2 -0
- package/lib/enquirer.d.js.map +7 -0
- package/lib/index.d.ts +22 -0
- package/lib/index.js +51 -0
- package/lib/index.js.map +7 -0
- package/lib/skuba.d.ts +11 -0
- package/lib/skuba.js +55 -0
- package/lib/skuba.js.map +7 -0
- package/lib/utils/args.d.ts +43 -0
- package/lib/utils/args.js +114 -0
- package/lib/utils/args.js.map +7 -0
- package/lib/utils/command.d.ts +6 -0
- package/lib/utils/command.js +72 -0
- package/lib/utils/command.js.map +7 -0
- package/lib/utils/copy.d.ts +16 -0
- package/lib/utils/copy.js +100 -0
- package/lib/utils/copy.js.map +7 -0
- package/lib/utils/dir.d.ts +21 -0
- package/lib/utils/dir.js +91 -0
- package/lib/utils/dir.js.map +7 -0
- package/lib/utils/env.d.ts +5 -0
- package/lib/utils/env.js +29 -0
- package/lib/utils/env.js.map +7 -0
- package/lib/utils/error.d.ts +28 -0
- package/lib/utils/error.js +72 -0
- package/lib/utils/error.js.map +7 -0
- package/lib/utils/exec.d.ts +40 -0
- package/lib/utils/exec.js +166 -0
- package/lib/utils/exec.js.map +7 -0
- package/lib/utils/help.d.ts +1 -0
- package/lib/utils/help.js +34 -0
- package/lib/utils/help.js.map +7 -0
- package/lib/utils/logging.d.ts +27 -0
- package/lib/utils/logging.js +60 -0
- package/lib/utils/logging.js.map +7 -0
- package/lib/utils/logo.d.ts +9 -0
- package/lib/utils/logo.js +74 -0
- package/lib/utils/logo.js.map +7 -0
- package/lib/utils/manifest.d.ts +10 -0
- package/lib/utils/manifest.js +77 -0
- package/lib/utils/manifest.js.map +7 -0
- package/lib/utils/port.d.ts +2 -0
- package/lib/utils/port.js +48 -0
- package/lib/utils/port.js.map +7 -0
- package/lib/utils/template.d.ts +37 -0
- package/lib/utils/template.js +116 -0
- package/lib/utils/template.js.map +7 -0
- package/lib/utils/validation.d.ts +6 -0
- package/lib/utils/validation.js +44 -0
- package/lib/utils/validation.js.map +7 -0
- package/lib/utils/version.d.ts +13 -0
- package/lib/utils/version.js +89 -0
- package/lib/utils/version.js.map +7 -0
- package/lib/utils/wait.d.ts +17 -0
- package/lib/utils/wait.js +59 -0
- package/lib/utils/wait.js.map +7 -0
- package/lib/utils/worker.d.ts +20 -0
- package/lib/utils/worker.js +63 -0
- package/lib/utils/worker.js.map +7 -0
- package/lib/wrapper/function-arguments.d.js +2 -0
- package/lib/wrapper/function-arguments.d.js.map +7 -0
- package/lib/wrapper/functionHandler.d.ts +10 -0
- package/lib/wrapper/functionHandler.js +63 -0
- package/lib/wrapper/functionHandler.js.map +7 -0
- package/lib/wrapper/http.d.ts +20 -0
- package/lib/wrapper/http.js +79 -0
- package/lib/wrapper/http.js.map +7 -0
- package/lib/wrapper/index.d.ts +12 -0
- package/lib/wrapper/index.js +16 -0
- package/lib/wrapper/index.js.map +7 -0
- package/lib/wrapper/main.d.ts +1 -0
- package/lib/wrapper/main.js +47 -0
- package/lib/wrapper/main.js.map +7 -0
- package/lib/wrapper/requestListener.d.ts +11 -0
- package/lib/wrapper/requestListener.js +66 -0
- package/lib/wrapper/requestListener.js.map +7 -0
- package/package.json +167 -0
- package/template/base/.github/CODEOWNERS +5 -0
- package/template/base/.github/renovate.json5 +3 -0
- package/template/base/_.dockerignore +18 -0
- package/template/base/_.eslintignore +14 -0
- package/template/base/_.eslintrc.js +3 -0
- package/template/base/_.gitignore +23 -0
- package/template/base/_.prettierignore +20 -0
- package/template/base/_.prettierrc.js +1 -0
- package/template/base/jest.config.ts +15 -0
- package/template/base/jest.setup.ts +3 -0
- package/template/base/tsconfig.build.json +5 -0
- package/template/base/tsconfig.json +13 -0
- package/template/express-rest-api/.buildkite/pipeline.yml +103 -0
- package/template/express-rest-api/.env +1 -0
- package/template/express-rest-api/.gantry/common.yml +20 -0
- package/template/express-rest-api/.gantry/dev.yml +8 -0
- package/template/express-rest-api/.gantry/prod.yml +8 -0
- package/template/express-rest-api/.nvmrc +1 -0
- package/template/express-rest-api/Dockerfile +37 -0
- package/template/express-rest-api/Dockerfile.dev-deps +11 -0
- package/template/express-rest-api/README.md +106 -0
- package/template/express-rest-api/docker-compose.yml +22 -0
- package/template/express-rest-api/gantry.apply.yml +122 -0
- package/template/express-rest-api/gantry.build.yml +15 -0
- package/template/express-rest-api/package.json +30 -0
- package/template/express-rest-api/skuba.template.js +49 -0
- package/template/express-rest-api/src/api/healthCheck.ts +11 -0
- package/template/express-rest-api/src/api/smokeTest.ts +8 -0
- package/template/express-rest-api/src/app.test.ts +9 -0
- package/template/express-rest-api/src/app.ts +14 -0
- package/template/express-rest-api/src/config.ts +57 -0
- package/template/express-rest-api/src/framework/logging.ts +17 -0
- package/template/express-rest-api/src/listen.ts +23 -0
- package/template/express-rest-api/src/register.ts +1 -0
- package/template/greeter/.buildkite/pipeline.yml +37 -0
- package/template/greeter/.nvmrc +1 -0
- package/template/greeter/Dockerfile +11 -0
- package/template/greeter/README.md +96 -0
- package/template/greeter/docker-compose.yml +22 -0
- package/template/greeter/package.json +24 -0
- package/template/greeter/skuba.template.js +16 -0
- package/template/greeter/src/app.test.ts +5 -0
- package/template/greeter/src/app.ts +4 -0
- package/template/koa-rest-api/.buildkite/pipeline.yml +103 -0
- package/template/koa-rest-api/.env +1 -0
- package/template/koa-rest-api/.gantry/common.yml +20 -0
- package/template/koa-rest-api/.gantry/dev.yml +11 -0
- package/template/koa-rest-api/.gantry/prod.yml +11 -0
- package/template/koa-rest-api/.nvmrc +1 -0
- package/template/koa-rest-api/Dockerfile +37 -0
- package/template/koa-rest-api/Dockerfile.dev-deps +11 -0
- package/template/koa-rest-api/README.md +111 -0
- package/template/koa-rest-api/docker-compose.yml +22 -0
- package/template/koa-rest-api/gantry.apply.yml +129 -0
- package/template/koa-rest-api/gantry.build.yml +15 -0
- package/template/koa-rest-api/package.json +47 -0
- package/template/koa-rest-api/skuba.template.js +49 -0
- package/template/koa-rest-api/src/api/healthCheck.ts +13 -0
- package/template/koa-rest-api/src/api/index.ts +10 -0
- package/template/koa-rest-api/src/api/jobs/getJobs.test.ts +9 -0
- package/template/koa-rest-api/src/api/jobs/getJobs.ts +15 -0
- package/template/koa-rest-api/src/api/jobs/index.ts +10 -0
- package/template/koa-rest-api/src/api/jobs/postJob.test.ts +34 -0
- package/template/koa-rest-api/src/api/jobs/postJob.ts +19 -0
- package/template/koa-rest-api/src/api/smokeTest.ts +11 -0
- package/template/koa-rest-api/src/app.test.ts +21 -0
- package/template/koa-rest-api/src/app.ts +8 -0
- package/template/koa-rest-api/src/config.ts +57 -0
- package/template/koa-rest-api/src/framework/logging.ts +25 -0
- package/template/koa-rest-api/src/framework/metrics.ts +11 -0
- package/template/koa-rest-api/src/framework/middleware.ts +3 -0
- package/template/koa-rest-api/src/framework/server.test.ts +260 -0
- package/template/koa-rest-api/src/framework/server.ts +51 -0
- package/template/koa-rest-api/src/framework/validation.test.ts +72 -0
- package/template/koa-rest-api/src/framework/validation.ts +77 -0
- package/template/koa-rest-api/src/listen.ts +24 -0
- package/template/koa-rest-api/src/register.ts +1 -0
- package/template/koa-rest-api/src/storage/jobs.ts +28 -0
- package/template/koa-rest-api/src/testing/logging.ts +16 -0
- package/template/koa-rest-api/src/testing/metrics.ts +29 -0
- package/template/koa-rest-api/src/testing/server.ts +31 -0
- package/template/koa-rest-api/src/testing/types.ts +24 -0
- package/template/koa-rest-api/src/tracing.ts +61 -0
- package/template/koa-rest-api/src/types/jobs.ts +17 -0
- package/template/koa-rest-api/src/types/koa.ts +8 -0
- package/template/lambda-sqs-worker/.buildkite/pipeline.yml +96 -0
- package/template/lambda-sqs-worker/.env +1 -0
- package/template/lambda-sqs-worker/.nvmrc +1 -0
- package/template/lambda-sqs-worker/Dockerfile +12 -0
- package/template/lambda-sqs-worker/README.md +132 -0
- package/template/lambda-sqs-worker/docker-compose.yml +27 -0
- package/template/lambda-sqs-worker/package.json +44 -0
- package/template/lambda-sqs-worker/serverless.yml +202 -0
- package/template/lambda-sqs-worker/skuba.template.js +32 -0
- package/template/lambda-sqs-worker/src/app.test.ts +116 -0
- package/template/lambda-sqs-worker/src/app.ts +52 -0
- package/template/lambda-sqs-worker/src/config.ts +57 -0
- package/template/lambda-sqs-worker/src/framework/handler.test.ts +61 -0
- package/template/lambda-sqs-worker/src/framework/handler.ts +43 -0
- package/template/lambda-sqs-worker/src/framework/logging.ts +27 -0
- package/template/lambda-sqs-worker/src/framework/metrics.ts +14 -0
- package/template/lambda-sqs-worker/src/framework/validation.test.ts +84 -0
- package/template/lambda-sqs-worker/src/framework/validation.ts +10 -0
- package/template/lambda-sqs-worker/src/hooks.ts +96 -0
- package/template/lambda-sqs-worker/src/mapping/jobScorer.ts +19 -0
- package/template/lambda-sqs-worker/src/services/aws.ts +5 -0
- package/template/lambda-sqs-worker/src/services/jobScorer.test.ts +44 -0
- package/template/lambda-sqs-worker/src/services/jobScorer.ts +56 -0
- package/template/lambda-sqs-worker/src/services/pipelineEventSender.test.ts +40 -0
- package/template/lambda-sqs-worker/src/services/pipelineEventSender.ts +33 -0
- package/template/lambda-sqs-worker/src/testing/handler.ts +13 -0
- package/template/lambda-sqs-worker/src/testing/logging.ts +16 -0
- package/template/lambda-sqs-worker/src/testing/services.ts +28 -0
- package/template/lambda-sqs-worker/src/testing/types.ts +33 -0
- package/template/lambda-sqs-worker/src/types/jobScorer.ts +15 -0
- package/template/lambda-sqs-worker/src/types/pipelineEvents.ts +21 -0
- package/template/lambda-sqs-worker/tsconfig.json +13 -0
- package/template/lambda-sqs-worker-cdk/.buildkite/pipeline.yml +93 -0
- package/template/lambda-sqs-worker-cdk/.nvmrc +1 -0
- package/template/lambda-sqs-worker-cdk/Dockerfile +13 -0
- package/template/lambda-sqs-worker-cdk/cdk.json +25 -0
- package/template/lambda-sqs-worker-cdk/docker-compose.yml +28 -0
- package/template/lambda-sqs-worker-cdk/infra/__snapshots__/appStack.test.ts.snap +723 -0
- package/template/lambda-sqs-worker-cdk/infra/appStack.test.ts +34 -0
- package/template/lambda-sqs-worker-cdk/infra/appStack.ts +74 -0
- package/template/lambda-sqs-worker-cdk/infra/index.ts +14 -0
- package/template/lambda-sqs-worker-cdk/package.json +30 -0
- package/template/lambda-sqs-worker-cdk/shared/context-types.ts +21 -0
- package/template/lambda-sqs-worker-cdk/skuba.template.js +27 -0
- package/template/lambda-sqs-worker-cdk/src/app.ts +10 -0
- package/template/lambda-sqs-worker-cdk/tsconfig.json +13 -0
- package/template/oss-npm-package/.github/workflows/release.yml +35 -0
- package/template/oss-npm-package/.github/workflows/validate.yml +31 -0
- package/template/oss-npm-package/.nvmrc +1 -0
- package/template/oss-npm-package/LICENSE +21 -0
- package/template/oss-npm-package/README.md +128 -0
- package/template/oss-npm-package/_package.json +41 -0
- package/template/oss-npm-package/skuba.template.js +22 -0
- package/template/oss-npm-package/src/index.test.ts +5 -0
- package/template/oss-npm-package/src/index.ts +7 -0
- package/template/oss-npm-package/tsconfig.json +10 -0
- package/template/private-npm-package/.buildkite/pipeline.yml +5 -0
- package/template/private-npm-package/.nvmrc +1 -0
- package/template/private-npm-package/README.md +109 -0
- package/template/private-npm-package/_package.json +41 -0
- package/template/private-npm-package/skuba.template.js +24 -0
- package/template/private-npm-package/src/index.test.ts +5 -0
- package/template/private-npm-package/src/index.ts +7 -0
- package/template/private-npm-package/tsconfig.json +10 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import './register';
|
|
2
|
+
|
|
3
|
+
import app from './app';
|
|
4
|
+
import { config } from './config';
|
|
5
|
+
import { rootLogger } from './framework/logging';
|
|
6
|
+
|
|
7
|
+
// If your application is deployed with more than 1 vCPU you can delete this
|
|
8
|
+
// file and use a clustering utility to run `lib/app`.
|
|
9
|
+
|
|
10
|
+
const listener = app.listen(config.port, () => {
|
|
11
|
+
const address = listener.address();
|
|
12
|
+
|
|
13
|
+
if (typeof address === 'object' && address) {
|
|
14
|
+
rootLogger.debug(`listening on port ${address.port}`);
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
// Gantry ALB default idle timeout is 30 seconds
|
|
19
|
+
// https://nodejs.org/docs/latest-v18.x/api/http.html#serverkeepalivetimeout
|
|
20
|
+
// Node default is 5 seconds
|
|
21
|
+
// https://docs.aws.amazon.com/elasticloadbalancing/latest/application/application-load-balancers.html#connection-idle-timeout
|
|
22
|
+
// AWS recommends setting an application timeout larger than the load balancer
|
|
23
|
+
listener.keepAliveTimeout = 31000;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import 'skuba-dive/register';
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
agents:
|
|
2
|
+
queue: <%- prodBuildkiteQueueName %>
|
|
3
|
+
|
|
4
|
+
configs:
|
|
5
|
+
plugins:
|
|
6
|
+
- &aws-sm
|
|
7
|
+
seek-oss/aws-sm#v2.3.1:
|
|
8
|
+
env:
|
|
9
|
+
NPM_READ_TOKEN: arn:aws:secretsmanager:ap-southeast-2:987872074697:secret:npm/npm-read-token
|
|
10
|
+
|
|
11
|
+
- &docker-ecr-cache
|
|
12
|
+
seek-oss/docker-ecr-cache#v2.0.0:
|
|
13
|
+
cache-on:
|
|
14
|
+
- package.json
|
|
15
|
+
- yarn.lock
|
|
16
|
+
secrets: id=npm,src=.npmrc
|
|
17
|
+
|
|
18
|
+
- &private-npm
|
|
19
|
+
seek-oss/private-npm#v1.2.0:
|
|
20
|
+
env: NPM_READ_TOKEN
|
|
21
|
+
|
|
22
|
+
steps:
|
|
23
|
+
- label: 🧪 Test & Lint
|
|
24
|
+
commands:
|
|
25
|
+
- echo '+++ yarn test:ci'
|
|
26
|
+
- yarn test:ci
|
|
27
|
+
- echo '--- yarn lint'
|
|
28
|
+
- yarn lint
|
|
29
|
+
env:
|
|
30
|
+
GET_GITHUB_TOKEN: please
|
|
31
|
+
plugins:
|
|
32
|
+
- *aws-sm
|
|
33
|
+
- *private-npm
|
|
34
|
+
- *docker-ecr-cache
|
|
35
|
+
- docker-compose#v4.11.0:
|
|
36
|
+
run: app
|
|
37
|
+
timeout_in_minutes: 10
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
18
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# syntax=docker/dockerfile:1.2
|
|
2
|
+
|
|
3
|
+
FROM --platform=${BUILDPLATFORM:-<%- platformName %>} node:18-alpine AS dev-deps
|
|
4
|
+
|
|
5
|
+
WORKDIR /workdir
|
|
6
|
+
|
|
7
|
+
COPY package.json yarn.lock ./
|
|
8
|
+
|
|
9
|
+
RUN \
|
|
10
|
+
--mount=type=secret,id=npm,dst=/workdir/.npmrc \
|
|
11
|
+
yarn install --frozen-lockfile --ignore-optional --non-interactive
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# <%- repoName %>
|
|
2
|
+
|
|
3
|
+
[](https://github.com/seek-oss/skuba)
|
|
4
|
+
|
|
5
|
+
Next steps:
|
|
6
|
+
|
|
7
|
+
1. [ ] Finish templating if this was skipped earlier:
|
|
8
|
+
|
|
9
|
+
```shell
|
|
10
|
+
yarn skuba configure
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
2. [ ] Create a new repository in the appropriate GitHub organisation.
|
|
14
|
+
3. [ ] Add the repository to BuildAgency;
|
|
15
|
+
see [Builds at SEEK] for more information.
|
|
16
|
+
4. [ ] Push local commits to the upstream GitHub branch.
|
|
17
|
+
5. [ ] Configure [GitHub repository settings].
|
|
18
|
+
6. [ ] Delete this checklist 😌.
|
|
19
|
+
|
|
20
|
+
[builds at seek]: https://builds-at-seek.ssod.skinfra.xyz
|
|
21
|
+
[github repository settings]: https://github.com/<%-orgName%>/<%-repoName%>/settings
|
|
22
|
+
|
|
23
|
+
## Design
|
|
24
|
+
|
|
25
|
+
The `greeter` template is the prototypical _hello world_ project.
|
|
26
|
+
It can function as a playground for the TypeScript tooling prescribed by our [technology strategy],
|
|
27
|
+
or serve as a starting point for a backend project if the other built-in templates are not a good fit.
|
|
28
|
+
|
|
29
|
+
It's a barebones Node.js application that comprises:
|
|
30
|
+
|
|
31
|
+
- A [src/app.ts](src/app.ts) that can be run locally to greet the user
|
|
32
|
+
- A [src/app.test.ts](src/app.test.ts) that demonstrates rudimentary Jest usage
|
|
33
|
+
|
|
34
|
+
## Development
|
|
35
|
+
|
|
36
|
+
### Test
|
|
37
|
+
|
|
38
|
+
```shell
|
|
39
|
+
yarn test
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### Lint
|
|
43
|
+
|
|
44
|
+
```shell
|
|
45
|
+
# Fix issues
|
|
46
|
+
yarn format
|
|
47
|
+
|
|
48
|
+
# Check for issues
|
|
49
|
+
yarn lint
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Start
|
|
53
|
+
|
|
54
|
+
```shell
|
|
55
|
+
# Start a live-reloading process
|
|
56
|
+
yarn start
|
|
57
|
+
|
|
58
|
+
# Start with Node.js Inspector enabled
|
|
59
|
+
yarn start:debug
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
This runs a live-reloading Node.js process pointing to the [src/app.ts](src/app.ts) entrypoint.
|
|
63
|
+
|
|
64
|
+
## Deploy
|
|
65
|
+
|
|
66
|
+
The `greeter` template includes a simple [Buildkite pipeline](.buildkite/pipeline.yml) for testing and linting.
|
|
67
|
+
It does not assume a deployment method or environment.
|
|
68
|
+
|
|
69
|
+
For inspiration in this space, check out:
|
|
70
|
+
|
|
71
|
+
- The `koa-rest-api` template for containerised deployments
|
|
72
|
+
- The `lambda-sqs-worker` template for Lambda deployments
|
|
73
|
+
|
|
74
|
+
## Support
|
|
75
|
+
|
|
76
|
+
### Dev
|
|
77
|
+
|
|
78
|
+
TODO: add support links for the dev environment.
|
|
79
|
+
|
|
80
|
+
<!--
|
|
81
|
+
- CloudWatch dashboard
|
|
82
|
+
- Datadog dashboard
|
|
83
|
+
- Splunk logs
|
|
84
|
+
-->
|
|
85
|
+
|
|
86
|
+
### Prod
|
|
87
|
+
|
|
88
|
+
TODO: add support links for the prod environment.
|
|
89
|
+
|
|
90
|
+
<!--
|
|
91
|
+
- CloudWatch dashboard
|
|
92
|
+
- Datadog dashboard
|
|
93
|
+
- Splunk logs
|
|
94
|
+
-->
|
|
95
|
+
|
|
96
|
+
[technology strategy]: https://tech-strategy.ssod.skinfra.xyz
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
version: '3.7'
|
|
2
|
+
|
|
3
|
+
services:
|
|
4
|
+
app:
|
|
5
|
+
environment:
|
|
6
|
+
# Enable Buildkite + GitHub integrations.
|
|
7
|
+
- BUILDKITE
|
|
8
|
+
- BUILDKITE_AGENT_ACCESS_TOKEN
|
|
9
|
+
- BUILDKITE_BRANCH
|
|
10
|
+
- BUILDKITE_BUILD_NUMBER
|
|
11
|
+
- BUILDKITE_JOB_ID
|
|
12
|
+
- BUILDKITE_PIPELINE_DEFAULT_BRANCH
|
|
13
|
+
- BUILDKITE_STEP_ID
|
|
14
|
+
- GITHUB_API_TOKEN
|
|
15
|
+
image: ${BUILDKITE_PLUGIN_DOCKER_IMAGE:-''}
|
|
16
|
+
init: true
|
|
17
|
+
volumes:
|
|
18
|
+
- ./:/workdir
|
|
19
|
+
# Mount agent for Buildkite annotations.
|
|
20
|
+
- /usr/bin/buildkite-agent:/usr/bin/buildkite-agent
|
|
21
|
+
# Mount cached dependencies.
|
|
22
|
+
- /workdir/node_modules
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"private": true,
|
|
3
|
+
"license": "UNLICENSED",
|
|
4
|
+
"scripts": {
|
|
5
|
+
"build": "skuba build",
|
|
6
|
+
"format": "skuba format",
|
|
7
|
+
"lint": "skuba lint",
|
|
8
|
+
"start": "skuba start",
|
|
9
|
+
"start:debug": "yarn start --inspect-brk",
|
|
10
|
+
"test": "skuba test",
|
|
11
|
+
"test:ci": "skuba test --coverage",
|
|
12
|
+
"test:watch": "skuba test --watch"
|
|
13
|
+
},
|
|
14
|
+
"dependencies": {
|
|
15
|
+
"skuba-dive": "^2.0.0"
|
|
16
|
+
},
|
|
17
|
+
"devDependencies": {
|
|
18
|
+
"@types/node": "^18.11.5",
|
|
19
|
+
"skuba": "*"
|
|
20
|
+
},
|
|
21
|
+
"engines": {
|
|
22
|
+
"node": ">=18"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Run `skuba configure` to finish templating and remove this file.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
module.exports = {
|
|
6
|
+
entryPoint: 'src/app.ts',
|
|
7
|
+
fields: [
|
|
8
|
+
{
|
|
9
|
+
name: 'prodBuildkiteQueueName',
|
|
10
|
+
message: 'Prod Buildkite queue',
|
|
11
|
+
initial: 'my-team-aws-account-prod:cicd',
|
|
12
|
+
validate: (value) => /^.+:.+$/.test(value),
|
|
13
|
+
},
|
|
14
|
+
],
|
|
15
|
+
type: 'application',
|
|
16
|
+
};
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
agents:
|
|
2
|
+
queue: <%- prodBuildkiteQueueName %>
|
|
3
|
+
|
|
4
|
+
configs:
|
|
5
|
+
plugins:
|
|
6
|
+
- &aws-sm
|
|
7
|
+
seek-oss/aws-sm#v2.3.1:
|
|
8
|
+
env:
|
|
9
|
+
NPM_READ_TOKEN: arn:aws:secretsmanager:ap-southeast-2:987872074697:secret:npm/npm-read-token
|
|
10
|
+
|
|
11
|
+
- &docker-ecr-cache
|
|
12
|
+
seek-oss/docker-ecr-cache#v2.0.0:
|
|
13
|
+
cache-on:
|
|
14
|
+
- package.json
|
|
15
|
+
- yarn.lock
|
|
16
|
+
dockerfile: Dockerfile.dev-deps
|
|
17
|
+
secrets: id=npm,src=.npmrc
|
|
18
|
+
|
|
19
|
+
- &private-npm
|
|
20
|
+
seek-oss/private-npm#v1.2.0:
|
|
21
|
+
env: NPM_READ_TOKEN
|
|
22
|
+
|
|
23
|
+
base-steps:
|
|
24
|
+
- &deploy
|
|
25
|
+
concurrency: 1
|
|
26
|
+
retry:
|
|
27
|
+
manual:
|
|
28
|
+
# Only use this if you need to roll back a deployment ASAP.
|
|
29
|
+
# Always follow up with a proper revert or fix in Git history.
|
|
30
|
+
permit_on_passed: true
|
|
31
|
+
|
|
32
|
+
steps:
|
|
33
|
+
- label: 🧖♀️ Warm Prod
|
|
34
|
+
command: ':'
|
|
35
|
+
key: warm-prod
|
|
36
|
+
plugins:
|
|
37
|
+
- *aws-sm
|
|
38
|
+
- *private-npm
|
|
39
|
+
- *docker-ecr-cache
|
|
40
|
+
|
|
41
|
+
- label: 🧪 Test & Lint
|
|
42
|
+
commands:
|
|
43
|
+
- echo '+++ yarn test:ci'
|
|
44
|
+
- yarn test:ci
|
|
45
|
+
- echo '--- yarn lint'
|
|
46
|
+
- yarn lint
|
|
47
|
+
depends_on: warm-prod
|
|
48
|
+
env:
|
|
49
|
+
GET_GITHUB_TOKEN: please
|
|
50
|
+
plugins:
|
|
51
|
+
- *aws-sm
|
|
52
|
+
- *private-npm
|
|
53
|
+
- *docker-ecr-cache
|
|
54
|
+
- docker-compose#v4.11.0:
|
|
55
|
+
run: app
|
|
56
|
+
timeout_in_minutes: 10
|
|
57
|
+
|
|
58
|
+
- label: 📦 Build & Package
|
|
59
|
+
depends_on: warm-prod
|
|
60
|
+
plugins:
|
|
61
|
+
- *aws-sm
|
|
62
|
+
- *private-npm
|
|
63
|
+
- *docker-ecr-cache
|
|
64
|
+
- seek-jobs/gantry#v2.0.0:
|
|
65
|
+
command: build
|
|
66
|
+
file: gantry.build.yml
|
|
67
|
+
region: <%- region %>
|
|
68
|
+
values: .gantry/common.yml
|
|
69
|
+
|
|
70
|
+
- wait
|
|
71
|
+
- block: 🙋🏻♀️ Deploy Dev
|
|
72
|
+
branches: '!${BUILDKITE_PIPELINE_DEFAULT_BRANCH}'
|
|
73
|
+
|
|
74
|
+
- <<: *deploy
|
|
75
|
+
agents:
|
|
76
|
+
queue: <%- devBuildkiteQueueName %>
|
|
77
|
+
label: 🤞 Deploy Dev
|
|
78
|
+
concurrency_group: <%- teamName %>/deploy/gantry/<%- devGantryEnvironmentName %>
|
|
79
|
+
key: deploy-dev
|
|
80
|
+
plugins:
|
|
81
|
+
- seek-jobs/gantry#v2.0.0:
|
|
82
|
+
command: apply
|
|
83
|
+
environment: <%- devGantryEnvironmentName %>
|
|
84
|
+
file: gantry.apply.yml
|
|
85
|
+
region: <%- region %>
|
|
86
|
+
values:
|
|
87
|
+
- .gantry/common.yml
|
|
88
|
+
- .gantry/dev.yml
|
|
89
|
+
|
|
90
|
+
- <<: *deploy
|
|
91
|
+
label: 🚀 Deploy Prod
|
|
92
|
+
branches: ${BUILDKITE_PIPELINE_DEFAULT_BRANCH}
|
|
93
|
+
concurrency_group: <%- teamName %>/deploy/gantry/<%- prodGantryEnvironmentName %>
|
|
94
|
+
depends_on: deploy-dev
|
|
95
|
+
plugins:
|
|
96
|
+
- seek-jobs/gantry#v2.0.0:
|
|
97
|
+
command: apply
|
|
98
|
+
environment: <%- prodGantryEnvironmentName %>
|
|
99
|
+
file: gantry.apply.yml
|
|
100
|
+
region: <%- region %>
|
|
101
|
+
values:
|
|
102
|
+
- .gantry/common.yml
|
|
103
|
+
- .gantry/prod.yml
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
ENVIRONMENT=local
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
prodAccountId: '<%- prodAwsAccountId %>'
|
|
2
|
+
|
|
3
|
+
image: '{{values "prodAccountId"}}.dkr.ecr.<%- region %>.amazonaws.com/{{values "service"}}:{{.BuildID}}'
|
|
4
|
+
service: '<%- serviceName %>'
|
|
5
|
+
|
|
6
|
+
# TODO: enable Datadog agent
|
|
7
|
+
# https://backstage.myseek.xyz/docs/default/component/gantry/v1/reference/resources/service/#datadogSecretId
|
|
8
|
+
# datadogSecretId: arn:aws:secretsmanager:<%- region %>:<aws-account-id>:secret:<secret-name>
|
|
9
|
+
|
|
10
|
+
tags:
|
|
11
|
+
# TODO: add data classification tags
|
|
12
|
+
# https://rfc.skinfra.xyz/RFC019-AWS-Tagging-Standard.html#seekdataconsumers
|
|
13
|
+
# seek:data:consumers: internal
|
|
14
|
+
# https://rfc.skinfra.xyz/RFC019-AWS-Tagging-Standard.html#seekdatatypes
|
|
15
|
+
# seek:data:types:restricted: job-ads
|
|
16
|
+
seek:env:label: '{{values "environment"}}'
|
|
17
|
+
seek:env:production: '{{values "isProduction"}}'
|
|
18
|
+
seek:owner:team: '<%- teamName %>'
|
|
19
|
+
seek:source:sha: '{{.CommitSHA}}'
|
|
20
|
+
seek:source:url: 'https://github.com/SEEK-Jobs/<%- repoName %>'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
18
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
ARG BASE_IMAGE
|
|
2
|
+
ARG BASE_TAG
|
|
3
|
+
|
|
4
|
+
###
|
|
5
|
+
|
|
6
|
+
FROM ${BASE_IMAGE}:${BASE_TAG} AS deps
|
|
7
|
+
|
|
8
|
+
RUN yarn install --ignore-optional --ignore-scripts --non-interactive --offline --production
|
|
9
|
+
|
|
10
|
+
###
|
|
11
|
+
|
|
12
|
+
FROM ${BASE_IMAGE}:${BASE_TAG} AS build
|
|
13
|
+
|
|
14
|
+
COPY . .
|
|
15
|
+
|
|
16
|
+
RUN yarn build
|
|
17
|
+
|
|
18
|
+
###
|
|
19
|
+
|
|
20
|
+
FROM --platform=${BUILDPLATFORM:-<%- platformName %>} gcr.io/distroless/nodejs:18 AS runtime
|
|
21
|
+
|
|
22
|
+
WORKDIR /workdir
|
|
23
|
+
|
|
24
|
+
COPY --from=build /workdir/lib lib
|
|
25
|
+
|
|
26
|
+
COPY --from=deps /workdir/node_modules node_modules
|
|
27
|
+
|
|
28
|
+
ENV NODE_ENV=production
|
|
29
|
+
|
|
30
|
+
# https://nodejs.org/api/cli.html#cli_node_options_options
|
|
31
|
+
ENV NODE_OPTIONS=--enable-source-maps
|
|
32
|
+
|
|
33
|
+
ARG PORT=8001
|
|
34
|
+
ENV PORT=${PORT}
|
|
35
|
+
EXPOSE ${PORT}
|
|
36
|
+
|
|
37
|
+
CMD ["--require", "./lib/tracing.js", "./lib/listen.js"]
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# syntax=docker/dockerfile:1.2
|
|
2
|
+
|
|
3
|
+
FROM --platform=${BUILDPLATFORM:-<%- platformName %>} node:18-alpine AS dev-deps
|
|
4
|
+
|
|
5
|
+
WORKDIR /workdir
|
|
6
|
+
|
|
7
|
+
COPY package.json yarn.lock ./
|
|
8
|
+
|
|
9
|
+
RUN \
|
|
10
|
+
--mount=type=secret,id=npm,dst=/workdir/.npmrc \
|
|
11
|
+
yarn install --frozen-lockfile --ignore-optional --non-interactive
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
# <%- repoName %>
|
|
2
|
+
|
|
3
|
+
[](https://github.com/seek-oss/skuba)
|
|
4
|
+
|
|
5
|
+
Next steps:
|
|
6
|
+
|
|
7
|
+
1. [ ] Finish templating if this was skipped earlier:
|
|
8
|
+
|
|
9
|
+
```shell
|
|
10
|
+
yarn skuba configure
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
2. [ ] Create a new repository in the appropriate GitHub organisation.
|
|
14
|
+
3. [ ] Add the repository to BuildAgency;
|
|
15
|
+
see [Builds at SEEK] for more information.
|
|
16
|
+
4. [ ] Add Datadog configuration and data classification tags to [.gantry/common.yml](.gantry/common.yml);
|
|
17
|
+
see the [Gantry] documentation for more information.
|
|
18
|
+
5. [ ] Push local commits to the upstream GitHub branch.
|
|
19
|
+
6. [ ] Configure [GitHub repository settings].
|
|
20
|
+
7. [ ] Delete this checklist 😌.
|
|
21
|
+
|
|
22
|
+
[builds at seek]: https://builds-at-seek.ssod.skinfra.xyz
|
|
23
|
+
[github repository settings]: https://github.com/<%-orgName%>/<%-repoName%>/settings
|
|
24
|
+
|
|
25
|
+
## Design
|
|
26
|
+
|
|
27
|
+
<%-repoName %> is a Node.js HTTP server built in line with our [technology strategy].
|
|
28
|
+
It uses the [Koa] middleware framework and common SEEK packages.
|
|
29
|
+
Resource APIs enable synchronous interactions and serve as the backbone of SEEK's general service architecture.
|
|
30
|
+
|
|
31
|
+
The `koa-rest-api` template is modelled after a hypothetical service for posting and retrieving job advertisements.
|
|
32
|
+
It's stubbed out with in-memory [storage](src/storage) which can observed by standing up an environment with multiple instances.
|
|
33
|
+
Storage is local to each instance, so load balancing across the instances may render a read inconsistent with a previous write.
|
|
34
|
+
This would be replaced with an external data store in production.
|
|
35
|
+
|
|
36
|
+
This project is deployed as a containerised application with [Gantry].
|
|
37
|
+
A typical resource API instance does not require more than 1 vCPU,
|
|
38
|
+
so we eschew clustering configurations in favour of a single Node.js process per container.
|
|
39
|
+
Under load, we autoscale horizontally in terms of container count up to `autoScaling.maxCount`.
|
|
40
|
+
|
|
41
|
+
Gantry configures [CodeDeploy] for a blue-green deployment approach.
|
|
42
|
+
A smoke test is run against the new version before traffic is switched over,
|
|
43
|
+
providing an opportunity to test access and connectivity to online dependencies.
|
|
44
|
+
This defaults to an HTTP request to the `GET /smoke` endpoint.
|
|
45
|
+
|
|
46
|
+
## Development
|
|
47
|
+
|
|
48
|
+
### Test
|
|
49
|
+
|
|
50
|
+
```shell
|
|
51
|
+
yarn test
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### Lint
|
|
55
|
+
|
|
56
|
+
```shell
|
|
57
|
+
# Fix issues
|
|
58
|
+
yarn format
|
|
59
|
+
|
|
60
|
+
# Check for issues
|
|
61
|
+
yarn lint
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Start
|
|
65
|
+
|
|
66
|
+
```shell
|
|
67
|
+
# Start a local HTTP server
|
|
68
|
+
yarn start
|
|
69
|
+
|
|
70
|
+
# Start with Node.js Inspector enabled
|
|
71
|
+
yarn start:debug
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### Deploy
|
|
75
|
+
|
|
76
|
+
This project is deployed through a [Buildkite pipeline](.buildkite/pipeline.yml).
|
|
77
|
+
|
|
78
|
+
- Commits to a feature branch can be deployed to the dev environment by unblocking a step in the Buildkite UI
|
|
79
|
+
- Commits to the default branch are automatically deployed to the dev and prod environments in sequence
|
|
80
|
+
|
|
81
|
+
To rapidly roll back a change,
|
|
82
|
+
retry an individual deployment step from the previous build in Buildkite.
|
|
83
|
+
Note that this will introduce drift between the head of the default Git branch and the live environment;
|
|
84
|
+
use with caution and always follow up with a proper revert or fix in Git history.
|
|
85
|
+
|
|
86
|
+
## Support
|
|
87
|
+
|
|
88
|
+
### Dev
|
|
89
|
+
|
|
90
|
+
TODO: add support links for the dev environment.
|
|
91
|
+
|
|
92
|
+
<!--
|
|
93
|
+
- CloudWatch dashboard
|
|
94
|
+
- Datadog dashboard
|
|
95
|
+
- Splunk logs
|
|
96
|
+
-->
|
|
97
|
+
|
|
98
|
+
### Prod
|
|
99
|
+
|
|
100
|
+
TODO: add support links for the prod environment.
|
|
101
|
+
|
|
102
|
+
<!--
|
|
103
|
+
- CloudWatch dashboard
|
|
104
|
+
- Datadog dashboard
|
|
105
|
+
- Splunk logs
|
|
106
|
+
-->
|
|
107
|
+
|
|
108
|
+
[codedeploy]: https://docs.aws.amazon.com/codedeploy
|
|
109
|
+
[gantry]: https://backstage.myseek.xyz/docs/default/component/gantry/
|
|
110
|
+
[koa]: https://koajs.com
|
|
111
|
+
[technology strategy]: https://tech-strategy.ssod.skinfra.xyz
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
version: '3.7'
|
|
2
|
+
|
|
3
|
+
services:
|
|
4
|
+
app:
|
|
5
|
+
environment:
|
|
6
|
+
# Enable Buildkite + GitHub integrations.
|
|
7
|
+
- BUILDKITE
|
|
8
|
+
- BUILDKITE_AGENT_ACCESS_TOKEN
|
|
9
|
+
- BUILDKITE_BRANCH
|
|
10
|
+
- BUILDKITE_BUILD_NUMBER
|
|
11
|
+
- BUILDKITE_JOB_ID
|
|
12
|
+
- BUILDKITE_PIPELINE_DEFAULT_BRANCH
|
|
13
|
+
- BUILDKITE_STEP_ID
|
|
14
|
+
- GITHUB_API_TOKEN
|
|
15
|
+
image: ${BUILDKITE_PLUGIN_DOCKER_IMAGE:-''}
|
|
16
|
+
init: true
|
|
17
|
+
volumes:
|
|
18
|
+
- ./:/workdir
|
|
19
|
+
# Mount agent for Buildkite annotations.
|
|
20
|
+
- /usr/bin/buildkite-agent:/usr/bin/buildkite-agent
|
|
21
|
+
# Mount cached dependencies.
|
|
22
|
+
- /workdir/node_modules
|