-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: build infrastructure for go fix(ci): fix the build
- Loading branch information
1 parent
625d815
commit 23f83af
Showing
55 changed files
with
165 additions
and
15,922 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,4 +20,6 @@ config-auth.json | |
.DS_Store | ||
|
||
.idea | ||
*.iml | ||
*.iml | ||
|
||
eltako-to-mqtt-gw |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Build the application from source | ||
FROM golang:1.22 AS build-stage | ||
|
||
WORKDIR /app | ||
|
||
COPY go.mod go.sum ./ | ||
RUN go mod download | ||
|
||
COPY . ./ | ||
|
||
RUN CGO_ENABLED=0 GOOS=linux go build -o /eltako-to-mqtt-gw | ||
|
||
# Run the tests in the container | ||
FROM build-stage AS run-test-stage | ||
RUN go test -v ./... | ||
|
||
# Deploy the application binary into a lean image | ||
FROM gcr.io/distroless/base-debian11 AS build-release-stage | ||
|
||
WORKDIR / | ||
|
||
COPY --from=build-stage /eltako-to-mqtt-gw /eltako-to-mqtt-gw | ||
|
||
USER nonroot:nonroot | ||
|
||
ENTRYPOINT ["/eltako-to-mqtt-gw", "/var/lib/eltako-to-mqtt-gw/config.json"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Makefile for Go application | ||
|
||
# Set the Go binary and flags | ||
GO = go | ||
GOFLAGS = -v | ||
|
||
# Set the paths | ||
BUILD_DIR = build | ||
CONFIG_DIR = $(PWD)/../production/config | ||
|
||
# Set the binary name | ||
BINARY_NAME = eltako-to-mqtt-gw | ||
DOCKER_IMAGE_NAME = pharndt/eltako:latest | ||
|
||
.PHONY: build | ||
build: | ||
@echo "Building the application..." | ||
@$(GO) build $(GOFLAGS) -o $(BUILD_DIR)/$(BINARY_NAME) . | ||
|
||
.PHONY: run | ||
run: build | ||
@echo "Running the application..." | ||
@$(BUILD_DIR)/$(BINARY_NAME) $(CONFIG_DIR)/config.json | ||
|
||
.PHONY: docker | ||
docker: build | ||
@echo "Building Docker image..." | ||
@docker build -t $(DOCKER_IMAGE_NAME) . | ||
|
||
.PHONY: clean | ||
clean: | ||
@echo "Cleaning up..." | ||
@rm -rf $(BUILD_DIR) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
module github.com/mqtt-home/eltako-to-mqtt-gw | ||
|
||
go 1.22.2 | ||
|
||
require ( | ||
github.com/philipparndt/go-logger v1.0.0 | ||
github.com/philipparndt/mqtt-gateway v1.3.0 | ||
) | ||
|
||
require ( | ||
github.com/eclipse/paho.mqtt.golang v1.5.0 // indirect | ||
github.com/gorilla/websocket v1.5.3 // indirect | ||
golang.org/x/net v0.30.0 // indirect | ||
golang.org/x/sync v0.8.0 // indirect | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
github.com/eclipse/paho.mqtt.golang v1.5.0 h1:EH+bUVJNgttidWFkLLVKaQPGmkTUfQQqjOsyvMGvD6o= | ||
github.com/eclipse/paho.mqtt.golang v1.5.0/go.mod h1:du/2qNQVqJf/Sqs4MEL77kR8QTqANF7XU7Fk0aOTAgk= | ||
github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg= | ||
github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= | ||
github.com/philipparndt/go-logger v1.0.0 h1:5khKl1q8q6FH74S1wF5KPl6DvdZnRdPKqKbBPQDr9P4= | ||
github.com/philipparndt/go-logger v1.0.0/go.mod h1:4mWf8eNH82GhKl5byAFwXcux9WPNuaePaPaAFbgjHXg= | ||
github.com/philipparndt/mqtt-gateway v1.3.0 h1:QeJ0XIEnlzH4Qm7vqAQN3WTrI45UcPxlcQFcTrCXvn8= | ||
github.com/philipparndt/mqtt-gateway v1.3.0/go.mod h1:N6LC57xFs/u41Xc5csPHTACm/00GyOyMgIC+oOqp32Y= | ||
golang.org/x/net v0.30.0 h1:AcW1SDZMkb8IpzCdQUaIq2sP4sZ4zw+55h6ynffypl4= | ||
golang.org/x/net v0.30.0/go.mod h1:2wGyMJ5iFasEhkwi13ChkO/t1ECNC4X4eBKkVFyYFlU= | ||
golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= | ||
golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.