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.
This commit is contained in:
19
Makefile
19
Makefile
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user