Skip to content

Latest commit

 

History

History
92 lines (52 loc) · 3.6 KB

README.Template.md

File metadata and controls

92 lines (52 loc) · 3.6 KB

Project Name Build Status

Prompt: Add project description

Local Development

Getting Started

Install project dependencies using:

yarn | npm | other

You should install serverless if you haven't already.

yarn global add serverless

To set up your local environment, you'll need to decrypt the environment values in concourse/private.yml. The easiest way to do this is by running git keybase unlock. Then copy .env.example to .env and fill in the blanks as directed in the comments.

Once you've created your .env file you can simulate Lambda and API Gateway locally using the following command.

sls offline start

Prompt: Does this service need LocalStack for local SQS or other offline services?

Testing

Unit tests are run using package scripts e.g. yarn test:unit (or NPM if this repo uses that) Prompt: Do they require any special setup? Do they access any external services?

Feature tests on the other hand require a deployment of this service (or the local simulation) and will make HTTP requests to it. In order to run them, you need to set up your local environment:

  • ensure your .env file is set up as described above
  • prompt: any special requirements - e.g. VPN access to databases?

You can then run the feature tests using a package script like yarn test:feat.

Offline Testing

To run against serverless-offline, which is the recommended way to test, follow these steps:

configure STAGING_BASE_URL=http://localhost:3001/ in your .env file

open a separate terminal and set valid AWS credentials – get them from AWS SSO for the [AWS Account for this service] account

start yarn offline --stage staging

Deployment

Deployments are run automatically by Concourse when new commits are pushed to master. You can check the pipeline status here.

The pipeline config is in the concourse directory. Any changes need to be deployed to Concourse manually. Follow these steps:

  1. Make your changes in the bootstrap repo, open a pull request and request review.

  2. Once approved and before merging, apply the changes to Concourse:

    i. Set up the target: e.g. yarn fly:login (only needs to be done once)

    ii. Update the pipeline: e.g. yarn fly:set-pipeline

  3. Check that the changes work as expected. If there are problems, you can push fixes to your PR branch and retry.

  4. Merge your PR.

Pull requests are tested using Github actions, which will run code style and unit tests against the PR. Github actions are defined in the .github folder under workflows

Prompt: Does this service have a trigger for a CI deploy into a PR environment?

Environments

Prompt: What environments does this service use? Production, Staging and Sandbox?

Domains for this service are:

Queues

Prompt: If the service uses queues, describe and address here

API Documentation