Skip to content

Commit

Permalink
Merge branch 'main' into more_transformers
Browse files Browse the repository at this point in the history
  • Loading branch information
bomoko committed Feb 4, 2024
2 parents ff06b3d + 0e22dc5 commit 45bb25f
Show file tree
Hide file tree
Showing 39 changed files with 107,303 additions and 388 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/build_and_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
steps:
-
name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
-
name: Docker meta
id: meta
Expand All @@ -35,21 +35,21 @@ jobs:
-
name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Login to Docker Hub
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Build and push
uses: docker/build-push-action@v2
uses: docker/build-push-action@v5
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.idea
.env
internal/handler/testassets/bin/*
internal/handler/testassets/bin/*

9 changes: 7 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM golang:1.18-alpine3.15 as builder
FROM golang:1.21.4-alpine3.18 as builder

COPY . /go/src/github.com/uselagoon/lagoon/services/insights-handler/
WORKDIR /go/src/github.com/uselagoon/lagoon/services/insights-handler/
Expand All @@ -14,11 +14,16 @@ COPY main.go main.go
# Build
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o insights-handler main.go

# we pull the trivy binary from aquasec's alpine based image
FROM aquasec/trivy:0.48.0 as trivy

# Use distroless as minimal base image to package the insights-handler binary
# Refer to https://github.com/GoogleContainerTools/distroless for more details
#FROM gcr.io/distroless/static:nonroot

FROM alpine:3.15
FROM alpine:3.18

COPY --from=trivy /usr/local/bin/trivy /usr/local/bin/trivy

WORKDIR /
COPY --from=builder /go/src/github.com/uselagoon/lagoon/services/insights-handler/insights-handler .
Expand Down
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.PHONY: gettrivy
gettrivy:
mkdir -p internal/handler/testassets/bin/trivy/ && wget -O - https://github.com/aquasecurity/trivy/releases/download/v0.45.0/trivy_0.45.0_Linux-64bit.tar.gz | tar -zxvf - -C internal/handler/testassets/bin/trivy/


.PHONY: runlocal
runlocal:
go run main.go --problems-from-sbom=true --rabbitmq-username=guest --rabbitmq-password=guest --lagoon-api-host=http://localhost:8888/graphql --jwt-token-signing-key=secret --access-key-id=minio --secret-access-key=minio123 --disable-s3-upload=true --debug=true


2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ and push to the api and s3 bucket.
go run main.go \
-rabbitmq-username guest \
-rabbitmq-password guest \
-lagoon-api-host http://localhost:7070/graphql \
-lagoon-api-host http://localhost:8888/graphql \
--jwt-token-signing-key secret \
--access-key-id minio \
--secret-access-key minio123
Expand Down
44 changes: 25 additions & 19 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,54 +1,60 @@
module github.com/uselagoon/lagoon/services/insights-handler

go 1.18
go 1.21

require (
github.com/Khan/genqlient v0.3.0
github.com/Khan/genqlient v0.6.0
github.com/cheshir/go-mq v1.0.2
github.com/dgrijalva/jwt-go v3.2.0+incompatible
github.com/joho/godotenv v1.5.1
github.com/matryer/try v0.0.0-20161228173917-9ac251b645a2
github.com/stretchr/testify v1.8.4
gopkg.in/yaml.v1 v1.0.0-20140924161607-9f9df34309c0
)

require (
github.com/NeowayLabs/wabbit v0.0.0-20200409220312-12e68ab5b0c6 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dustin/go-humanize v1.0.0 // indirect
github.com/google/uuid v1.1.2 // indirect
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/jtolds/gls v4.20.0+incompatible // indirect
github.com/klauspost/compress v1.13.5 // indirect
github.com/klauspost/compress v1.16.5 // indirect
github.com/klauspost/cpuid v1.3.1 // indirect
github.com/klauspost/cpuid/v2 v2.0.4 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/minio/md5-simd v1.1.0 // indirect
github.com/minio/sha256-simd v0.1.1 // indirect
github.com/minio/sha256-simd v1.0.0 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/moby/sys/mount v0.3.3 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/pborman/uuid v1.2.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/rogpeppe/go-internal v1.10.0 // indirect
github.com/rs/xid v1.2.1 // indirect
github.com/sirupsen/logrus v1.8.1 // indirect
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d // indirect
github.com/sirupsen/logrus v1.9.0 // indirect
github.com/streadway/amqp v0.0.0-20200108173154-1c71cc93ed71 // indirect
github.com/stretchr/objx v0.5.0 // indirect
github.com/vektah/gqlparser/v2 v2.1.0 // indirect
golang.org/x/crypto v0.0.0-20201216223049-8b5274cf687f // indirect
golang.org/x/sys v0.0.0-20211019181941-9d821ace8654 // indirect
golang.org/x/text v0.3.7 // indirect
gopkg.in/ini.v1 v1.57.0 // indirect
github.com/vektah/gqlparser/v2 v2.5.10 // indirect
golang.org/x/crypto v0.16.0 // indirect
golang.org/x/sys v0.15.0 // indirect
golang.org/x/text v0.14.0 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
)

replace (
github.com/docker/cli => github.com/docker/cli v20.10.19+incompatible
github.com/docker/docker => github.com/docker/docker v20.10.19+incompatible
)

require (
github.com/CycloneDX/cyclonedx-go v0.4.0
github.com/CycloneDX/cyclonedx-go v0.7.2-0.20230625092137-07e2f29defc3
github.com/cheekybits/is v0.0.0-20150225183255-68e9c0620927 // indirect
github.com/fsouza/go-dockerclient v1.7.3 // indirect
github.com/minio/minio-go/v7 v7.0.21
github.com/tiago4orion/conjure v0.0.0-20150908101743-93cb30b9d218 // indirect
golang.org/x/net v0.0.0-20211216030914-fe4d6282115f // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
golang.org/x/net v0.19.0 // indirect
gopkg.in/yaml.v3 v3.0.1
)

// Fixes for AppID
Expand Down
Loading

0 comments on commit 45bb25f

Please sign in to comment.