From 60146417d530eb8ba6073e6d7203fea0a73cab01 Mon Sep 17 00:00:00 2001 From: mtardy Date: Thu, 21 Apr 2022 12:17:41 +0200 Subject: [PATCH] Add a release rule in the Makefile --- .gitignore | 1 + CHANGELOG.md | 15 ++++++++------- Makefile | 10 ++++++++++ 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 31ae25e..a01da21 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ kdigger +release/ .vagrant vm_ssh_config diff --git a/CHANGELOG.md b/CHANGELOG.md index dcc9d10..3fe6350 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,18 +3,19 @@ ## `1.1.0` - 2022-04-21 ### Added - Two new plugins, cgroups, and node and checks for NoNewPrivs and Seccomp flag -in respectively, capabilities and syscall plugins. (Thanks for Andrew Martin & -Michael Hausenblas for the inspiration from the Appendix 1 "A Pod-Level Attack" -from the "Hacking Kubernetes" book) + in respectively, capabilities and syscall plugins. (Thanks for Andrew Martin + & Michael Hausenblas for the inspiration from the Appendix 1 "A Pod-Level + Attack" from the "Hacking Kubernetes" book) - Documentation about the Wildcard feature removal in CoreDNS. -- New Makefiles rules to quickly start kdigger in a Pod in a kind cluster. +- New Makefiles rules to quickly start kdigger in a Pod in a kind cluster and + to make a release. - Vagrantfile for development on different systems. ### Changed - Update dependencies and use Go 1.18. - Fix the `got get` oneliner using `go install`. -- The output mechanism for plugins, now using comments array and flatten results -that are of length one for better JSON output parsing. +- The output mechanism for plugins, now using comments array and flatten + results that are of length one for better JSON output parsing. ## `1.0.0` - 2021-10-07 -- Initial release! \ No newline at end of file +- Initial release! diff --git a/Makefile b/Makefile index 4856fab..c4fbaf6 100644 --- a/Makefile +++ b/Makefile @@ -6,6 +6,9 @@ ARCH=$$(uname -m) OUTPUTNAME=kdigger +RELEASE_NAME=kdigger-linux-amd64 +RELEASE_FOLDER=release + # building for linux/amd64, if you want to build for arm64 you will have to # adapt the syscall part that doesn't compile out of the box right now GOOS=linux @@ -33,6 +36,13 @@ fast-build: lint: golangci-lint run +release: build + mkdir $(RELEASE_FOLDER) + mv kdigger $(RELEASE_FOLDER)/$(RELEASE_NAME) + cd $(RELEASE_FOLDER) \ + && sha256sum $(RELEASE_NAME) > $(RELEASE_NAME).sha256 \ + && tar cvf - $(RELEASE_NAME) | gzip -9 - > $(RELEASE_NAME).tar.gz + DEV_IMAGE_TAG=mtardy/kdigger-dev .PHONY: run run: fast-build