diff --git a/hosts/azure/jenkins-controller/configuration.nix b/hosts/azure/jenkins-controller/configuration.nix index 5736d534..01cd2d38 100644 --- a/hosts/azure/jenkins-controller/configuration.nix +++ b/hosts/azure/jenkins-controller/configuration.nix @@ -137,45 +137,6 @@ in # Increase the number of rows shown in Stage View (default is 10) "-Dcom.cloudbees.workflow.rest.external.JobExt.maxRunsPerJob=32" ]; - - # Configure jenkins job(s): - # https://jenkins-job-builder.readthedocs.io/en/latest/project_pipeline.html - # https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/services/continuous-integration/jenkins/job-builder.nix - jobBuilder = { - enable = true; - nixJobs = - lib.mapAttrsToList - (display-name: script: { - job = { - inherit display-name; - name = script; - project-type = "pipeline"; - concurrent = true; - pipeline-scm = { - script-path = "${script}.groovy"; - lightweight-checkout = true; - scm = [ - { - git = { - url = "https://github.com/tiiuae/ghaf-jenkins-pipeline.git"; - clean = true; - branches = [ "*/main" ]; - }; - } - ]; - }; - }; - }) - { - "Ghaf main pipeline" = "ghaf-main-pipeline"; - "Ghaf pre-merge pipeline" = "ghaf-pre-merge-pipeline"; - "Ghaf nightly pipeline" = "ghaf-nightly-pipeline"; - "Ghaf release pipeline" = "ghaf-release-pipeline"; - "Ghaf HW test" = "ghaf-hw-test"; - "Ghaf parallel HW test" = "ghaf-parallel-hw-test"; - "FMO OS main pipeline" = "fmo-os-main-pipeline"; - }; - }; }; systemd.services.jenkins.serviceConfig = { diff --git a/hosts/azure/jenkins-controller/jenkins-casc.yaml b/hosts/azure/jenkins-controller/jenkins-casc.yaml index 84c7a5ba..1d5397be 100644 --- a/hosts/azure/jenkins-controller/jenkins-casc.yaml +++ b/hosts/azure/jenkins-controller/jenkins-casc.yaml @@ -164,3 +164,146 @@ tool: mavenGlobalConfig: globalSettingsProvider: "standard" settingsProvider: "standard" +# https://github.com/jenkinsci/job-dsl-plugin +# https://jenkinsci.github.io/job-dsl-plugin +jobs: + - script: > + pipelineJob('Ghaf main pipeline') { + definition { + cpsScm { + scm { + git { + remote { + url('https://github.com/tiiuae/ghaf-jenkins-pipeline.git') + } + branch('*/main') + extensions { + cleanBeforeCheckout() + } + } + scriptPath("ghaf-main-pipeline.groovy") + } + lightweight() + } + } + } + - script: > + pipelineJob('Ghaf pre-merge pipeline') { + definition { + cpsScm { + scm { + git { + remote { + url('https://github.com/tiiuae/ghaf-jenkins-pipeline.git') + } + branch('*/main') + extensions { + cleanBeforeCheckout() + } + } + scriptPath("ghaf-pre-merge-pipeline.groovy") + } + lightweight() + } + } + } + - script: > + pipelineJob('Ghaf nightly pipeline') { + definition { + cpsScm { + scm { + git { + remote { + url('https://github.com/tiiuae/ghaf-jenkins-pipeline.git') + } + branch('*/main') + extensions { + cleanBeforeCheckout() + } + } + scriptPath("ghaf-nightly-pipeline.groovy") + } + lightweight() + } + } + } + - script: > + pipelineJob('Ghaf release pipeline') { + definition { + cpsScm { + scm { + git { + remote { + url('https://github.com/tiiuae/ghaf-jenkins-pipeline.git') + } + branch('*/main') + extensions { + cleanBeforeCheckout() + } + } + scriptPath("ghaf-release-pipeline.groovy") + } + lightweight() + } + } + } + - script: > + pipelineJob('Ghaf HW test') { + definition { + cpsScm { + scm { + git { + remote { + url('https://github.com/tiiuae/ghaf-jenkins-pipeline.git') + } + branch('*/main') + extensions { + cleanBeforeCheckout() + } + } + scriptPath("ghaf-hw-test.groovy") + } + lightweight() + } + } + } + - script: > + pipelineJob('Ghaf parallel HW test') { + definition { + cpsScm { + scm { + git { + remote { + url('https://github.com/tiiuae/ghaf-jenkins-pipeline.git') + } + branch('*/main') + extensions { + cleanBeforeCheckout() + } + } + scriptPath("ghaf-parallel-hw-test.groovy") + } + lightweight() + } + } + } + - script: > + pipelineJob('FMO OS main_pipeline') { + definition { + cpsScm { + scm { + git { + remote { + url('https://github.com/tiiuae/ghaf-jenkins-pipeline.git') + } + branch('*/main') + extensions { + cleanBeforeCheckout() + } + } + scriptPath("fmo-os-main-pipeline.groovy") + } + lightweight() + } + } + }