Skip to content

Commit

Permalink
fix: add missing goreleaser file (#1179)
Browse files Browse the repository at this point in the history
  • Loading branch information
gfyrag authored Feb 2, 2024
1 parent 86998d6 commit 1ef0986
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 5 deletions.
39 changes: 39 additions & 0 deletions components/operator/.goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
project_name: operator
includes:
- from_file:
path: ./../../.goreleaser.default.yaml

monorepo:
tag_prefix: v
dir: ./

builds:
- binary: operator
id: operator
ldflags:
- -X github.com/formancehq/operator/cmd.BuildDate={{ .Date }}
- -X github.com/formancehq/operator/cmd.Version={{ .Version }}
- -X github.com/formancehq/operator/cmd.Commit={{ .ShortCommit }}
- -extldflags "-static"
env:
- CGO_ENABLED=0
goos:
- linux
goarch:
- amd64
- arm64

archives:
- id: "{{.ProjectName}}"
builds:
- operator
format: tar.gz
name_template: "{{.ProjectName}}_{{.Os}}-{{.Arch}}"


release:
prerelease: auto
footer: |
## What to do next?
- Read the [documentation](https://docs.formance.com/)
- Join our [Slack server](https://formance.com/slack)
5 changes: 2 additions & 3 deletions components/operator/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ sources:
COPY (stack+sources/out --LOCATION=ee/search) ee/search
COPY (stack+sources/out --LOCATION=libs/go-libs) libs/go-libs
WORKDIR /src/components/operator
COPY --dir api internal cmd pkg .
COPY --dir api internal pkg .
COPY go.* .
SAVE ARTIFACT /src

compile:
FROM core+builder-image
COPY (+sources/*) /src
COPY --pass-args (+generate/*) /src/components/operator
WORKDIR /src/components/operator/cmd
WORKDIR /src/components/operator
DO --pass-args core+GO_COMPILE

build-image:
Expand Down Expand Up @@ -104,7 +104,6 @@ lint:
DO --pass-args stack+GO_LINT
SAVE ARTIFACT api AS LOCAL api
SAVE ARTIFACT internal AS LOCAL internal
SAVE ARTIFACT cmd AS LOCAL cmd

tests:
FROM core+builder-image
Expand Down
4 changes: 2 additions & 2 deletions components/operator/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,11 @@ lint-fix: golangci-lint ## Run golangci-lint linter and perform fixes

.PHONY: build
build: manifests generate fmt vet ## Build manager binary.
go build -o bin/manager cmd/main.go
go build -o bin/manager main.go

.PHONY: run
run: manifests generate fmt vet ## Run a controller from your host.
go run ./cmd/main.go
go run ./main.go

# If you wish to build the manager image targeting other platforms you can use the --platform flag.
# (i.e. docker build --platform linux/arm64). However, you must enable docker buildKit for it.
Expand Down
4 changes: 4 additions & 0 deletions components/operator/build.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM ghcr.io/formancehq/base:22.04
COPY operator /usr/bin/operator
ENV OTEL_SERVICE_NAME operator
ENTRYPOINT ["/usr/bin/operator"]
File renamed without changes.

0 comments on commit 1ef0986

Please sign in to comment.