WIP: jjb: Kernel dev jobs
authorKienan Stewart <kstewart@efficios.com>
Fri, 4 Oct 2024 19:57:16 +0000 (15:57 -0400)
committerKienan Stewart <kstewart@efficios.com>
Fri, 4 Oct 2024 19:58:26 +0000 (15:58 -0400)
Change-Id: I8889b7ccab5d1b4ec2f26153ff9d73a9ec175f72

jobs/linux.yml [new file with mode: 0644]
pipelines/linux/pipeline.groovy.j2 [new file with mode: 0644]
pipelines/linux/watcher.groovy.j2 [new file with mode: 0644]

diff --git a/jobs/linux.yml b/jobs/linux.yml
new file mode 100644 (file)
index 0000000..24f07f0
--- /dev/null
@@ -0,0 +1,59 @@
+---
+
+- defaults:
+    name: linux-kernel
+    description: |
+      <p>Job is managed by Jenkins Job Builder</p>
+    # As the source code doesn't contain a Jenkinsfile, multibranch pipelines don't work
+    project-type: pipeline
+    sandbox: true
+    dsl:
+      !include-jinja2: pipelines/linux/pipeline.groovy.j2
+    # Vars used by pipeline and/or projects
+    cc: 'gcc'
+    cxx: 'g++'
+    github_user: ''
+    github_project: 'linux'
+    github_branch_pattern: 'ci/*'
+    stable_mirror: 'git://git-mirror.internal.efficios.com/git/linux-all.git'
+    email_to: ''
+    default_label: 'deb12-amd64'
+
+## Anchors
+
+## Job templates
+
+- job-template:
+    name: '{job_prefix}linux_kernel_pipeline'
+    defaults: linux-kernel
+
+- job-template:
+    name: '{job_prefix}branch_watcher'
+    dsl:
+      !include-jinja2: pipelines/linux/watcher.groovy.j2
+## Views
+
+- view-template:
+    name: 'Linux Kernel'
+    view-type: list
+    regex: '.*[-_]?linux_kernel[-_].*'
+
+## Projects
+
+- project:
+    name: 'compudj'
+    job_prefix: 'dev_compudj_'
+    email_to: 'mathieu.desnoyers@efficios.com'
+    github_user: 'compudj'
+    jobs:
+      - '{job_prefix}linux_kernel_pipeline':
+          github_project: 'linux-dev'
+      - '{job_prefix}linux_kernel_pipeline':
+          job_prefix: 'dev_kstewart'
+          github_user: 'kienanstewart'
+          email_to: ''
+
+- project:
+    name: linux-views
+    views:
+      - 'Linux Kernel'
diff --git a/pipelines/linux/pipeline.groovy.j2 b/pipelines/linux/pipeline.groovy.j2
new file mode 100644 (file)
index 0000000..dbde92c
--- /dev/null
@@ -0,0 +1,68 @@
+pipeline {
+  agent none
+
+  options {
+    skipDefaultCheckout(true)
+    buildDiscarder(logRotator(daysToKeepStr: '7'))
+  }
+
+  triggers {
+    pollSCM('H * * * *')
+  }
+
+  stages {
+    stage('Checkout') {
+      agent {
+        label "{{default_label}}"
+      }
+
+      steps {
+        dir('src/linux') {
+          checkout([
+            $class: 'GitSCM',
+            branches: [[name: '{{github_branch_pattern}}']],
+            userRemoteConfigs: [[
+              url: 'https://github.com/{{github_user}}/{{github_project}}'
+            ]],
+            extensions: [
+              [$class: 'CloneOption', depth: 1,],
+              [$class: 'CleanCheckout'],
+            ],
+          ])
+
+          // Do any steps that are pretty generic, like linting or check
+          // project config.
+          // The '.git' won't be stashed, so any operations that depend
+          // on git information should be done now.
+          sh (
+            label: 'Check patch',
+            script: """\n
+git remote add stable {{stable_mirror}}
+git fetch stable
+git branch -u stable/master
+OUTPUT_DIR=\$(mktemp -d)
+FAILURE=0
+for patch_file in "\$(ls "\$OUTPUT_DIR/*.patch")" ; do
+    echo \$patch_file
+    cat \$patch_file | scripts/checkpatch.pl -q --terse --no-summary --mailback --showfile || FAILURE=1
+done
+rm -rf "\${OUTPUT_DIR}"
+if [[ "\${FAILURE}" == "1" ]] ; then
+   exit 1
+fi
+""",
+          )
+        }
+
+
+        stash(name: 'linux', includes: 'src/linux/**')
+      }
+    }
+
+    // parallel (arch) {
+
+    // }
+
+    // Future: parallel (arch, platform) runtime tests
+  }
+}
diff --git a/pipelines/linux/watcher.groovy.j2 b/pipelines/linux/watcher.groovy.j2
new file mode 100644 (file)
index 0000000..93bd726
--- /dev/null
@@ -0,0 +1,15 @@
+pipeline {
+  agent none
+
+  parameters {
+
+  }
+
+  triggers {
+    pollScm('H * * * *')
+  }
+
+  stages {
+    stage(
+  }
+}
This page took 0.024896 seconds and 4 git commands to generate.