Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
nick-jones committed Jul 12, 2024
0 parents commit 7b9fdda
Show file tree
Hide file tree
Showing 17 changed files with 1,082 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/merge-master.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Build and push Docker image

on:
push:
branches:
- master

jobs:
push:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Login to Quay
uses: docker/login-action@v3
with:
registry: quay.io
username: ${{ vars.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Set up Docker BuildX
uses: docker/setup-buildx-action@v3
with:
version: v0.11.2

- name: Restore build cache
uses: actions/cache@v3
with:
path: /tmp/.buildx-${{ github.ref_name }}-cache
key: ${{ runner.os }}-buildx-${{ github.ref_name }}
restore-keys: |
${{ runner.os }}-buildx-${{ github.ref_name }}
- name: Build and push
run: |
make push
env:
BRANCH_NAME: ${{ github.ref_name }}
RELEASE_ID: ${{ github.run_number }}
GIT_HASH: ${{ github.sha }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/config
14 changes: 14 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM golang:1.22-bookworm AS build
WORKDIR /app

COPY go.mod ./
COPY go.sum ./
RUN go mod download

COPY ./ ./
RUN CGO_ENABLED=0 go build -ldflags="-s -w" -o /fluxcd-suspend-notifier .

FROM gcr.io/distroless/base-debian12
WORKDIR /
COPY --from=build fluxcd-suspend-notifier /fluxcd-suspend-notifier
ENTRYPOINT [ "/fluxcd-suspend-notifier" ]
18 changes: 18 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
DOCKER_REPOSITORY ?= quay.io/road
BRANCH_NAME ?= $(shell git rev-parse --abbrev-ref HEAD)
GIT_HASH ?= $(shell git rev-parse HEAD)
RELEASE_ID ?= $(shell id -un)-local
DOCKER_LATEST_TAG ?= latest

build:
docker buildx build \
--cache-from type=local,src=/tmp/.buildx-$(BRANCH_NAME)-fluxcd-suspend-notifier-cache \
--cache-to type=local,mode=max,dest=/tmp/.buildx-$(BRANCH_NAME)-fluxcd-suspend-notifier-cache \
--provenance mode=min,inline-only=true \
--tag $(DOCKER_REPOSITORY)/fluxcd-suspend-notifier:$(GIT_HASH) \
--tag $(DOCKER_REPOSITORY)/fluxcd-suspend-notifier:$(DOCKER_LATEST_TAG) \
--tag $(DOCKER_REPOSITORY)/fluxcd-suspend-notifier:release-$(RELEASE_ID) \
--push \
.

push: build
83 changes: 83 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
module github.com/e-flux-platform/fluxcd-suspend-notifier

go 1.22.3

require (
cloud.google.com/go/logging v1.10.0
github.com/dgraph-io/badger/v4 v4.2.0
github.com/expr-lang/expr v1.16.9
google.golang.org/genproto v0.0.0-20240708141625-4ad9e859172b
gopkg.in/yaml.v3 v3.0.1
k8s.io/client-go v0.30.2
)

require (
cloud.google.com/go v0.115.0 // indirect
cloud.google.com/go/auth v0.6.1 // indirect
cloud.google.com/go/auth/oauth2adapt v0.2.2 // indirect
cloud.google.com/go/compute/metadata v0.3.0 // indirect
cloud.google.com/go/iam v1.1.10 // indirect
cloud.google.com/go/longrunning v0.5.9 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dgraph-io/ristretto v0.1.1 // indirect
github.com/dustin/go-humanize v1.0.0 // indirect
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/go-logr/logr v1.4.1 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-openapi/jsonpointer v0.19.6 // indirect
github.com/go-openapi/jsonreference v0.20.2 // indirect
github.com/go-openapi/swag v0.22.3 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/glog v1.2.0 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/flatbuffers v1.12.1 // indirect
github.com/google/gnostic-models v0.6.8 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/s2a-go v0.1.7 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect
github.com/googleapis/gax-go/v2 v2.12.5 // indirect
github.com/imdario/mergo v0.3.6 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/compress v1.12.3 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/spf13/pflag v1.0.5 // indirect
go.opencensus.io v0.24.0 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 // indirect
go.opentelemetry.io/otel v1.24.0 // indirect
go.opentelemetry.io/otel/metric v1.24.0 // indirect
go.opentelemetry.io/otel/trace v1.24.0 // indirect
golang.org/x/crypto v0.24.0 // indirect
golang.org/x/net v0.26.0 // indirect
golang.org/x/oauth2 v0.21.0 // indirect
golang.org/x/sync v0.7.0 // indirect
golang.org/x/sys v0.21.0 // indirect
golang.org/x/term v0.21.0 // indirect
golang.org/x/text v0.16.0 // indirect
golang.org/x/time v0.5.0 // indirect
google.golang.org/api v0.187.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240701130421-f6361c86f094 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094 // indirect
google.golang.org/grpc v1.64.1 // indirect
google.golang.org/protobuf v1.34.2 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
k8s.io/api v0.30.2 // indirect
k8s.io/apimachinery v0.30.2 // indirect
k8s.io/klog/v2 v2.120.1 // indirect
k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 // indirect
k8s.io/utils v0.0.0-20230726121419-3b25d923346b // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
)
Loading

0 comments on commit 7b9fdda

Please sign in to comment.