File tree Expand file tree Collapse file tree 7 files changed +11552
-2
lines changed
Expand file tree Collapse file tree 7 files changed +11552
-2
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,8 @@ Cargo.lock
1919.LSOverride
2020
2121# Icon must end with two \r
22- Icon
22+ Icon
23+
2324
2425# Thumbnails
2526._ *
3940Network Trash Folder
4041Temporary Items
4142.apdisk
43+
44+ examples /aws /lambda /layer
45+ examples /aws /lambda /.serverless
46+ examples /aws /lambda /node_modules
Original file line number Diff line number Diff line change 11[package ]
22name = " khmercut"
3- version = " 0.1.5 "
3+ version = " 0.2.1 "
44edition = " 2021"
55license = " MIT"
66description = " A blazingly fast Khmer word segmentation tool written in Rust."
Original file line number Diff line number Diff line change 1+
2+ ARTIFACT_URL =https://github.com/semsphy/khmercut-rs/releases/download/0.2.0/khmercut-Linux-aarch64-musl.tar.gz
3+ LAYER_DIR =layer
4+ ARTIFACT_FILE =khmercut.tar.gz
5+
6+ all : deploy
7+
8+ # Target to download the artifact
9+ download :
10+ @echo " Downloading artifact from $( ARTIFACT_URL) ..."
11+ curl -L $(ARTIFACT_URL ) -o $(ARTIFACT_FILE )
12+
13+ # Target to extract the artifact
14+ extract : download
15+ @echo " Extracting artifact..."
16+ mkdir -p $(LAYER_DIR )
17+ tar -xzf $(ARTIFACT_FILE ) -C $(LAYER_DIR )
18+ rm $(ARTIFACT_FILE )
19+ @echo " Artifact downloaded and extracted to $( LAYER_DIR) "
20+
21+
22+
23+ deploy : extract
24+ @echo " Deploying the service..."
25+ npx serverless deploy
26+
27+ # Target to clean up
28+ clean :
29+ @echo " Cleaning up..."
30+ rm -rf $(LAYER_DIR )
31+ rm -f $(ARTIFACT_FILE )
32+
33+ .PHONY : all download extract deploy clean
Original file line number Diff line number Diff line change 1+ # Build AWS Lambda layer
2+
3+ ## Usage
4+
5+ Deploy a layer to aws
6+
7+ ``` shell
8+ make
9+ ```
10+
11+ ## Layers
12+
13+ | Layer | version |
14+ | ------------------------------------------------------------| ---------|
15+ | arn:aws:lambda:ap-southeast-1:124081850635:layer:khmercut:2| v2 |
16+
17+
18+ ## References
19+
20+ - [ serverless-rust] ( https://www.serverless.com/plugins/serverless-rust )
You can’t perform that action at this time.
0 commit comments