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