1
0
Fork 0

meta: Publish to Gitea

Gitea 1.20 introduced RPM package repository support.  We can use this
feature to publish the *dch-selinux* RPM, instead of manually creating
the repository and publishing it to the file server.  This will
ultimately enable Jenkins to publish the package as well.
main
Dustin 2023-10-26 09:19:47 -05:00
parent e586ea3740
commit 8c1eaf1bac
1 changed files with 10 additions and 9 deletions

View File

@ -16,6 +16,9 @@ SPEC = dch-selinux.spec
RPM = dch-selinux-$(VERSION)-$(RELEASE).$(ARCH).rpm RPM = dch-selinux-$(VERSION)-$(RELEASE).$(ARCH).rpm
SRPM = dch-selinux-$(VERSION)-$(RELEASE).src.rpm SRPM = dch-selinux-$(VERSION)-$(RELEASE).src.rpm
GITEA_URL = https://git.pyrocufflink.net
GITEA_ORG = infra
define buildpp define buildpp
$(MAKE) NAME=$(NAME) -f /usr/share/selinux/devel/Makefile $(MAKE) NAME=$(NAME) -f /usr/share/selinux/devel/Makefile
endef endef
@ -65,16 +68,14 @@ endif
mock -r '$(MOCKTARGET)' $(SRPM) mock -r '$(MOCKTARGET)' $(SRPM)
cp -a /var/lib/mock/$(MOCKTARGET)/result/*.noarch.rpm . cp -a /var/lib/mock/$(MOCKTARGET)/result/*.noarch.rpm .
publish: repo publish: $(RPM)
ifeq ($(PUBLISH_HOST),) ifeq ($(GITEA_USERNAME),)
$(error PUBLISH_HOST and PUBLISH_PATH are required) $(error GITEA_USERNAME and GITEA_PASSWORD are required)
endif endif
rsync -rtiO --delete $(REPO)/ $(PUBLISH_HOST):$(PUBLISH_PATH) curl -f \
'$(GITEA_URL)/api/packages/$(GITEA_ORG)/rpm/upload' \
repo: -u '$(GITEA_USERNAME):$(GITEA_PASSWORD)' \
mkdir -p '$(REPO)' -T $<
cp *.rpm '$(REPO)'/
createrepo '$(REPO)'
rpm: $(RPM) rpm: $(RPM)