Skip to content

Commit

Permalink
Merge pull request #32 from bjoern-reetz/add-trivy-plugin
Browse files Browse the repository at this point in the history
feat: add plugin for Trivy
  • Loading branch information
suin authored Dec 6, 2024
2 parents a94ea8f + 9f20bf2 commit 649e470
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 0 deletions.
21 changes: 21 additions & 0 deletions trivy/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Trivy plugin

[Trivy](https://aquasecurity.github.io/trivy) plugin for [proto](https://github.com/moonrepo/proto).

## Installation

This is a community plugin and is thus not built-in to proto. In order to use it, first either add it to your global or project-based `.prototools` by running:

### Global install

```shell
proto plugin add trivy "source:https://raw.githubusercontent.com/appthrust/proto-toml-plugins/main/trivy/plugin.toml" --global
proto install trivy
```

### Per-project install

```shell
proto plugin add trivy "source:https://raw.githubusercontent.com/appthrust/proto-toml-plugins/main/trivy/plugin.toml"
proto pin trivy latest --resolve
```
8 changes: 8 additions & 0 deletions trivy/plugin.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { run } from "../testkit.js";

run({
name: "trivy",
afterInstall: async ($) => {
await $`trivy --version`;
},
});
27 changes: 27 additions & 0 deletions trivy/plugin.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# A TOML plugin for Trivy:
# https://moonrepo.dev/docs/proto/toml-plugin

name = "Trivy"
type = "cli"

[platform.freebsd]
download-file = "trivy_{version}_FreeBSD-{arch}.tar.gz"

[platform.linux]
download-file = "trivy_{version}_Linux-{arch}.tar.gz"

[platform.macos]
download-file = "trivy_{version}_macOS-{arch}.tar.gz"

[install]
checksum-url = "https://github.com/aquasecurity/trivy/releases/download/v{version}/trivy_{version}_checksums.txt"
download-url = "https://github.com/aquasecurity/trivy/releases/download/v{version}/{download_file}"

[install.arch]
x86 = "36bit"
x86_64 = "64bit"
arm = "ARM"
aarch64 = "ARM64"

[resolve]
git-url = "https://github.com/aquasecurity/trivy"

0 comments on commit 649e470

Please sign in to comment.