Skip to content

Commit

Permalink
ci
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexey Kolesnikov committed Feb 7, 2025
1 parent 9e97da7 commit 6045ef7
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 deletions.
18 changes: 12 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,18 @@ jobs:
run: go test -v ./...
- name: Vet
run: go vet ./...
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags:
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- name: Build
run: go build -o zabbix-http
run: go build -ldflags "-X 'main.version=${{ steps.meta.outputs.tags }}'" -o zabbix-http
- name: Log into registry ${{ env.REGISTRY }}
uses: docker/login-action@v1
with:
Expand All @@ -28,11 +38,7 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Docker buildx
uses: docker/setup-buildx-action@v3
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: show files
run: ls -lha
- uses: "marvinpinto/action-automatic-releases@latest"
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ To send data you should make http Get request with these query parameters: ["ser
```bash
docker run --name zabbix-sender-http -d \
-p 3001:8080 \
-e ZABBIX_SERVER="zabbix-server-pgsql" \
-e ZABBIX_HOST="zabbix-server-pgsql" \
--restart always \
--network postgres_network \
ghcr.io/0xdeface/zabbix-sender:latest
Expand All @@ -37,7 +37,7 @@ The table bellow shows possible launch parameters and their priority.
| Highest priority | Middle priority | Lowest priority | Description |
|-------------------|-------------------|-----------------------|---------------------------|
| **Cmd arguments** | **Env variables** | **Predefined values** | |
| --zabbix-host | ZABBIX_host | 127.0.0.1 | set zabbix server address |
| --zabbix-host | ZABBIX_HOST | 127.0.0.1 | set zabbix server address |
| --zabbix-port | ZABBIX_PORT | 10051 | set zabbix server port |
| --http-port | HTTP_PORT | 8080 | http server port |

Expand Down
4 changes: 3 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ import (
"zabbix-http/internal/http"
)

var version = ""

func main() {
cfg := config.GetConfig()
if cfg.Debug {
fmt.Printf("\n App started with params:\n %+v\n", cfg)
fmt.Printf("\n App %v started with params:\n %+v\n", version, cfg)
}
errCh := make(chan error, 10)
zabbixSender := zabbix.NewZabbixSender(cfg.ZabbixHost, cfg.ZabbixPort)
Expand Down

0 comments on commit 6045ef7

Please sign in to comment.