Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bento: checksum name support #3

Merged
merged 2 commits into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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