update make targets
This commit is contained in:
parent
d60eb180e2
commit
903c71c457
19
Makefile
19
Makefile
@ -1,3 +1,4 @@
|
|||||||
|
IMAGE?=fedora:latest
|
||||||
LDFLAGS?=--ldflags '-extldflags "-static"' --ldflags="-X 'main.commit=$(shell git rev-parse HEAD)' -X 'main.version=$(shell git describe --tags)' -X 'main.date=$(shell date '+%Y-%m-%d %T.%s%z')'"
|
LDFLAGS?=--ldflags '-extldflags "-static"' --ldflags="-X 'main.commit=$(shell git rev-parse HEAD)' -X 'main.version=$(shell git describe --tags)' -X 'main.date=$(shell date '+%Y-%m-%d %T.%s%z')'"
|
||||||
export CGO_ENABLED=1
|
export CGO_ENABLED=1
|
||||||
VERSION?=$(shell git describe --tags | sed -e 's/^v//' -e 's/-/_/g')
|
VERSION?=$(shell git describe --tags | sed -e 's/^v//' -e 's/-/_/g')
|
||||||
@ -11,9 +12,21 @@ jx-cli:
|
|||||||
test: jx-cli
|
test: jx-cli
|
||||||
go test -coverprofile=artifacts/coverage.profile ./...
|
go test -coverprofile=artifacts/coverage.profile ./...
|
||||||
go tool cover -html=artifacts/coverage.profile -o artifacts/code-coverage.html
|
go tool cover -html=artifacts/coverage.profile -o artifacts/code-coverage.html
|
||||||
|
fedora-deps:
|
||||||
rpm:
|
|
||||||
echo Building $(VERSION)
|
|
||||||
dnf install -y nodejs git dnf-plugins-core rpm-build rpmdevtools
|
dnf install -y nodejs git dnf-plugins-core rpm-build rpmdevtools
|
||||||
spectool -g -R build/jx.spec
|
spectool -g -R build/jx.spec
|
||||||
|
curl -L -o - https://go.dev/dl/go1.22.3.linux-amd64.tar.gz | tar -zxvf -
|
||||||
|
rpm: fedora-deps
|
||||||
|
echo Building $(VERSION)
|
||||||
rpmbuild -ba --define='version $(VERSION)' build/jx.spec
|
rpmbuild -ba --define='version $(VERSION)' build/jx.spec
|
||||||
|
ubuntu-deps:
|
||||||
|
apt-get update -y
|
||||||
|
apt-get install -y git make libluajit-5.1-dev iproute2 gcc curl
|
||||||
|
curl -L -o - https://go.dev/dl/go1.22.3.linux-amd64.tar.gz | tar -zxvf -
|
||||||
|
deb: ubuntu-deps
|
||||||
|
:
|
||||||
|
run:
|
||||||
|
docker run -it -v $(HOME)/.git-credentials:/root/.git-credentials -v $(HOME)/.gitconfig:/root/.gitconfig -v $(shell pwd):/src $(IMAGE) bash
|
||||||
|
clean:
|
||||||
|
go clean -modcache
|
||||||
|
rm jx
|
||||||
|
Loading…
Reference in New Issue
Block a user