Skip to content

Commit

Permalink
Cleanup (#3)
Browse files Browse the repository at this point in the history
* Fix linting errors

* Use coveralls.io

* Run coveralls task in CircleCI

* Add coverage/ to .gitignore

* Update README.md

* Update package.json

* Update README.md
  • Loading branch information
sbstjn authored and Henrik Fricke committed Apr 3, 2017
1 parent e8ac0d5 commit e7ad939
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 8 deletions.
4 changes: 3 additions & 1 deletion .gitignore
@@ -1 +1,3 @@
node_modules
coverage
node_modules
*.log
8 changes: 6 additions & 2 deletions README.md
@@ -1,10 +1,14 @@
# Serverless Plugin Dotenv
# ⚡️ Serverless Plugin Dotenv

[![npm](https://img.shields.io/npm/v/@jimdo/serverless-dotenv.svg)](https://www.npmjs.com/package/@jimdo/serverless-dotenv)
[![license](https://img.shields.io/github/license/jimdo/serverless-dotenv.svg)](https://github.com/jimdo/serverless-dotenv/blob/master/LICENSE)
[![Coveralls](https://img.shields.io/coveralls/jimdo/serverless-dotenv.svg)](https://coveralls.io/github/jimdo/serverless-dotenv)

## About the plugin

This serverless plugin generates a `.env` file based on the environment variables in the `serverless.yml`. The idea is to use this environment variables for further tasks like integration tests etc. It works great with `serverless offline`, so you can start serverless offline, the plugin will hook into the process and create the `.env` file. You will find the `.env` file in the `.serverless` folder of your project.

It will collect the global environment variables of the poject as well as all environment variables of the functions. It will also add `API_ENDPOINT` and `IS_OFFLINE` to your environment if you run the plugin via `serverless offline`.
It will collect the global environment variables of the poject as well as all environment variables of the functions. It will also add `API_ENDPOINT` and `IS_OFFLINE` to your environment if you run the plugin via `serverless offline`.

## Usage

Expand Down
4 changes: 3 additions & 1 deletion circle.yml
Expand Up @@ -19,7 +19,9 @@ dependencies:

test:
override:
- yarn test
- yarn test:cover
post:
- yarn coveralls

deployment:
production:
Expand Down
10 changes: 7 additions & 3 deletions package.json
Expand Up @@ -5,8 +5,10 @@
"author": "Henrik Fricke <henrik.fricke@jimdo.com>",
"license": "MIT",
"scripts": {
"test": "$(yarn bin)/jest test",
"lint": "$(yarn bin)/standard | $(yarn bin)/snazzy"
"test": "$(npm bin)/jest test",
"test:cover": "$(npm bin)/jest test --coverage",
"lint": "$(npm bin)/standard | $(npm bin)/snazzy",
"coveralls": "cat ./coverage/lcov.info | $(npm bin)/coveralls"
},
"repository": {
"type": "git",
Expand All @@ -17,6 +19,7 @@
},
"homepage": "https://github.com/Jimdo/serverless-dotenv",
"dependencies": {
"coveralls": "^2.12.0",
"mkdirp": "^0.5.1"
},
"devDependencies": {
Expand All @@ -30,7 +33,8 @@
"jest"
],
"ignore": [
"node_modules/"
"node_modules/",
"coverage"
]
}
}
1 change: 0 additions & 1 deletion src/lib/collectOfflineEnvVariables.js
Expand Up @@ -28,4 +28,3 @@ function collectOfflineEnvVariables (serverless, cliOptions) {
}

module.exports = collectOfflineEnvVariables

0 comments on commit e7ad939

Please sign in to comment.