Re: FBR: Enable multi-arch ostree composes for F27+

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Okay, and I need to really start taking note of my jinja tags.
For the record: jinja tags with {{ }}/{% %} are processed by Ansible,
whereas [[ ]]//[% %] are processed by Bodhi.

This patch should have the correct tags and the correct code.


diff --git a/roles/bodhi2/backend/templates/pungi.rpm.conf.j2
b/roles/bodhi2/backend/templates/pungi.rpm.conf.j2
index 1c6dc02..690d278 100644
--- a/roles/bodhi2/backend/templates/pungi.rpm.conf.j2
+++ b/roles/bodhi2/backend/templates/pungi.rpm.conf.j2
@@ -107,9 +107,20 @@ createiso_skip = [
     ]

 [% if release.id_prefix == 'FEDORA' and release.version_int >= 26 %]
+[% if release.version_int >= 27 %]
+    [% set ostree_arches = ['x86_64', 'ppc64le', 'aarch64'] %]
+[% else %]
+    [% set ostree_arches = ['x86_64'] %]
+[% endif %]
 ostree = [
     ("^Everything$", {
-        "x86_64": {
+    [% for arch in ostree_arches %]
+        [% if arch == "x86_64" %]
+            [% set path = "fedora/linux" %]
+        [% else %]
+            [% set path = "fedora-secondary" %]
+        [% endif %]
+        "{{ arch }}": {
             [% if release.version_int >= 28 %]
                 "version": "!OSTREE_VERSION_FROM_LABEL_DATE_TYPE_RESPIN",
             [% endif %]
@@ -120,17 +131,18 @@ ostree = [
                 "Everything",
                 [% if request.name == 'testing' %]
                     # In the case of testing, also inject the last
stable updates
-                    "https://kojipkgs{{ env_suffix
}}.fedoraproject.org/pub/fedora/linux/updates/[[ release.version
]]/x86_64/"
+                    "https://kojipkgs{{ env_suffix
}}.fedoraproject.org/pub/[[ path ]]/updates/[[ release.version ]]/[[
arch ]]/"
                 [% endif %]
                 [% if release.version_int == 27 %]
-                    "https://kojipkgs{{ env_suffix
}}.fedoraproject.org/pub/fedora/linux/development/[[
release.version_int ]]/Everything/x86_64/os/"
+                    "https://kojipkgs{{ env_suffix
}}.fedoraproject.org/pub/[[ path ]]/development/[[ release.version_int
]]/Everything/[[ arch ]]/os/"
                 [% else %]
-                    "https://kojipkgs{{ env_suffix
}}.fedoraproject.org/pub/fedora/linux/releases/[[ release.version_int
]]/Everything/x86_64/os/"
+                    "https://kojipkgs{{ env_suffix
}}.fedoraproject.org/pub/[[ path ]]/releases/[[ release.version_int
]]/Everything/[[ arch ]]/os/"
                 [% endif %]
             ]
             "ostree_repo": "/mnt/koji/compose/updates/atomic",
             "tag_ref": False
-        }
+        },
+    [% endfor %]
     })
 ]
 [% endif %]

