From db795ff5a6e85d8db984f8a0f51cf614b347d26b Mon Sep 17 00:00:00 2001 From: Damjan Znidarsic <195270+spinx@users.noreply.github.com> Date: Tue, 10 Sep 2024 08:04:01 +0200 Subject: [PATCH] Bento: checksum name support (#3) * Bento: checksum name support * rename prop and add readme --- README.md | 24 ++++++++++++++++++------ lib/config.js | 4 ++++ lib/install.js | 4 +++- 3 files changed, 25 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 993d91e..81c823c 100644 --- a/README.md +++ b/README.md @@ -127,9 +127,7 @@ you can use this shorthand, ```json { "blobpack": { - "artifacts": [ - "boring" - ] + "artifacts": ["boring"] } } ``` @@ -143,9 +141,23 @@ you can use the `include` property, "include": { "resources": ["logger"] }, - "artifacts": [ - "boring" - ] + "artifacts": ["boring"] + } +} +``` + +#### Bento support + +If you need Serverless Bento, you can change `src` and `checksumPrefix` properties: + +```json +{ + "blobpack": { + "name": "benthos-lambda", + "version": "4.10.0", + "platform": "linux_amd64", + "checksumPrefix": "bento", + "src": "https://github.com/warpstreamlabs/bento/releases/download" } } ``` diff --git a/lib/config.js b/lib/config.js index a89e8d9..0c9b5a6 100644 --- a/lib/config.js +++ b/lib/config.js @@ -10,6 +10,10 @@ export const loadConfig = async (configPath) => { ) } + if (typeof config.checksumPrefix === 'undefined') { + config.checksumPrefix = 'benthos' + } + return config } diff --git a/lib/install.js b/lib/install.js index 17c9204..e667bb0 100644 --- a/lib/install.js +++ b/lib/install.js @@ -38,7 +38,9 @@ const get = async (benthos) => { const [data, checksums] = await Promise.all([ download(`${root}/${name}`), - download(`${root}/benthos_${benthos.version}_checksums.txt`) + download( + `${root}/${benthos.checksumPrefix}_${benthos.version}_checksums.txt` + ) ]) return { name, data, checksums }