Skip to content

Commit

Permalink
Merge pull request #299 from Templum/develop
Browse files Browse the repository at this point in the history
🔀 Merging latest changes from Develop into v1
  • Loading branch information
Templum committed Jan 11, 2023
2 parents 6b381c3 + 32a04f3 commit a9e3668
Show file tree
Hide file tree
Showing 10 changed files with 195 additions and 723 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.231.6/containers/go/.devcontainer/base.Dockerfile

# [Choice] Go version (use -bullseye variants on local arm64/Apple Silicon): 1, 1.16, 1.17, 1-bullseye, 1.16-bullseye, 1.17-bullseye, 1-buster, 1.16-buster, 1.17-buster
ARG VARIANT="1.18-bullseye"
ARG VARIANT="1.19-bullseye"
FROM mcr.microsoft.com/vscode/devcontainers/go:0-${VARIANT}

# [Choice] Node.js version: none, lts/*, 16, 14, 12, 10
Expand Down
11 changes: 7 additions & 4 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.231.6/containers/go
{
"name": "Go",
"name": "Rabbit MQ Dev",
"build": {
"dockerfile": "Dockerfile",
"args": {
// Update the VARIANT arg to pick a version of Go: 1, 1.18, 1.17
// Append -bullseye or -buster to pin to an OS version.
// Use -bullseye variants on local arm64/Apple Silicon.
"VARIANT": "1.18-bullseye",
"VARIANT": "1.19-bullseye",
// Options
"NODE_VERSION": "none"
}
Expand Down Expand Up @@ -37,8 +37,11 @@
"[go]": {
"editor.codeActionsOnSave": {
"source.organizeImports": true
},
},
}
}
},
"features": {
"ghcr.io/devcontainers/features/docker-in-docker": "latest"
},
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
Expand Down
12 changes: 7 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.18
go-version: 1.19
cache: true

- name: Build
run: go build -v ./...
Expand All @@ -74,7 +75,7 @@ jobs:
uses: golangci/golangci-lint-action@v3
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: v1.45.2
version: v1.49.0
# Optional: show only new issues if it's a pull request. The default value is `false`.
only-new-issues: true
integration:
Expand Down Expand Up @@ -102,10 +103,11 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.18
go-version: 1.19
cache: true

- name: K8S Cluster Setup
uses: helm/kind-action@v1.2.0
uses: helm/kind-action@v1.5.0

- name: Get Arkade
run: curl -sLS https://get.arkade.dev | sudo sh
Expand All @@ -114,7 +116,7 @@ jobs:
run: ark get faas-cli && sudo mv /home/runner/.arkade/bin/faas-cli /usr/local/bin/

- name: Setup OpenFaaS
run: ark install openfaas --basic-auth=false
run: ark install openfaas --basic-auth=false --set faasnetes.image=ghcr.io/openfaas/faas-netes:0.16.1 --set gateway.image=ghcr.io/openfaas/gateway:0.25.5

- name: Await OpenFaaS Port
run: kubectl -n openfaas wait --for=condition=available --timeout=600s deploy/gateway
Expand Down
18 changes: 13 additions & 5 deletions .github/workflows/code-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ on:
branches: [develop]
schedule:
- cron: "0 22 * * 3"

permissions:
security-events: write
jobs:
code:
name: Analyse
name: Analyse Code
runs-on: ubuntu-latest

strategy:
Expand All @@ -33,8 +34,16 @@ jobs:

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
golang:
name: Analyse Vulnerabilities
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Running govulncheck
uses: Templum/govulncheck-action@v0.0.8
docker:
name: Analyse
name: Analyse Container
runs-on: ubuntu-latest
steps:
- name: Checkout code
Expand All @@ -47,8 +56,7 @@ jobs:
uses: aquasecurity/trivy-action@master
with:
image-ref: "templum/rabbitmq-connector:${{ github.sha }}"
format: "template"
template: "@/contrib/sarif.tpl"
format: 'sarif'
output: "trivy-results.sarif"

- name: Upload Trivy scan results to GitHub Security tab
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,30 +29,30 @@ jobs:
type=ref,event=branch,pattern={{branch}}
- name: Set up QEMU
uses: docker/setup-qemu-action@v2.0.0
uses: docker/setup-qemu-action@v2.1.0

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2.0.0
uses: docker/setup-buildx-action@v2.2.1

- name: Available platforms
run: echo ${{ steps.buildx.outputs.platforms }}

- name: Login to Docker Hub
uses: docker/login-action@v2.0.0
uses: docker/login-action@v2.1.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Login to GitHub Container Registry
uses: docker/login-action@v2.0.0
uses: docker/login-action@v2.1.0
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.CR_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v3.0.0
uses: docker/build-push-action@v3.2.0
with:
context: .
file: ./Dockerfile
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.18.1-alpine as base_builder
FROM golang:1.19.4-alpine as base_builder

RUN apk --no-cache add ca-certificates git

