Skip to content

Commit

Permalink
Use JCasC for creating initial Jenkins jobs
Browse files Browse the repository at this point in the history
Signed-off-by: Marko Kaapu <[email protected]>
  • Loading branch information
mkaapu committed Dec 10, 2024
1 parent 1b1cc9b commit cf0bf50
Show file tree
Hide file tree
Showing 2 changed files with 143 additions and 39 deletions.
39 changes: 0 additions & 39 deletions hosts/azure/jenkins-controller/configuration.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
143 changes: 143 additions & 0 deletions hosts/azure/jenkins-controller/jenkins-casc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
}
}

0 comments on commit cf0bf50

Please sign in to comment.