#155 Add F35 + doc
Merged a year ago by zuul. Opened a year ago by fbo.
fbo/fedora-project-config f35-support  into  master

file modified
+19 -5
@@ -4,17 +4,23 @@ 

  

  let --| When changing that union, update the `all` attribute too

      Union =

-       < Rawhide | F33 | F34 | Epel8 >

+       < Rawhide | F33 | F34 | F35 | Epel8 >

  

- let eq_def = { Rawhide = False, F33 = False, F34 = False, Epel8 = False }

+ let eq_def =

+       { Rawhide = False, F33 = False, F34 = False, F35 = False, Epel8 = False }

  

  let show =

        λ(branch : Union) →

          merge

-           { Rawhide = "rawhide", F33 = "f33", F34 = "f34", Epel8 = "epel8" }

+           { Rawhide = "rawhide"

+           , F33 = "f33"

+           , F34 = "f34"

+           , F35 = "f35"

+           , Epel8 = "epel8"

+           }

            branch

  

- let all = [ Union.Rawhide, Union.F34, Union.F33, Union.Epel8 ]

+ let all = [ Union.Rawhide, Union.F35, Union.F34, Union.F33, Union.Epel8 ]

  

  let isRawhide = λ(branch : Union) → merge (eq_def ⫽ { Rawhide = True }) branch

  
@@ -35,7 +41,12 @@ 

      , target =

          λ(branch : Union) →

            merge

-             { Rawhide = "rawhide", F33 = "f33", F34 = "f34", Epel8 = "epel8" }

+             { Rawhide = "rawhide"

+             , F33 = "f33"

+             , F34 = "f34"

+             , F35 = "f35"

+             , Epel8 = "epel8"

+             }

              branch

      , arches =

          λ(branch : Union) →
@@ -43,6 +54,7 @@ 

              { Rawhide = Arches.fedora

              , F33 = Arches.fedora

              , F34 = Arches.fedora

+             , F35 = Arches.fedora

              , Epel8 = Arches.epel8

              }

              branch
@@ -55,6 +67,8 @@ 

                  "https://kojipkgs.fedoraproject.org/repos/f33-build/latest/x86_64/"

              , F34 =

                  "https://kojipkgs.fedoraproject.org/repos/f34-build/latest/x86_64/"

+             , F35 =

+                 "https://kojipkgs.fedoraproject.org/repos/f35-build/latest/x86_64/"

              , Epel8 =

                  "https://kojipkgs.fedoraproject.org/repos/epel8-build/latest/x86_64/"

              }

file added
+23
@@ -0,0 +1,23 @@ 

+ export FZCI = $(shell pwd)/FZCI.dhall/package.dhall

+ 

+ define generate_file

+ 	@echo "Rendering $(1)"

+ 	@dhall-to-yaml --generated-comment --file $(1).dhall | python3 -mzuulfmt > $(1).yaml

+ endef

+ 

+ all: render install-req

+ 

+ render:

+ 	@dhall hash --file $$FZCI > /dev/null

+ 	$(call generate_file,../fedora-zuul-jobs-config/zuul.d/jobs)

+ 	$(call generate_file,../fedora-zuul-jobs/zuul.d/jobs)

+ 

+ define clone

+ 	@test -d ../$(1)/.git || git clone https://pagure.io/$(1).git ../$(1)/

+ endef

+ 

+ install-req:

+ 	@type -p dhall-to-yaml > /dev/null || sudo dnf install -y dhall-json

+ 	@python3 -mzuulfmt --help > /dev/null || python3 -mpip install --user zuulfmt

+ 	$(call clone,fedora-zuul-jobs-config)

+ 	$(call clone,fedora-zuul-jobs)

file modified
+77 -4
@@ -4,7 +4,80 @@ 

  

  Here are configured:

  

- * resources/: Git repositories to be listened by softwarefactory-project.io's Zuul.

- * zuul.d/: Zuul pipelines and base Zuul jobs for Fedora. 

- * playbooks/: Ansible playbooks used by Zuul jobs.

- * tools/: Some addtionnal tooling.

+ - resources/: Git repositories to be listened by softwarefactory-project.io's Zuul.

+ - zuul.d/: Zuul pipelines and base Zuul jobs for Fedora.

