From 8df9a0c8d3bdf5b2f402162e50a61f8c34e38c7e Mon Sep 17 00:00:00 2001 From: "Dustin C. Hatch" Date: Sun, 7 Aug 2022 10:44:52 -0500 Subject: [PATCH] Begin Jenkins CI pipeline --- ci/Jenkinsfile | 54 +++++++++++++++++++++++++++++++++++++++++++++ ci/podTemplate.yaml | 10 +++++++++ 2 files changed, 64 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..7217972 --- /dev/null +++ b/ci/Jenkinsfile @@ -0,0 +1,54 @@ +// vim: set ft=groovy sw=4 ts=4 sts=4 et : + +pipeline { + agent { + kubernetes { + yamlFile 'ci/podTemplate.yaml' + defaultContainer 'buildroot' + } + } + + options { + buildDiscarder logRotator(numToKeepStr: '5') + disableConcurrentBuilds() + } + + parameters { + booleanParam \ + name: 'Clean', + description: 'Clean the workspace and perform a full rebuild' + } + + stages { + stage('Prepare') { + steps { + script { + if (params.Clean) { + sh 'rm -rf _build' + } + } + checkout poll: false, scm: [ + $class: 'GitSCM', + branches: [[name: '2022.05.x']], + doGenerateSubmoduleConfigurations: false, + userRemoteConfigs: [[url: 'git://git.buildroot.net/buildroot']], + extensions: [ + [ + $class: 'RelativeTargetDirectory', + relativeTargetDir: 'buildroot', + ], + ], + ] + } + } + + stage('Build') { + steps { + sh 'make -C buildroot O="${PWD}"/_build pythonctnr_defconfig' + sh 'make -C _build' + } + } + + } + +} diff --git a/ci/podTemplate.yaml b/ci/podTemplate.yaml new file mode 100644 index 0000000..c5452f6 --- /dev/null +++ b/ci/podTemplate.yaml @@ -0,0 +1,10 @@ +spec: + containers: + - name: buildroot + image: registry.pyrocufflink.blue/buildroot + command: + - sleep + - infinity + securityContext: + readOnlyRootFilesystem: true + runAsUser: 1000