From cb20a559d2fddbede25254c07ad79bd613058b26 Mon Sep 17 00:00:00 2001 From: Damjan Znidarsic Date: Fri, 6 Sep 2024 15:17:28 +0200 Subject: [PATCH 1/2] Bento: checksum name support --- lib/config.js | 4 ++++ lib/install.js | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/config.js b/lib/config.js index a89e8d9..9c52df2 100644 --- a/lib/config.js +++ b/lib/config.js @@ -10,6 +10,10 @@ export const loadConfig = async (configPath) => { ) } + if (typeof config.checksum === 'undefined') { + config.checksum = 'benthos' + } + return config } diff --git a/lib/install.js b/lib/install.js index 17c9204..bb94300 100644 --- a/lib/install.js +++ b/lib/install.js @@ -38,7 +38,7 @@ const get = async (benthos) => { const [data, checksums] = await Promise.all([ download(`${root}/${name}`), - download(`${root}/benthos_${benthos.version}_checksums.txt`) + download(`${root}/${benthos.checksum}_${benthos.version}_checksums.txt`) ]) return { name, data, checksums } From 9c94546bbdebabfddb9dedf4748ba8a2daf4d9aa Mon Sep 17 00:00:00 2001 From: Damjan Znidarsic Date: Sat, 7 Sep 2024 10:23:24 +0200 Subject: [PATCH 2/2] rename prop and add readme --- README.md | 24 ++++++++++++++++++------ lib/config.js | 4 ++-- lib/install.js | 4 +++- 3 files changed, 23 insertions(+), 9 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 9c52df2..0c9b5a6 100644 --- a/lib/config.js +++ b/lib/config.js @@ -10,8 +10,8 @@ export const loadConfig = async (configPath) => { ) } - if (typeof config.checksum === 'undefined') { - config.checksum = 'benthos' + if (typeof config.checksumPrefix === 'undefined') { + config.checksumPrefix = 'benthos' } return config diff --git a/lib/install.js b/lib/install.js index bb94300..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.checksum}_${benthos.version}_checksums.txt`) + download( + `${root}/${benthos.checksumPrefix}_${benthos.version}_checksums.txt` + ) ]) return { name, data, checksums }