Skip to content

Commit

Permalink
Add seaweedfs package (#213)
Browse files Browse the repository at this point in the history
  • Loading branch information
kylewlacy authored Jan 29, 2025
1 parent 0fe2f5a commit 6c55f89
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/seaweedfs/brioche.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

51 changes: 51 additions & 0 deletions packages/seaweedfs/project.bri
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import * as std from "std";
import { goBuild } from "go";
import { gitCheckout } from "git";
import nushell from "nushell";

export const project = {
name: "seaweedfs",
version: "3.82",
};

const source = gitCheckout(
Brioche.gitRef({
repository: "https://github.com/seaweedfs/seaweedfs.git",
ref: project.version,
}),
);

export default function seaweedfs(): std.Recipe<std.Directory> {
return goBuild({
source,
path: "./weed",
runnable: "bin/weed",
});
}

export async function test() {
const recipe = std.runBash`
weed version | tee "$BRIOCHE_OUTPUT"
`.dependencies(seaweedfs());

const result = await recipe.toFile().read();
std.assert(result.includes(` ${project.version} `));

return recipe;
}

export async function autoUpdate() {
const src = std.file(std.indoc`
let version = http get https://api.github.com/repos/seaweedfs/seaweedfs/releases/latest
| get tag_name
$env.project | from json | update version $version | to json
`);

return std.withRunnable(std.directory(), {
command: "nu",
args: [src],
env: { project: JSON.stringify(project) },
dependencies: [nushell()],
});
}

0 comments on commit 6c55f89

Please sign in to comment.