All Projects → jacob-meacham → Serverless Plugin Git Variables

jacob-meacham / Serverless Plugin Git Variables

Licence: mit
⚡️ Expose git variables to serverless

Programming Languages

shell
77523 projects

Projects that are alternatives of or similar to Serverless Plugin Git Variables

Serverless Es Logs
A Serverless plugin to transport logs to ElasticSearch
Stars: ✭ 51 (-32%)
Mutual labels:  aws, serverless, aws-lambda, serverless-framework, serverless-plugin
Serverless Sentry Plugin
This plugin adds automatic forwarding of errors and exceptions to Sentry (https://sentry.io) and Serverless (https://serverless.com)
Stars: ✭ 146 (+94.67%)
Mutual labels:  aws, serverless, aws-lambda, serverless-framework, serverless-plugin
Serverless Plugin Canary Deployments
Canary deployments for your Serverless application
Stars: ✭ 283 (+277.33%)
Mutual labels:  aws, serverless, aws-lambda, serverless-framework, serverless-plugin
Serverless Chrome
🌐 Run headless Chrome/Chromium on AWS Lambda
Stars: ✭ 2,625 (+3400%)
Mutual labels:  aws, serverless, aws-lambda, serverless-framework, serverless-plugin
Serverless Wsgi
Serverless plugin to deploy WSGI applications (Flask/Django/Pyramid etc.) and bundle Python packages
Stars: ✭ 377 (+402.67%)
Mutual labels:  serverless, aws-lambda, serverless-framework, serverless-plugin
Ng Toolkit
⭐️ Angular tool-box! Start your PWA in two steps! Add Serverless support for existing projects and much more
Stars: ✭ 1,116 (+1388%)
Mutual labels:  aws, serverless, aws-lambda, serverless-framework
Serverless Node Simple Image Resize
Simple image resize AWS lambda function
Stars: ✭ 74 (-1.33%)
Mutual labels:  aws, serverless, aws-lambda, serverless-framework
Serverless Step Functions
AWS Step Functions plugin for Serverless Framework ⚡️
Stars: ✭ 758 (+910.67%)
Mutual labels:  aws, serverless, serverless-framework, serverless-plugin
Serverlessbydesign
A visual approach to serverless development. Think. Build. Repeat.
Stars: ✭ 254 (+238.67%)
Mutual labels:  aws, serverless, aws-lambda, serverless-framework
Webiny Js
Enterprise open-source serverless CMS. Includes a headless CMS, page builder, form builder and file manager. Easy to customize and expand. Deploys to AWS.
Stars: ✭ 4,869 (+6392%)
Mutual labels:  aws, serverless, aws-lambda, serverless-framework
Serverless Node Simple Messaging
Simple email AWS lambda function
Stars: ✭ 75 (+0%)
Mutual labels:  aws, serverless, aws-lambda, serverless-framework
Express
⚡ Take existing Express.js apps and host them easily on cheap, auto-scaling, serverless infrastructure (AWS Lambda and AWS HTTP API).
Stars: ✭ 337 (+349.33%)
Mutual labels:  aws, serverless, aws-lambda, serverless-framework
Serverless Python Requirements
⚡️🐍📦 Serverless plugin to bundle Python packages
Stars: ✭ 838 (+1017.33%)
Mutual labels:  aws, serverless, aws-lambda, serverless-plugin
Chalice
Python Serverless Microframework for AWS
Stars: ✭ 8,513 (+11250.67%)
Mutual labels:  aws, serverless, aws-lambda, serverless-framework
Aws Auto Cleanup
Open-source application to programmatically clean your AWS resources based on a whitelist and time to live (TTL) settings
Stars: ✭ 276 (+268%)
Mutual labels:  aws, serverless, aws-lambda, serverless-framework
Serverless Plugin Typescript
Serverless plugin for zero-config Typescript support
Stars: ✭ 611 (+714.67%)
Mutual labels:  serverless, aws-lambda, serverless-framework, serverless-plugin
Serverless Aws Lambda Node Postgres
Serverless AWS Lambda with Node.js,Postgres Rest API with Sequelize.
Stars: ✭ 18 (-76%)
Mutual labels:  aws, serverless, aws-lambda, serverless-framework
Serverless Export Env
Serverless plugin to export environment variables into a .env file
Stars: ✭ 51 (-32%)
Mutual labels:  aws, serverless, aws-lambda, serverless-plugin
Aws Lambda Typescript
This sample uses the Serverless Application Framework to implement an AWS Lambda function in TypeScript, deploy it via CloudFormation, publish it through API Gateway to a custom domain registered on Route53, and document it with Swagger.
Stars: ✭ 228 (+204%)
Mutual labels:  aws, serverless, aws-lambda, serverless-framework
Serverless Plugin Warmup
Keep your lambdas warm during winter. ♨
Stars: ✭ 814 (+985.33%)
Mutual labels:  aws, serverless, aws-lambda, serverless-plugin

serverless-plugin-git-variables

Coverage Status Build Status

Expose git variables (HEAD description, branch name, short commit hash, message, git tags, and if the local repo has changed files) to your serverless services. Moreover, it adds GIT related environment variables and tags (GIT_COMMIT_SHORT, GIT_COMMIT_LONG, GIT_BRANCH, GIT_IS_DIRTY, GIT_REPOSITORY, GIT_TAGS) for each defined function in the serverless file. You can disable this by adding the following custom variable in your serverless.yml file:

custom:
  exportGitVariables: false

If you only want to add a specific subset of variables/tags, you can define a whitelist:

custom:
  gitVariablesEnvWhitelist: ['GIT_COMMIT_SHORT', 'GIT_TAGS']
  gitVariablesTagsWhitelist: ['GIT_REPOSITORY', 'GIT_COMMIT_LONG']

If you have multiple git tags, you'll run into issues when adding them as AWS tags, so you'll need to exclude them from the whitelist.

Usage

custom:
  gitDescription: ${git:repository} - ${git:branch} - ${git:tags}

functions:
  processEventBatch:
    name: ${self:provider.stage}-${self:service}-process-event-batch
    description: ${self:custom.gitDescription}

  processEventBatch2:
    name: ${self:provider.stage}-${self:service}-process-event-batch-2
    description: ${self:custom.gitDescription}

plugins:
  - serverless-plugin-git-variables

resources:
  Description: >
    ${self:service} ${git:branch}:${git:sha1}
    https://github.com/jacob-meacham/serverless-plugin-git-variables
    ${git:message}

Available variables

  • git:repository - name of the git repository
  • git:sha1 - hash of the current commit
  • git:branch - name of the current branch
  • git:isDirty - true if the workspace is currently dirty
  • git:describe / git:describeLight - see below
  • git:user - The user's name
  • git:email - The user's email
  • git:tags - The tag pointing to the current commit
  • git:message - Full git commit message
  • git:messageSubject - Only the suject of the message, as git log -1 --pretty=%s
  • git:messageBody - Only the body of the message, as git log -1 --pretty=%b

describe and describeLight

The describe (${git:describe}) and the describeLight (${git:describeLight}) variables are both used to return the most recent tag of the repo. However the difference is that whilst describe evaluates to git describe --always, the describeLight variable evaluates to git describe --always --tags. --always will ensure that if no tags are present, the commit hash is shown as a fallback option. (See git describe documentation for more information).

Annotated tags are shown by both describe and describeLight, only describeLight will show lightweight tags (such as those generated when using GitHub's releases feature).

For more information on annotated and lightweight tags go to the git documentation on tagging.

tags

The tags (${git:tags}) is used to get info about which git tags (separated by ::) are pointing to current commit and if none it will show commit ID as fallback.

Version History

  • 5.1.0
    • Add messageSubject/messageBody (Thanks @vhenzl)
  • 5.0.1
    • Fix module export (Thanks @nason)
  • 5.0.0
    • Rely on a more modern version of Node, which allows removal of runtime dependencies
  • 4.1.0
  • 4.0.0
    • Change tags separator from ',' to '::' to conform to the AWS tag regex
  • 3.5.0
    • Add ability to specify whitelist of variables to set on the environment or in tags
  • 3.4.0
    • Add user name / email (Thanks to @JordanReiter)
    • Add git tag information (Thanks to @navrkald)
  • 3.3.3
    • Update dependencies thanks to dependabot
  • 3.3.2
    • Fixed issue with sporadic command failures (Thanks to @iamakulov)
  • 3.3.1
    • Changed approach for finding repository name, to fix plugin on Windows
  • 3.3.0
    • Added repository name (Thanks to @iDVB)
  • 3.2.0
    • Added a describeLight git variable, which allows use of lightweight tags (Thanks to @domroutley)
  • 3.1.1
    • Fix issue that occurs if a function has no environment specified (Thanks to @arnaudh-nutonomy)
  • 3.1.0
    • Plugin now also adds environment variables that are accessible at runtime (Thanks to @chechu)
  • 3.0.0
    • Add support for long commit hash (Thanks to @e-e-e)
    • backwards incompatible change: git describe now uses --always, so if there are not tags it returns a hash instead of failing (Thanks to @e-e-e)
  • 2.1.1
    • Fix packaging issue
  • 2.1.0
  • 2.0.0
    • support Serverless >= 1.16.0
  • 1.0.1
    • list babel-runtime as a dependency
  • 1.0.0
    • Initial release
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].