feat(makefile): updating Makefile with cadoles methods.
All checks were successful
Cadoles/hydra-werther/pipeline/head This commit looks good
Cadoles/hydra-werther/pipeline/pr-develop This commit looks good

Adding Docker image release and build rules
Updating nfpm packaging methods.
This commit is contained in:
2023-09-05 10:17:45 +02:00
parent 194c1864c4
commit 77bb3ba59b
3 changed files with 107 additions and 20 deletions

View File

@ -1,23 +1,17 @@
##################################################
# Makefile for Cadoles Kubernetes Skeletor project
##################################################
COMMIT_ID ?= $(shell git rev-parse --short --verify HEAD)
CURRENT_BRANCH ?= $(shell git rev-parse --abbrev-ref HEAD | tr -c '[:alnum:]\n\r' '_'| tr '[:upper:]' '[:lower:]')
IMAGE_REPO ?= reg.cadoles.com/cadoles
IMAGE_VERSION ?= 1.2.2-$(CURRENT_BRANCH)
IMAGES_DIR := .
PACKAGE_VERSION ?= $(shell git describe --always | rev | cut -d '/' -f 1 | rev)
NFPM_PACKAGER ?= deb
build: clean generate
CGO_ENABLED=0 misc/script/build
generate:
go generate ./...
clean:
rm -rf bin
package: dist
PACKAGE_VERSION=$(PACKAGE_VERSION) \
nfpm package \
--config misc/packaging/nfpm.yml \
--target ./dist \
--packager $(NFPM_PACKAGER)
dist:
mkdir -p dist
.PHONY: build
include main.mk
include packages.mk