Expand All @@ -19,7 +19,7 @@ RUN VERSION=$(git describe --all --exact-match $(git rev-parse HEAD) | grep tags
-X github.com/Templum/rabbitmq-connector/pkg/version.GitCommit=${GIT_COMMIT}" \
-a -installsuffix cgo -o rmq-connector .

FROM alpine:3.15.4
FROM alpine:3.17.0

RUN addgroup -S app \
&& adduser -S -g app app \
Expand Down
111 changes: 55 additions & 56 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,56 +1,55 @@
module github.com/Templum/rabbitmq-connector

require (
github.com/docker/go-connections v0.4.0
github.com/openfaas/connector-sdk v0.0.0-20201220114541-89f0ffcc5448
github.com/openfaas/faas-provider v0.18.9
github.com/pkg/errors v0.9.1
github.com/spf13/afero v1.8.2
github.com/streadway/amqp v1.0.0
github.com/stretchr/testify v1.7.1
github.com/testcontainers/testcontainers-go v0.13.0
github.com/valyala/fasthttp v1.36.0
go.uber.org/automaxprocs v1.5.1
gopkg.in/yaml.v2 v2.4.0
)

require (
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
github.com/Microsoft/go-winio v0.4.17 // indirect
github.com/Microsoft/hcsshim v0.8.23 // indirect
github.com/andybalholm/brotli v1.0.4 // indirect
github.com/cenkalti/backoff/v4 v4.1.2 // indirect
github.com/containerd/cgroups v1.0.1 // indirect
github.com/containerd/containerd v1.5.9 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/docker/distribution v2.7.1+incompatible // indirect
github.com/docker/docker v20.10.11+incompatible // indirect
github.com/docker/go-units v0.4.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/klauspost/compress v1.15.0 // indirect
github.com/magiconair/properties v1.8.5 // indirect
github.com/moby/sys/mount v0.2.0 // indirect
github.com/moby/sys/mountinfo v0.5.0 // indirect
github.com/moby/term v0.0.0-20210619224110-3f7ff695adc6 // indirect
github.com/morikuni/aec v0.0.0-20170113033406-39771216ff4c // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.0.2 // indirect
github.com/opencontainers/runc v1.0.2 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/sirupsen/logrus v1.8.1 // indirect
github.com/stretchr/objx v0.2.0 // indirect
github.com/valyala/bytebufferpool v1.0.0 // indirect
go.opencensus.io v0.22.5 // indirect
golang.org/x/net v0.0.0-20220225172249-27dd8689420f // indirect
golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9 // indirect
golang.org/x/text v0.3.7 // indirect
google.golang.org/genproto v0.0.0-20210226172003-ab064af71705 // indirect
google.golang.org/grpc v1.35.0 // indirect
google.golang.org/protobuf v1.27.1 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
)

go 1.18
module github.com/Templum/rabbitmq-connector

go 1.19

require (
github.com/docker/go-connections v0.4.0
github.com/openfaas/connector-sdk v0.0.0-20201220114541-89f0ffcc5448
github.com/openfaas/faas-provider v0.19.1
github.com/pkg/errors v0.9.1
github.com/spf13/afero v1.9.3
github.com/streadway/amqp v1.0.0
github.com/stretchr/testify v1.8.1
github.com/testcontainers/testcontainers-go v0.17.0
github.com/valyala/fasthttp v1.44.0
go.uber.org/automaxprocs v1.5.1
gopkg.in/yaml.v2 v2.4.0
)

require (
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
github.com/Microsoft/go-winio v0.5.2 // indirect
github.com/andybalholm/brotli v1.0.4 // indirect
github.com/cenkalti/backoff/v4 v4.2.0 // indirect
github.com/containerd/containerd v1.6.12 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/docker/distribution v2.8.1+incompatible // indirect
github.com/docker/docker v20.10.20+incompatible // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/klauspost/compress v1.15.9 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/moby/patternmatcher v0.5.0 // indirect
github.com/moby/sys/sequential v0.5.0 // indirect
github.com/moby/term v0.0.0-20221128092401-c43b287e0e0f // indirect
github.com/morikuni/aec v1.0.0 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.1.0-rc2 // indirect
github.com/opencontainers/runc v1.1.4 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/sirupsen/logrus v1.9.0 // indirect
github.com/stretchr/objx v0.5.0 // indirect
github.com/valyala/bytebufferpool v1.0.0 // indirect
golang.org/x/net v0.5.0 // indirect
golang.org/x/sys v0.4.0 // indirect
golang.org/x/text v0.6.0 // indirect
google.golang.org/genproto v0.0.0-20220617124728-180714bec0ad // indirect
google.golang.org/grpc v1.47.0 // indirect
google.golang.org/protobuf v1.28.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

replace github.com/docker/docker => github.com/docker/docker v20.10.3-0.20221013203545-33ab36d6b304+incompatible // 22.06 branch

0 comments on commit a9e3668

Please sign in to comment.