Skip to content

Commit

Permalink
feat: packaging
Browse files Browse the repository at this point in the history
  • Loading branch information
mrtdeh committed Nov 4, 2023
1 parent e5f776f commit c43ce00
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bin
22 changes: 22 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
EXECUTABLE=logrator
VERSION=$(shell git describe --tags --always --abbrev=0)


.PHONY: all test clean

all: test build

test:
go test ./...

build: clean
go build -v -o bin/$(EXECUTABLE) -ldflags="-s -w -X main.version=$(VERSION)" ./main.go


deb: build
VERSION=$(VERSION) nfpm pkg --packager deb --target ./bin/ -f ./packaging/nfpm.yml



clean:
rm -f ./bin/*
1 change: 1 addition & 0 deletions packaging/debian/postinst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

26 changes: 26 additions & 0 deletions packaging/nfpm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: "logrator"
arch: "amd64"
platform: "linux"
version: ${VERSION}
section: "default"
priority: "extra"

maintainer: "SIEM FARZAN"

contents:
- src: ./bin/logrator
dst: /usr/share/logrator/logrator
file_info:
mode: 0655
- src: /usr/share/logrator/logrator
dst: /usr/bin/logrator
type: symlink
- src: ./Logs
dst: /usr/share/logrator/Logs
- src: ./sources.json
dst: /usr/share/logrator/sources.json



scripts:
postinstall: ./packaging/debian/postinst
Binary file removed testeps
Binary file not shown.

0 comments on commit c43ce00

Please sign in to comment.