forked from badouralix/rclone-lambda-layer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
35 lines (27 loc) · 1.45 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
LAYER_NAME_PREFIX = rclone
RCLONE_VERSION = v1.64.2
build-amd64:
mkdir -p build/layer-amd64/bin/ dist/
wget -P build/ https://github.com/rclone/rclone/releases/download/$(RCLONE_VERSION)/rclone-$(RCLONE_VERSION)-linux-amd64.zip
unzip -j build/rclone-$(RCLONE_VERSION)-linux-amd64.zip rclone-$(RCLONE_VERSION)-linux-amd64/rclone -d build/layer-amd64/bin/
cd build/layer-amd64/ && zip -r ../../dist/layer-amd64.zip *
build-arm64:
mkdir -p build/layer-arm64/bin/ dist/
wget -P build/ https://github.com/rclone/rclone/releases/download/$(RCLONE_VERSION)/rclone-$(RCLONE_VERSION)-linux-arm64.zip
unzip -j build/rclone-$(RCLONE_VERSION)-linux-arm64.zip rclone-$(RCLONE_VERSION)-linux-arm64/rclone -d build/layer-arm64/bin/
cd build/layer-arm64/ && zip -r ../../dist/layer-arm64.zip *
.PHONY: deploy-amd64
deploy-amd64:
aws lambda publish-layer-version --layer-name $(LAYER_NAME_PREFIX)-amd64 --compatible-architectures "x86_64" --description "Rclone $(RCLONE_VERSION)" --license-info "MIT" --zip-file fileb://dist/layer-amd64.zip
.PHONY: deploy-arm64
deploy-arm64:
aws lambda publish-layer-version --layer-name $(LAYER_NAME_PREFIX)-arm64 --compatible-architectures "arm64" --description "Rclone $(RCLONE_VERSION)" --license-info "MIT" --zip-file fileb://dist/layer-arm64.zip
.PHONY: clean
clean:
rm -rv build dist
.PHONY: all-amd64
all-amd64: build-amd64 deploy-amd64 clean
.PHONY: all-arm64
all-arm64: build-arm64 deploy-arm64 clean
.PHONY: all
all: all-amd64 all-arm64