Create a new project
skuba can guide you through an interactive prompt to initialise a new directory and Git repository for your project. It includes a set of starter templates that reflect the typical components of a core SEEK service.
If you are looking to bootstrap an existing project, see skuba configure
.
skuba init
Creates a new local project from a starter template.
skuba init
does not provision any resources in AWS, Buildkite or GitHub on its own, and only requires a connection to the public npm registry. Most of its built-in templates start you off with a Buildkite pipeline that should be ready to go once you push your repository to GitHub and configure Buildkite.
Option | Description |
---|---|
--debug | Enable debug console output |
Interactive walkthrough
Letβs start by running the command:
skuba init
and answering a few starter questions:
? For starters, some project details:
β Owner : SEEK-Jobs/my-team
β Repo : my-repo
β Platform : arm64
β Default Branch : main
# ...
skuba init
will initialise your CODEOWNERS file and a few others based on the specified owner. GitHub teams can be found at the following URL:
github.com/orgs/SEEK-Jobs/teams/my-team/repositories
Youβre now presented with a selection of templates:
? Select a template:
express-rest-api
β― greeter
koa-rest-api
lambda-sqs-worker
lambda-sqs-worker-cdk
oss-npm-package
private-npm-package
github β
Use the β β
arrow keys, then β
enter your selection.
The selected template will prompt you to fill out some additional fields. You can skip these for now to get your bearing:
This template uses the following information:
- Prod Buildkite queue
? Fill this in now? β¦
yes
β― no
Resume this later with pnpm exec skuba configure.
skuba init
will take a while to install some initial dependencies, after which youβll have a new directory to work with:
Initialized empty Git repository in /my-repo/.git/
Installing dependencies...
β All done! Try running:
cd my-repo
git push --set-upstream origin main
You can now proceed to the next steps.
Unattended execution
skuba init
is interactive by default. For unattended execution, pipe in JSON:
skuba init << EOF
{
"destinationDir": "tmp-greeter",
"templateComplete": true,
"templateData": {
"ownerName": "my-org/my-team",
"prodBuildkiteQueueName": "123456789012:cicd",
"platformName": "arm64",
"repoName": "tmp-greeter"
},
"templateName": "greeter"
}
EOF
β
Next steps
Now that youβve run skuba init
, where does that leave you?
Git repository
Letβs review the Git repository that has been initialised to see whatβs in there:
git log
# Clone greeter
# Initial commit
git remote get-url origin
# git@github.com:<org>/<repo>.git
skuba has committed its initial template files and configured a remote origin
for you. You should create the corresponding repository on GitHub and push to it. Replace main
with your default branch name as appropriate:
git push --set-upstream origin main
Directory structure
Familiarise yourself with the directory structure that skuba has created:
βββ .buildkite
βββ .github
βββ .vscode
βββ src
βββ app.test.ts
βββ app.ts
βββ .dockerignore
βββ .eslintignore
βββ .eslintrc.js
βββ .gitignore
βββ .nvmrc
βββ .prettierignore
βββ .prettierrc.js
βββ Dockerfile
βββ README.md
βββ docker-compose.yml
βββ jest.config.js
βββ jest.setup.ts
βββ package.json
βββ pnpm-lock.yaml
βββ skuba.template.js
βββ tsconfig.build.json
βββ tsconfig.json
A few points to call out:
- There are configuration files aplenty for the various tools we use in skuba and more broadly at SEEK.
- The
.buildkite
directory houses a CI/CD pipeline that should be ready to go once you push your repository to GitHub and configure Buildkite. - The
src
directory contains our source code, which is later compiled tolib
. package.json
lists your project dependencies and scripts.
CLI commands
Try out some of the commands documented throughout this CLI section.
skuba lint
may be a good starting point:
skuba lint
Templating
If you skipped templating earlier, skuba lint
will complain that you havenβt finished it.
Once youβre ready, run skuba configure
:
skuba configure
You can grep your directory for the values you enter to figure out where they are used, and you can always change them later.
README checklist
Each built-in template has a README.md
that contains a checklist of next steps to take your project to production.