1
0
Fork 0

Compare commits

..

2 Commits

Author SHA1 Message Date
Dustin dbe29758c2 wip: ci
infra/dch-selinux/pipeline/head This commit looks good Details
2023-10-26 08:18:31 -05:00
Dustin 1f82242a0e Add RPM spec 2023-10-26 07:36:02 -05:00
2 changed files with 16 additions and 13 deletions

View File

@ -16,9 +16,6 @@ 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
@ -68,14 +65,16 @@ endif
mock -r '$(MOCKTARGET)' $(SRPM)
cp -a /var/lib/mock/$(MOCKTARGET)/result/*.noarch.rpm .
publish: $(RPM)
ifeq ($(GITEA_USERNAME),)
$(error GITEA_USERNAME and GITEA_PASSWORD are required)
publish: repo
ifeq ($(PUBLISH_HOST),)
$(error PUBLISH_HOST and PUBLISH_PATH are required)
endif
curl -f \
'$(GITEA_URL)/api/packages/$(GITEA_ORG)/rpm/upload' \
-u '$(GITEA_USERNAME):$(GITEA_PASSWORD)' \
-T $<
rsync -rtiO --delete $(REPO)/ $(PUBLISH_HOST):$(PUBLISH_PATH)
repo:
mkdir -p '$(REPO)'
cp *.rpm '$(REPO)'/
createrepo '$(REPO)'
rpm: $(RPM)

10
ci/Jenkinsfile vendored
View File

@ -1,6 +1,10 @@
// vim: set sw=4 ts=4 sts=4 et :
pipeline {
environment {
GITEA_URL = 'https://git.pyrocufflink.net'
}
agent {
kubernetes {
yamlFile 'ci/podTemplate.yaml'
@ -19,10 +23,10 @@ pipeline {
steps {
withCredentials([usernamePassword(
credentialsId: 'jenkins-packages',
usernameVariable: 'GITEA_USERNAME',
passwordVariable: 'GITEA_PASSWORD',
usernameVariable: 'USERNAME',
passwordVariable: 'PASSWORD',
)]) {
sh 'make publish'
sh 'curl -f -u "${USERNAME}:${PASSWORD}" -T *.rpm ${GITEA_URL}/api/packages/infra/rpm/upload'
}
}
}