Skip to content

Commit 05fb7e6

Browse files
committed
init
0 parents  commit 05fb7e6

File tree

10 files changed

+1078
-0
lines changed

10 files changed

+1078
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Package and publish
2+
on:
3+
push:
4+
tags:
5+
- v*
6+
jobs:
7+
publish:
8+
runs-on: 'ubuntu-latest'
9+
steps:
10+
- uses: actions/checkout@v2
11+
# Setup .npmrc file to publish to npm
12+
- uses: actions/setup-node@v2
13+
with:
14+
node-version: 14.x
15+
registry-url: 'https://registry.npmjs.org'
16+
- run: npm install
17+
- run: npm run compile
18+
- run: npm publish
19+
env:
20+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
21+
- name: Create Release
22+
id: create-release
23+
uses: actions/create-release@v1
24+
env:
25+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26+
with:
27+
tag_name: ${{ github.ref }}
28+
release_name: ${{ github.ref }}
29+
draft: false
30+
prerelease: true

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
node_modules
2+
*tgz
3+
/dist
4+
coverage

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2020 Tomasz Janowski
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# AWS Lambda NodeJS Custom Runtime
2+
3+
AWS Lambda runtime API implemented in Node.js.
4+
5+
## Goals
6+
7+
* Provide a robust Node.js execution environment.
8+
* Make the runtime environment compatible with the default node12.x and node14.x environments
9+
10+
## How to install?
11+
12+
```sh
13+
npm install aws-lambda-node-runtime --save
14+
```
15+
16+
## How to use it?
17+
18+
```js
19+
const runtime = require('aws-lambda-node-runtime');
20+
21+
const done = (err) => {
22+
if (err) {
23+
console.warn('Runtime exiting due to an error', err)
24+
}
25+
}
26+
27+
console.warn('Runtime starting...')
28+
runtime(done);
29+
```

auto/dev-runtime

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/sh
2+
3+
set -ex
4+
5+
DIR="$( cd "$( dirname "$0" )" && pwd )"
6+
7+
cd "${DIR}/.."
8+
9+
docker-compose build
10+
docker-compose up dev

auto/dev-runtime-cmd

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/sh
2+
3+
DIR="$( cd "$( dirname "$0" )" && pwd )"
4+
5+
export _HANDLER=hello.handler
6+
export LAMBDA_TASK_ROOT="${DIR}/.."
7+
8+
export AWS_LAMBDA_FUNCTION_NAME=test-function-name
9+
export AWS_LAMBDA_FUNCTION_VERSION=test-function-version
10+
export AWS_LAMBDA_FUNCTION_MEMORY_SIZE=128
11+
export AWS_LAMBDA_LOG_GROUP_NAME=test-log-group-name
12+
export AWS_LAMBDA_LOG_STREAM_NAME=test-log-stream-name
13+
14+
cd "${DIR}/.."
15+
16+
sleep 5
17+
exec "./stage/work/bootstrap"

0 commit comments

Comments
 (0)