mirror of
https://github.com/ClusterCockpit/cc-metric-collector.git
synced 2025-04-08 14:35:55 +02:00
Create make target RPM
This commit is contained in:
parent
26dd1ed7fc
commit
3f16fb9f0b
2
.github/workflows/AlmaLinux.yml
vendored
2
.github/workflows/AlmaLinux.yml
vendored
@ -36,7 +36,7 @@ jobs:
|
||||
go-version: '^1.16.7'
|
||||
|
||||
- name: RPM build MetricCollector
|
||||
run: rpmbuild -bb --build-in-place --nodeps scripts/cc-metric-collector.spec
|
||||
run: make rpm
|
||||
|
||||
# See: https://github.com/actions/download-artifact
|
||||
- name: Save RPM as artifact
|
||||
|
2
.github/workflows/runonce.yml
vendored
2
.github/workflows/runonce.yml
vendored
@ -39,7 +39,7 @@ jobs:
|
||||
|
||||
#
|
||||
# Job build-1-16
|
||||
# Build on latest Ubuntu using golang version 1.17
|
||||
# Build on latest Ubuntu using golang version 1.16
|
||||
#
|
||||
build-1-16:
|
||||
runs-on: ubuntu-latest
|
||||
|
17
Makefile
17
Makefile
@ -56,3 +56,20 @@ vet:
|
||||
staticcheck:
|
||||
go install honnef.co/go/tools/cmd/staticcheck@latest
|
||||
$$(go env GOPATH)/bin/staticcheck ./...
|
||||
|
||||
.ONESHELL:
|
||||
.PHONY: RPM
|
||||
RPM: scripts/cc-metric-collector.spec
|
||||
@WORKSPACE="$${PWD}"
|
||||
@SPECFILE="$${WORKSPACE}/scripts/cc-metric-collector.spec"
|
||||
# Setup RPM build tree
|
||||
@eval $$(rpm --eval "ARCH='%{_arch}' RPMDIR='%{_rpmdir}' SOURCEDIR='%{_sourcedir}' SPECDIR='%{_specdir}' SRPMDIR='%{_srcrpmdir}' BUILDDIR='%{_builddir}'")
|
||||
@mkdir --parents --verbose "$${RPMDIR}" "$${SOURCEDIR}" "$${SPECDIR}" "$${SRPMDIR}" "$${BUILDDIR}"
|
||||
# Create source tarball
|
||||
@VERS=$$(git describe --tags | sed -e 's/^v//g' -e 's/-/+/g')
|
||||
@PREFIX=$$(rpmspec --query --queryformat "%{name}-%{version}" --define="VERS $${VERS}" "$${SPECFILE}")
|
||||
@FORMAT="tar.gz"
|
||||
@SRCFILE="$${SOURCEDIR}/$${PREFIX}.$${FORMAT}"
|
||||
@git archive --verbose --format "$${FORMAT}" --prefix="$${PREFIX}/" --output="$${SRCFILE}" HEAD
|
||||
# Build RPM and SRPM
|
||||
@rpmbuild -ba --define="VERS $${VERS}" --define "_unitdir /usr/lib/systemd/system"--rmsource --clean --nodeps "$${SPECFILE}"
|
Loading…
x
Reference in New Issue
Block a user