On Fri, Nov 10, 2017 at 11:52 PM, Patrick Uiterwijk
<puiterwijk@xxxxxxxxxx> wrote:
> Why must you point out my failures? :)
>
> diff --git a/roles/bodhi2/backend/templates/pungi.rpm.conf.j2
> b/roles/bodhi2/backend/templates/pungi.rpm.conf.j2
> index 1c6dc02..00b946a 100644
> --- a/roles/bodhi2/backend/templates/pungi.rpm.conf.j2
> +++ b/roles/bodhi2/backend/templates/pungi.rpm.conf.j2
> @@ -107,9 +107,20 @@ createiso_skip = [
>      ]
>
>  [% if release.id_prefix == 'FEDORA' and release.version_int >= 26 %]
> +{% if release.version_int >= 27 %}
> +    {% set ostree_arches = ['x86_64', 'ppc64le', 'aarch64'] %}
> +{% else %}
> +    {% set ostree_arches = ['x86_64'] %}
> +{% endif %}
>  ostree = [
>      ("^Everything$", {
> -        "x86_64": {
> +    {% for arch in ostree_arches %}
> +        {% if arch == "x86_64" %}
> +            {% set path = "fedora/linux" %}
> +        {% else %}
> +            {% set path = "fedora-secondary"
> +        {% endif %}
> +        "{{ arch }}": {
>              [% if release.version_int >= 28 %]
>                  "version": "!OSTREE_VERSION_FROM_LABEL_DATE_TYPE_RESPIN",
>              [% endif %]
> @@ -120,17 +131,18 @@ ostree = [
>                  "Everything",
>                  [% if request.name == 'testing' %]
>                      # In the case of testing, also inject the last
> stable updates
> -                    "https://kojipkgs{{ env_suffix
> }}.fedoraproject.org/pub/fedora/linux/updates/[[ release.version
> ]]/x86_64/"
> +                    "https://kojipkgs{{ env_suffix
> }}.fedoraproject.org/pub/{{ path }}/updates/[[ release.version ]]/{{
> arch }}/"
>                  [% endif %]
>                  [% if release.version_int == 27 %]
> -                    "https://kojipkgs{{ env_suffix
> }}.fedoraproject.org/pub/fedora/linux/development/[[
> release.version_int ]]/Everything/x86_64/os/"
> +                    "https://kojipkgs{{ env_suffix
> }}.fedoraproject.org/pub/{{ path }}/development/[[ release.version_int
> ]]/Everything/{{ arch }}/os/"
>                  [% else %]
> -                    "https://kojipkgs{{ env_suffix
> }}.fedoraproject.org/pub/fedora/linux/releases/[[ release.version_int
> ]]/Everything/x86_64/os/"
> +                    "https://kojipkgs{{ env_suffix
> }}.fedoraproject.org/pub/{{ path }}/releases/[[ release.version_int
> ]]/Everything/{{ arch }}/os/"
>                  [% endif %]
>              ]
>              "ostree_repo": "/mnt/koji/compose/updates/atomic",
>              "tag_ref": False
> -        }
> +        },
> +    {% endfor %}
>      })
>  ]
>  [% endif %]
>
> On Fri, Nov 10, 2017 at 11:39 PM, Dusty Mabe <dusty@xxxxxxxxxxxxx> wrote:
>>
>>
>> On 11/10/2017 05:18 PM, Patrick Uiterwijk wrote:
>>> Hi all,
>>>
>>> We can now do multi-arch ostrees for updates! \o/
>>> Can I get +1s to apply this patch to enable that for Fedora 27 and up?
>>>
>>> Thanks,
>>> Patrick
>>>
>>>
>>> diff --git a/roles/bodhi2/backend/templates/pungi.rpm.conf.j2
>>> b/roles/bodhi2/backend/templates/pungi.rpm.conf.j2
>>> index 1c6dc02..b0f6ab7 100644
>>> --- a/roles/bodhi2/backend/templates/pungi.rpm.conf.j2
>>> +++ b/roles/bodhi2/backend/templates/pungi.rpm.conf.j2
>>> @@ -107,9 +107,15 @@ createiso_skip = [
>>>      ]
>>>
>>>  [% if release.id_prefix == 'FEDORA' and release.version_int >= 26 %]
>>> +{% if release.version_int >= 27 %}
>>> +    {% set ostree_arches = ['x86_64', 'ppc64le', 'aarch64'] %}
>>> +{% else %}
>>> +    {% set ostree_arches = ['x86_64'] %}
>>> +{% endif %}
>>>  ostree = [
>>>      ("^Everything$", {
>>> -        "x86_64": {
>>> +    {% for arch in ostree_arches %}
>>> +        "{{ arch }}": {
>>>              [% if release.version_int >= 28 %]
>>>                  "version": "!OSTREE_VERSION_FROM_LABEL_DATE_TYPE_RESPIN",
>>>              [% endif %]
>>> @@ -120,17 +126,18 @@ ostree = [
>>>                  "Everything",
>>>                  [% if request.name == 'testing' %]
>>>                      # In the case of testing, also inject the last
>>> stable updates
>>> -                    "https://kojipkgs{{ env_suffix
>>> }}.fedoraproject.org/pub/fedora/linux/updates/[[ release.version
>>> ]]/x86_64/"
>>> +                    "https://kojipkgs{{ env_suffix
>>> }}.fedoraproject.org/pub/fedora/linux/updates/[[ release.version ]]/{{
>>> arch }}/"
>>>                  [% endif %]
>>>                  [% if release.version_int == 27 %]
>>> -                    "https://kojipkgs{{ env_suffix
>>> }}.fedoraproject.org/pub/fedora/linux/development/[[
>>> release.version_int ]]/Everything/x86_64/os/"
>>> +                    "https://kojipkgs{{ env_suffix
>>> }}.fedoraproject.org/pub/fedora/linux/development/[[
>>> release.version_int ]]/Everything/{{ arch }}/os/"
>>
>> some of the arches aren't primary - for example:
>> https://kojipkgs.fedoraproject.org/pub/fedora-secondary/releases/26/Everything/aarch64/
>>
>>
>>
>>>                  [% else %]
>>> -                    "https://kojipkgs{{ env_suffix
>>> }}.fedoraproject.org/pub/fedora/linux/releases/[[ release.version_int
>>> ]]/Everything/x86_64/os/"
>>> +                    "https://kojipkgs{{ env_suffix
>>> }}.fedoraproject.org/pub/fedora/linux/releases/[[ release.version_int
>>> ]]/Everything/{{ arch }}/os/"
>>>                  [% endif %]
>>>              ]
>>>              "ostree_repo": "/mnt/koji/compose/updates/atomic",
>>>              "tag_ref": False
>>> -        }
>>> +        },
>>> +    {% endfor %}
>>>      })
>>>  ]
>>>  [% endif %]
>>> _______________________________________________
>>> infrastructure mailing list -- infrastructure@xxxxxxxxxxxxxxxxxxxxxxx
>>> To unsubscribe send an email to infrastructure-leave@xxxxxxxxxxxxxxxxxxxxxxx
>>>
_______________________________________________
infrastructure mailing list -- infrastructure@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to infrastructure-leave@xxxxxxxxxxxxxxxxxxxxxxx




[Index of Archives]     [Fedora Development]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]

  Powered by Linux