Skip to content

Commit

Permalink
feat: add k9s package (brioche-dev#56)
Browse files Browse the repository at this point in the history
* feat: Add buildParams and packagePath options to GoBuildOptions interface

The commit adds new options to the `GoBuildOptions` interface in the `go` package. The `buildParams` option allows specifying build parameters such as running `go generate` before building and passing ldflags to the `go install` command. The `packagePath` option allows setting the package path to build. This change enhances the flexibility and customization of the `goInstall` function.

Signed-off-by: jaudiger <[email protected]>

* feat: Add ldflagsWrapper function for escaping ldflags in shell commands and prefer to use env var when possible

Signed-off-by: jaudiger <[email protected]>

* feat: Add k9s package

This commit adds the `brioche.lock` and `project.bri` files for the `k9s` package.

Signed-off-by: jaudiger <[email protected]>

* chore: Update ldflags in K9s project.bri file

Signed-off-by: jaudiger <[email protected]>

---------

Signed-off-by: jaudiger <[email protected]>
  • Loading branch information
jaudiger authored Jul 11, 2024
1 parent 2591537 commit 8f3d789
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/k9s/brioche.lock

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

33 changes: 33 additions & 0 deletions packages/k9s/project.bri
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import * as std from "std";
import { goInstall } from "go";

export const project = {
name: "k9s",
version: "0.32.5",
};
const gitCommit = "1440643e8d1a101a38d9be1933131ddf5c863940";

const goModule = std
.download({
url: `https://github.com/derailed/k9s/archive/refs/tags/v${project.version}.tar.gz`,
hash: std.sha256Hash(
"e011697b3de99d7691119036eaae6e5d4f1a98e284755ab6b15ae6daba08595f",
),
})
.unarchive("tar", "gzip")
.peel();

export default () => {
return goInstall({
goModule,
buildParams: {
ldflags: [
"-s",
"-w",
`-X github.com/derailed/k9s/cmd.version=${project.version}`,
`-X github.com/derailed/k9s/cmd.commit=${gitCommit}`,
],
},
runnable: "bin/k9s",
});
};

0 comments on commit 8f3d789

Please sign in to comment.