+cnquery.io (#4767)

* new file:   projects/cnquery.io/package.yml

* fix it

* use go version from go.mod

---------

Co-authored-by: Michael Essiet <emsaa2002@gmail.com>
Co-authored-by: Jacob Heider <jacob@pkgx.dev>
This commit is contained in:
Andrew 2024-01-08 20:18:13 +02:00 committed by GitHub
parent 005c13f2e8
commit cd963ef66a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -0,0 +1,31 @@
distributable:
url: https://github.com/mondoohq/cnquery/archive/refs/tags/v{{version}}.tar.gz
strip-components: 1
versions:
github: mondoohq/cnquery
build:
dependencies:
go.dev: ~1.21
script:
- go build $ARGS -ldflags="$LD_FLAGS" ./apps/cnquery/cnquery.go
env:
LD_FLAGS:
- -s
- -w
linux:
LD_FLAGS:
- -buildmode=pie
ARGS:
- -v
- -trimpath
- -o={{prefix}}/bin/cnquery
provides:
- bin/cnquery
test:
dependencies:
curl.se: '*'
script:
- cnquery run -c "ports.listening { port process }"
- curl -L "https://raw.githubusercontent.com/mondoohq/cnquery/main/examples/complex.mql.yaml" -o complex.mql.yaml
- curl -L "https://raw.githubusercontent.com/mondoohq/cnquery/main/examples/example-os.mql.yaml" -o example-os.mql.yaml
- cnquery scan -f complex.mql.yaml | grep 'Summary (1 assets)'