diff --git a/ci/Jenkinsfile b/ci/Jenkinsfile new file mode 100644 index 0000000..65bf903 --- /dev/null +++ b/ci/Jenkinsfile @@ -0,0 +1,40 @@ +// vim: set sw=4 ts=4 sts=4 et : + +pipeline { + agent { + kubernetes { + yamlFile 'ci/podTemplate.yaml' + defaultContainer 'build' + } + } + + stages { + stage('Build') { + steps { + sh 'make rpm' + } + } + + stage('Publish') { + when { + branch 'main' + } + steps { + withCredentials([usernamePassword( + credentialsId: 'jenkins-packages', + usernameVariable: 'GITEA_USERNAME', + passwordVariable: 'GITEA_PASSWORD', + )]) { + sh 'make publish' + } + } + } + } + + post { + success { + archiveArtifacts '*.rpm' + } + } + +} diff --git a/ci/podTemplate.yaml b/ci/podTemplate.yaml new file mode 100644 index 0000000..a5e560e --- /dev/null +++ b/ci/podTemplate.yaml @@ -0,0 +1,7 @@ +spec: + containers: + - name: build + image: git.pyrocufflink.net/containerimages/build/selinux:main + imagePullPolicy: Always + securityPolicy: + runAsNonRoot: true