From 25a7dd9692614471edb3e5d57c72e34fe7b18c18 Mon Sep 17 00:00:00 2001 From: Fabien Boucher Date: Apr 08 2022 07:45:02 +0000 Subject: dhall files move into the main repository: fedora-project-config Depends-on: https://pagure.io/fedora-project-config/pull-request/188 --- diff --git a/README.md b/README.md index 79efe31..22642b7 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ # fedora-zuul-jobs -Zuul jobs for Fedora +Zuul jobs for Fedora. + +Please refer to: https://pagure.io/fedora-project-config diff --git a/zuul.d/jobs.dhall b/zuul.d/jobs.dhall deleted file mode 100644 index 9d720c9..0000000 --- a/zuul.d/jobs.dhall +++ /dev/null @@ -1,177 +0,0 @@ -{-| - -This Dhall definition helps to maintain the jobs.yaml definition for Zuul. -The Dhall-Zuul library is used to benefit base Dhall type and function for Zuul -objects. - -To compute the jobs.yaml run: - - dhall-to-yaml --generated-comment --file jobs.dhall | zuulfmt > jobs.yaml - -Install dhall by following https://docs.dhall-lang.org/tutorials/Getting-started_Generate-JSON-or-YAML.html#installation -Install zuulfmt by running: `python3 -mpip install --user zuulfmt` - --} -let FZCI = ./FZCI.dhall - -let Zuul = FZCI.Zuul - -let Prelude = FZCI.Prelude - -let Nodesets = FZCI.Nodesets - -let Branches = FZCI.Branches - -let createJobVars - : Text → Zuul.Vars.Type - = λ(url : Text) → - Zuul.Vars.object - [ { mapKey = "repos" - , mapValue = - Zuul.Vars.array - [ Zuul.Vars.object - [ { mapKey = "name" - , mapValue = Zuul.Vars.string "distro-build" - } - , { mapKey = "url", mapValue = Zuul.Vars.string url } - ] - ] - } - ] - -let createRpmInstallTestJob - : Branches.Type → Zuul.Job.Type - = λ(branch : Branches.Type) → - let getNodesetByBranch = - λ(branch : Branches.Type) → - merge - { Rawhide = Nodesets.getName Nodesets.Type.Fedora-Rawhide-VM - , F34 = Nodesets.getName Nodesets.Type.Fedora-34-Container - , F35 = Nodesets.getName Nodesets.Type.Fedora-35-VM-Medium - , F36 = Nodesets.getName Nodesets.Type.Fedora-36-VM - , Epel8 = Nodesets.getName Nodesets.Type.Centos-8-VM - } - branch - - let job = - Zuul.Job::{ - , name = "rpm-install-test" - , description = Some - "Install the built rpms (${Branches.show branch} variant)" - , roles = Some [ { zuul = "zuul-distro-jobs" } ] - , requires = Some [ "repo" ] - , run = Some "playbooks/rpm/rpm-install-test.yaml" - , branches = Branches.zuulBranch branch - , nodeset = Some (getNodesetByBranch branch) - , vars = Some (createJobVars (Branches.kojirepos branch)) - } - - let job = - if Branches.isEpel8 branch - then job ⫽ { pre-run = Some [ "playbooks/epel8/install.yaml" ] } - else job - - in job - -let createRpmTestJob - : Branches.Type → Zuul.Job.Type - = λ(branch : Branches.Type) → - let getNodesetByBranch = - λ(branch : Branches.Type) → - merge - { Rawhide = - Nodesets.getName Nodesets.Type.Fedora-Rawhide-VM-Medium - , F34 = Nodesets.getName Nodesets.Type.Fedora-34-VM-Medium - , F35 = Nodesets.getName Nodesets.Type.Fedora-35-VM-Medium - , F36 = Nodesets.getName Nodesets.Type.Fedora-36-VM-Medium - , Epel8 = Nodesets.getName Nodesets.Type.Centos-8-VM - } - branch - - let job = - Zuul.Job::{ - , name = "rpm-test" - , description = Some - "Install the built rpms and run STI tests (${Branches.show - branch} variant)" - , roles = Some [ { zuul = "zuul-distro-jobs" } ] - , timeout = Some 18000 - , requires = Some [ "repo" ] - , run = Some "playbooks/rpm/rpmtest.yaml" - , post-run = Some [ "playbooks/rpm/rpmtest-fetch-artifacts.yaml" ] - , branches = Branches.zuulBranch branch - , nodeset = Some (getNodesetByBranch branch) - , vars = Some (createJobVars (Branches.kojirepos branch)) - } - - let job = - if Branches.isEpel8 branch - then job ⫽ { pre-run = Some [ "playbooks/epel8/install.yaml" ] } - else job - - in job - -let createRpmInspectJob - : Branches.Type → Zuul.Job.Type - = λ(branch : Branches.Type) → - let job = - Zuul.Job::{ - , name = "rpm-rpminspect" - , description = Some - "Run the rpminspect report tests (${Branches.show - branch} variant)" - , parent = Some "rpminspect" - , requires = Some [ "repo" ] - , branches = Branches.zuulBranch branch - , nodeset = Some - (Nodesets.getName Nodesets.Type.Fedora-34-Container) - , vars = Some - ( Zuul.Vars.object - [ { mapKey = "rpminspect_cmd" - , mapValue = Zuul.Vars.string "rpminspect-fedora" - } - , { mapKey = "check_previous_build_enabled" - , mapValue = Zuul.Vars.bool True - } - , { mapKey = "target" - , mapValue = Zuul.Vars.string (Branches.target branch) - } - ] - ) - } - - in job - -let rpm_linter_job = - Zuul.Job::{ - , name = "rpm-linter" - , parent = Some "repo-rpm-lint" - , requires = Some [ "repo" ] - , nodeset = Some (Nodesets.getName Nodesets.Type.Fedora-34-Container) - , branches = Some Branches.allText - } - -let rpm_install_test_jobs = - Prelude.List.map - Branches.Type - Zuul.Job.Type - createRpmInstallTestJob - Branches.all - -let rpm_test_jobs = - Prelude.List.map Branches.Type Zuul.Job.Type createRpmTestJob Branches.all - -let rpminspect_jobs = - Prelude.List.map - Branches.Type - Zuul.Job.Type - createRpmInspectJob - Branches.all - -let jobs = - rpm_install_test_jobs - # rpm_test_jobs - # rpminspect_jobs - # [ rpm_linter_job ] - -in Zuul.Job.wrap jobs diff --git a/zuul.d/nodesets.dhall b/zuul.d/nodesets.dhall deleted file mode 100644 index bcee8c7..0000000 --- a/zuul.d/nodesets.dhall +++ /dev/null @@ -1,28 +0,0 @@ -{-| - -This Dhall definition helps to maintain the nodesets.yaml definition for Zuul. -The Dhall-Zuul library is used to benefit base Dhall type and function for Zuul -objects. - -To compute the jobs.yaml run: - - dhall-to-yaml --generated-comment --file nodesets.dhall | zuulfmt > nodesets.yaml -Install dhall by following https://docs.dhall-lang.org/tutorials/Getting-started_Generate-JSON-or-YAML.html#installation -Install zuulfmt by running: `python3 -mpip install --user zuulfmt` - --} -let FZCI = ./FZCI.dhall - -let Prelude = FZCI.Prelude - -let Zuul = FZCI.Zuul - -let Nodesets = FZCI.Nodesets - -in Zuul.Nodeset.wrap - ( Prelude.List.map - Nodesets.Type - Zuul.Nodeset.Type - Nodesets.toNodeset - Nodesets.all - ) diff --git a/zuul.d/templates.dhall b/zuul.d/templates.dhall deleted file mode 100644 index 160b255..0000000 --- a/zuul.d/templates.dhall +++ /dev/null @@ -1,154 +0,0 @@ -{-| - -This Dhall definition helps to maintain the jobs.yaml definition for Zuul. -The Dhall-Zuul library is used to benefit base Dhall type and function for Zuul -objects. - -To compute the jobs.yaml run: - - dhall-to-yaml --generated-comment --file templates.dhall | zuulfmt > templates.yaml - -Install dhall by following https://docs.dhall-lang.org/tutorials/Getting-started_Generate-JSON-or-YAML.html#installation -Install zuulfmt by running: `python3 -mpip install --user zuulfmt` - --} -let FZCI = ./FZCI.dhall - -let Prelude = FZCI.Prelude - -let Zuul = FZCI.Zuul - -let build = - let createSBJobsForArches = - Prelude.List.map - FZCI.Arches.Type - Zuul.Job.Union - ( λ(arch : FZCI.Arches.Type) → - if FZCI.Arches.isX86_64 arch - then Zuul.Job.Name "rpm-scratch-build" - else Zuul.Job.Inline - Zuul.Job::{ - , name = "rpm-scratch-build-${FZCI.Arches.show arch}" - , voting = Some False - } - ) - FZCI.Arches.fedora - - in toMap - { name = Zuul.ProjectTemplate.Name "build" - , check = - Zuul.ProjectTemplate.Pipeline - Zuul.Project.PipelineConfig::{ - , jobs = - [ Zuul.Job.Name "check-for-arches" ] - # createSBJobsForArches - } - } - -let lint = - toMap - { name = Zuul.ProjectTemplate.Name "lint" - , check = - Zuul.ProjectTemplate.Pipeline - Zuul.Project.PipelineConfig::{ - , jobs = - [ Zuul.Job.Inline - Zuul.Job::{ - , name = "rpm-linter" - , dependencies = Some - [ Zuul.Job.Dependency.Name "rpm-scratch-build" ] - } - , Zuul.Job.Inline - Zuul.Job::{ - , name = "rpm-rpminspect" - , voting = Some False - , dependencies = Some - [ Zuul.Job.Dependency.Name "rpm-scratch-build" ] - } - ] - } - } - -let test = - toMap - { name = Zuul.ProjectTemplate.Name "test" - , check = - Zuul.ProjectTemplate.Pipeline - Zuul.Project.PipelineConfig::{ - , jobs = - [ Zuul.Job.Inline - Zuul.Job::{ - , name = "check-for-tests" - , dependencies = Some - [ Zuul.Job.Dependency.Name "rpm-scratch-build" ] - } - , Zuul.Job.Inline - Zuul.Job::{ - , name = "check-for-sti-tests" - , dependencies = Some - [ Zuul.Job.Dependency.Name "rpm-scratch-build" ] - } - , Zuul.Job.Inline - Zuul.Job::{ - , name = "check-for-fmf-tests" - , dependencies = Some - [ Zuul.Job.Dependency.Name "rpm-scratch-build" ] - } - , Zuul.Job.Inline - Zuul.Job::{ - , name = "rpm-install-test" - , dependencies = Some - [ Zuul.Job.Dependency.Name "rpm-scratch-build" ] - } - , Zuul.Job.Inline - Zuul.Job::{ - , name = "rpm-test" - , dependencies = Some - [ Zuul.Job.Dependency.Name "check-for-tests" - , Zuul.Job.Dependency.Name "rpm-scratch-build" - ] - } - , Zuul.Job.Inline - Zuul.Job::{ - , name = "rpm-tmt-test" - , dependencies = Some - [ Zuul.Job.Dependency.Name "check-for-fmf-tests" - , Zuul.Job.Dependency.Name "rpm-scratch-build" - ] - } - , Zuul.Job.Inline - Zuul.Job::{ - , name = "rpm-sti-test" - , dependencies = Some - [ Zuul.Job.Dependency.Name "check-for-sti-tests" - , Zuul.Job.Dependency.Name "rpm-scratch-build" - ] - } - ] - } - } - -let publish = - toMap - { name = Zuul.ProjectTemplate.Name "publish" - , gate = - Zuul.ProjectTemplate.Pipeline - Zuul.Project.PipelineConfig::{ jobs = [ Zuul.Job.Name "noop" ] } - , promote = - Zuul.ProjectTemplate.Pipeline - Zuul.Project.PipelineConfig::{ - , jobs = [ Zuul.Job.Name "rpm-build" ] - } - } - -let testTestsDef = - toMap - { name = Zuul.ProjectTemplate.Name "test-tests-def" - , check = - Zuul.ProjectTemplate.Pipeline - Zuul.Project.PipelineConfig::{ - , jobs = [ Zuul.Job.Name "rpm-test" ] - } - } - -in Zuul.ProjectTemplate.wrap [ build, lint, test, publish, testTestsDef ]