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

10
ci/Jenkinsfile vendored
View File

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