Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

Commit

Permalink
Merge pull request #14 from kayac/feature/v2.0.0-amazon-linux-2
Browse files Browse the repository at this point in the history
v2.0.0 - for amazon linux 2
  • Loading branch information
mashiike authored Sep 8, 2020
2 parents 3d65fe1 + 7df2d96 commit a8d95aa
Show file tree
Hide file tree
Showing 253 changed files with 137 additions and 8,881 deletions.
10 changes: 6 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
export

# Download bin/package
bin/kv2json
aws
awscliv2.zip
bin/aws
bin/aws_completer
bin/awscli
bin/
!bin/.gitkeep
share/
!share/.gitkeep
lib/
!lib/.gitkeep

# Byte-compiled / optimized / DLL files
__pycache__/
Expand Down
31 changes: 20 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
SHELL = /usr/bin/env bash -xe
AWSCLI_VERSION := 2.0.30
JQ_VERSION := 1.6
PWD := $(shell pwd)

build_on_docker: archives/awscli-exe-linux-x86_64-$(AWSCLI_VERSION).zip
build_on_docker: yumda archives/awscli-exe-linux-x86_64-$(AWSCLI_VERSION).zip
docker build -t bash-lambda-layer-builder docker/builder
docker run -v $(PWD):/root/bash-lambda-layer -v $(PWD)/bin:/opt/bin \
--workdir="/root/bash-lambda-layer" \
bash-lambda-layer-builder \
make build

build: bin/kv2json awscli
build: awscli bin/jq
@rm -rf export
@mkdir export
@zip -yr export/layer.zip bootstrap bin lib libexec share
@zip -yr export/layer.zip bootstrap bin lib share
@zip -yr export/bash-lambda-layer.zip export/layer.zip publish.sh publish-only.sh README.publish.md

yumda:
docker run --rm -v $(PWD):/lambda/opt lambci/yumda:2 yum install -y zip-3.0 unzip-6.0

publish:
@$(PWD)/publish.sh

Expand All @@ -37,20 +41,25 @@ awscli: archives/awscli-exe-linux-x86_64-$(AWSCLI_VERSION).zip
&& ./aws/install -i /opt/bin/awscli -b /opt/bin --update \
&& rm -rf aws

bin/kv2json:
bin/jq:
cd bin/ \
&& curl -sOL https://raw.githubusercontent.com/Songmu/App-KV2JSON/master/kv2json \
&& chmod +x kv2json
&& curl -o jq -sL https://github.com/stedolan/jq/releases/download/jq-$(JQ_VERSION)/jq-linux64 \
&& chmod +x jq

clean:
rm -f bin/aws
rm -rf bin/awscli
rm -f bin/aws_completer
rm -f bin/kv2json
rm -f archives/*.zip
rm -rf bin/
mkdir bin
touch bin/.gitkeep
rm -rf share/
mkdir share
touch share/.gitkeep
rm -rf lib/
mkdir lib
touch lib/.gitkeep

.PHONY: \
build
publish
publish-staging
awscli
yumda
21 changes: 18 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,31 @@
# Bash in AWS Lambda [Modified by Kayac inc.]

forked [gkrizek/bash-lambda-layer](https://github.com/gkrizek/bash-lambda-layer) because we needed to modify and maintain it in our organization.
See the [original REDME](README.original.md) for details.
Respect for the original gkrizek/bash-lambda-layer.

The original gkrizek/bash-lambda-layer is no longer supported on August 20, 2020.
Click [here](https://github.com/gkrizek/bash-lambda-layer/commit/703b0ade8174022d44779d823172ab7ac33a5505) for details.

## Difference from the original

### compatible runtimes
only `provided.al2`

### ARN

```
arn:aws:lambda:<region>:513375597510:layer:bash:4
```

### tools version
In kayac/bash-lambda-layer,the following executables.
* AWS CLI v2.0.30
* kv2json v0.02
* jq 1.6
* zip 3.0
* unzip 6.0

### function
* Error handling using kv2json.
* Error handling using jq, for json escape.

## How to publish to local AWS account.

Expand All @@ -34,3 +42,10 @@ $ ./publish.sh
```
$AWS_REGION=<target region> ./publish-only.sh
```

## If want additional executable commands...

Let's stack layers
Check `examples/additional-git-layer` for more details.

Only add executables to kayac/bash-lambda-layer if it is often needed by our organization.
File renamed without changes.
Binary file removed bin/bc
Binary file not shown.
Binary file removed bin/git
Binary file not shown.
4 changes: 0 additions & 4 deletions bin/git-cvsserver

This file was deleted.

1 change: 0 additions & 1 deletion bin/git-receive-pack

This file was deleted.

Binary file removed bin/git-shell
Binary file not shown.
1 change: 0 additions & 1 deletion bin/git-upload-archive

This file was deleted.

1 change: 0 additions & 1 deletion bin/git-upload-pack

This file was deleted.

Binary file removed bin/jq
Binary file not shown.
Binary file removed bin/rsync
Binary file not shown.
Binary file removed bin/scp
Binary file not shown.
Binary file removed bin/sftp
Binary file not shown.
1 change: 0 additions & 1 deletion bin/slogin

This file was deleted.

Binary file removed bin/ssh
Binary file not shown.
Binary file removed bin/ssh-add
Binary file not shown.
Binary file removed bin/ssh-agent
Binary file not shown.
Loading

0 comments on commit a8d95aa

Please sign in to comment.