Skip to content

Commit

Permalink
Bento: checksum name support (#3)
Browse files Browse the repository at this point in the history
* Bento: checksum name support

* rename prop and add readme
  • Loading branch information
spinx authored Sep 10, 2024
1 parent 68592eb commit db795ff
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 7 deletions.
24 changes: 18 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,7 @@ you can use this shorthand,
```json
{
"blobpack": {
"artifacts": [
"boring"
]
"artifacts": ["boring"]
}
}
```
Expand All @@ -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"
}
}
```
Expand Down
4 changes: 4 additions & 0 deletions lib/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ export const loadConfig = async (configPath) => {
)
}

if (typeof config.checksumPrefix === 'undefined') {
config.checksumPrefix = 'benthos'
}

return config
}

Expand Down
4 changes: 3 additions & 1 deletion lib/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down

0 comments on commit db795ff

Please sign in to comment.