1.0.0 • Published 2 years ago

serverless-version v1.0.0

Weekly downloads
266
License
UNLICENSED
Repository
github
Last release
2 years ago

serverless-version

This is a serverless plugin to import GET /version api to the service stack.

This plugin allows you to specify the function name and http event paths for API Gateway's REST API and it will append version function.

By default, Serverless creates automatically an API Gateway for each Serverless stack or service (i.e. serverless.yml) you deploy. This plugin will append by default GET /version api endpoint to the service and return version number from custom provider variables.

Add the plugin to your serverless.yml:

plugins:
  - serverless-version

Add the custom configuration:

custom:
  apiVersion:
    # Optional version lambda function name (by default - version)
    name: funcName
    # Optional http lambda triggers (by default - /version)
    paths:
      - /sites/{site}/route
      - /custom-route
    # Optional lambda function handler location to copy the code over serverless stack deployment
    # (by default - src/handlers)
    handlerLocation: "folder"
    # Optional version lambda function description
    # (by default - Public version api endpoint )
    description: "custom description"

Installation

This is a private @cumulusds package. You will need to npm login before adding the package or running yarn install. To add the sts-sites dependency to your package, run:

yarn add serverless-version

Deployment

The git describe command is used to determine the package version. To correctly describe the version, git history and tags must be available during deployment. Use the following snippet in GitHub Actions deployment jobs:

      - name: Checkout
        uses: actions/checkout@v2
        with:
          fetch-depth: 0
      - name: Fetch all tags
        run: git fetch origin +refs/tags/*:refs/tags/*

Development

License

This package is not licensed.

1.0.0

2 years ago

0.1.0

4 years ago

0.0.6

4 years ago

0.0.5

4 years ago

0.0.3

4 years ago

0.0.4

4 years ago

0.0.2

4 years ago