From dbe29758c2e6d26c1ca84da9e79cc12ecb6a01b8 Mon Sep 17 00:00:00 2001 From: "Dustin C. Hatch" Date: Mon, 19 Dec 2022 11:07:30 -0600 Subject: [PATCH] wip: ci --- ci/Jenkinsfile | 41 +++++++++++++++++++++++++++++++++++++++++ ci/podTemplate.yaml | 7 +++++++ 2 files changed, 48 insertions(+) create mode 100644 ci/Jenkinsfile create mode 100644 ci/podTemplate.yaml diff --git a/ci/Jenkinsfile b/ci/Jenkinsfile new file mode 100644 index 0000000..63bf1d2 --- /dev/null +++ b/ci/Jenkinsfile @@ -0,0 +1,41 @@ +// vim: set sw=4 ts=4 sts=4 et : + +pipeline { + environment { + GITEA_URL = 'https://git.pyrocufflink.net' + } + + agent { + kubernetes { + yamlFile 'ci/podTemplate.yaml' + defaultContainer 'build' + } + } + + stages { + stage('Build') { + steps { + sh 'make rpm' + } + } + + stage('Publish') { + steps { + withCredentials([usernamePassword( + credentialsId: 'jenkins-packages', + usernameVariable: 'USERNAME', + passwordVariable: 'PASSWORD', + )]) { + sh 'curl -f -u "${USERNAME}:${PASSWORD}" -T *.rpm ${GITEA_URL}/api/packages/infra/rpm/upload' + } + } + } + } + + 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