+ - playbooks/: Ansible playbooks used by Zuul jobs.

+ - tools/: Some addtionnal tooling.

+ - FZCI.dhall: [Dhall][dhall-lang] description of Fedora Resources to be used in Zuul job configuration.

+ 

+ ## Prepare your workspace to edit FZCI Dhall config

+ 

+ ### Clone sources

+ 

+ Run the following command to install dependencies.

+ 

+ ```ShellSession

+ make install-req

+ ```

+ 

+ ### Run the rendering

+ 

+ ```ShellSession

+ make render

+ ```

+ 

+ Note that it is adviced to get a support for Dhall Lang into your IDE but at least you must have

+ installed the dhall commands on you system.

+ 

+ ## Adding support for a Fedora Branch

+ 

+ ### Adding new branch definition

+ 

+ - Edit file [branches.dhall](FZCI.dhall/Branches.dhall) in order to add the <new-branch>.

+ - The type checker will help you to fill the places where the <new-branch> handling must

+   be done.

+ 

+ If you don't have the support of Dhall in your IDE, you might want to check your edit with

+ the type checker:

+ 

+ ```ShellSession

+ cd fedora-project-config

+ dhall <<< './FZCI.dhall/Branches.dhall'

+ ```

+ 

+ ### Update jobs from fedora-zuul-jobs-config

+ 

+ In fedora-zuul-jobs-config

+ 

+ - Edit [jobs.dhall](https://pagure.io/fedora-zuul-jobs-config/raw/master/f/zuul.d/jobs.dhall) to handle the <new-branch>. Again the type checker will help you.

+ 

+ If the type checker does not complain then nothing needs to be done into that file.

+ 

+ Then run:

+ 

+ ```ShellSession

+ cd zuul.d

+ dhall-to-yaml --generated-comment --file jobs.dhall | python3 -mzuulfmt > jobs.yaml

+ # or run: make render

+ ```

+ 

+ ### Update jobs from fedora-zuul-jobs

+ 

+ In fedora-zuul-jobs

+ 

+ - Edit [jobs.dhall](https://pagure.io/fedora-zuul-jobs/raw/master/f/zuul.d/jobs.dhall) in order to ensure jobs will trigger in the <new-branch>. Again the type checker will help you.

+ 

+ Then run:

+ 

+ ```ShellSession

+ cd zuul.d

+ dhall-to-yaml --generated-comment --file jobs.dhall | python3 -mzuulfmt > jobs.yaml

+ # or run: make render

+ ```

+ 

+ ### Push changes

+ 

+ When edits are done on those repos then commits and push changes (as PR) then wait

+ for CI result.

+ 

+ [dhall-lang]: https://dhall-lang.org

no initial comment

Build succeeded.

That does not seems to work as expected, perhaps we could remove that part?

To finalize the addition, perhaps we should use such makefile instead:

export FZCI = $(shell pwd)/FZCI.dhall/package.dhall

define generate_file
»   @echo "Rendering $(1)"
»   @dhall-to-yaml --generated-comment --file $(1).dhall | python3 -mzuulfmt > $(1).yaml
endef

all: render install-req

render:
»   @dhall hash --file $$FZCI > /dev/null
»   $(call generate_file,../fedora-zuul-jobs-config/zuul.d/jobs)
»   $(call generate_file,../fedora-zuul-jobs/zuul.d/jobs)

define clone
»   @test -d ../$(1)/.git || git clone https://pagure.io/$(1).git ../$(1)/
endef

install-req:
»   @type -p dhall-to-yaml > /dev/null || sudo dnf install -y dhall-json
»   @python3 -mzuulfmt --help > /dev/null || python3 -mpip install --user zuulfmt
»   $(class clone,fedora-zuul-jobs-config)
»   $(class clone,fedora-zuul-jobs)

Lets drop that part too.

1 new commit added

  • Update REAME.md according to comments
a year ago

Thanks for the review. I've pushed on new commit to address your comments.

Build succeeded.

oops, this should be clone

let's use python3 -mzuulfmt

let's also install dhall

1 new commit added

  • adress comments
a year ago

Build succeeded.

Metadata Update from @fbo:
- Pull-request tagged with: gateit

a year ago

Build succeeded (gate pipeline).

Pull-Request has been merged by zuul

a year ago