Skip to content

Commit

Permalink
Add directory_layouts to definitions [RHELDST-6065]
Browse files Browse the repository at this point in the history
  • Loading branch information
negillett committed Nov 11, 2024
1 parent 3a1dd86 commit d96de03
Show file tree
Hide file tree
Showing 4 changed files with 384 additions and 0 deletions.
48 changes: 48 additions & 0 deletions src/cdn_definitions/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,54 @@
"cfme_version_mappings": {
"0.0": "0.0"
},
"directory_layouts": [
{
"arch": true,
"major_version": true,
"minor_version": true,
"name": "DirectoryLayoutC",
"pattern": "/(?:content|shadow)/(?P<type>aus|dist|beta|(?:retired-)?els|eus|htb|rhb|tus|e4s)/(?P<platform>rhes|rhs|cf-me)/(?P<rhui>rhui/)?(?P<variant>[^/]+)/(?P<major_version>[0-9])\\.(?P<minor_version>[0-9]+)/(?P<arch>[^/]+)/(?P<rest>.+)$",
"platform": true,
"rest": true,
"rhui": true,
"type": true,
"variant": true
},
{
"arch": true,
"major_version": true,
"minor_version": true,
"name": "DirectoryLayoutD",
"pattern": "(?P<up_to_minor>/(?:content|shadow)/(?P<type>aus|dist|beta|(?:retired-)?els|eus|fastrack|htb|rhb|tus|e4s)/(?P<platform>cf-me|rhel|rhevh|rhes|rhs)/(?P<rhui>rhui/)?(?P<variant>[^/]+)/(?P<major_version>[0-7][^/]*))/(?P<minor_version>(?:\\$releasever|\\$[0-9]+|[34][AEW]S|[34]Desktop))/(?P<arch>[^/]+)/(?P<rest>.+)$",
"platform": true,
"rest": true,
"rhui": true,
"type": true,
"variant": true
},
{
"arch": true,
"major_version": true,
"name": "DirectoryLayoutE",
"pattern": "/(?:content|shadow)/(?P<type>aus|dist|beta|(?:retired-)?els|eus|fastrack|htb|rhb|rc|preview|tus|e4s)/(?P<platform>arm|cf-me|rhel|rhevh|rhes|rhs)/(?P<rhui>rhui/)?(?P<variant>[^/]+)/(?P<major_version>[0-9][^./]*)/(?P<arch>(?:arm|aarch64|ppc64|s390x|x86_64|multiarch|\\$basearch))/(?P<rest>.+)$",
"platform": true,
"rest": true,
"rhui": true,
"type": true,
"variant": true
},
{
"arch": true,
"major_version": true,
"name": "DirectoryLayoutF",
"pattern": "/(?:content|shadow)/(?P<type>aus|dist|beta|(?:retired-)?els|eus|fastrack|htb|rhb|preview|tus|e4s)/(?P<platform>cf-me|rhel|rhevh|rhes|rhs)/(?P<rhui>rhui/)?(?P<variant>[^/]+)/(?P<major_version>[0-9][^/]*)/(?:[567](?:Client|ComputeNode|Server|Workstation|Everything))/(?P<arch>(?:ppc64|s390x|x86_64|multiarch|\\$basearch))/(?!channel-dumps/)(?P<rest>.+)$",
"platform": true,
"rest": true,
"rhui": true,
"type": true,
"variant": true
}
],
"env_to_releasever_mappings": {
"prod": {
"current_rhel0_beta": "0.0",
Expand Down
172 changes: 172 additions & 0 deletions src/cdn_definitions/data.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -251,3 +251,175 @@ repo_overrides:
if_created_after: "2023-06-01T14:00:00Z"
key: example
value: true

# directory_layouts is used to define DirectoryLayout objects and consist of a
# pattern, to match against content URL, and attributes for the resulting
# object, often present as regex groups in the pattern.
#
# Allowed value types; string, bool, null
#
# With the exception of "rhelalt", which is expected to be stored as bool,
# a "true" value is used to signal that regex matching should be applied for the
# corresponding group in the pattern.
#
# E.g.;
# `type: true` == `type = re.match(...).group("type")`
# `type: false` == `type = False`
# `type: "dist"` == `type = "dist"`
directory_layouts:
- name: DirectoryLayoutC
# "/content/<type>/<platform>/<rhui>/<variant>/<major>.<minor>/<arch>/<rest>"
pattern: |-
(?x)^
/
(?:content|shadow)/
(?P<type>aus|dist|beta|(?:retired-)?els|eus|htb|rhb|tus|e4s)/
(?P<platform>rhes|rhs|cf-me)/
(?P<rhui>rhui/)?
(?P<variant>[^/]+)/
(?P<major_version>[0-9])\.(?P<minor_version>[0-9]+)/
(?P<arch>[^/]+)/
(?P<rest>.+)$
type: true
platform: true
rhui: true
variant: true
major_version: true
minor_version: true
arch: true
rest: true
- name: DirectoryLayoutD
# "/content/<type>/<platform>/<rhui>/<variant>/<major>/<minor>/<arch>/<rest>"
pattern: |-
(?x)^
(?P<up_to_minor>
/
(?:content|shadow)/
(?P<type>aus|dist|beta|(?:retired-)?els|eus|fastrack|htb|rhb|tus|e4s)/
(?P<platform>cf-me|rhel|rhevh|rhes|rhs)/
(?P<rhui>rhui/)?(?P<variant>[^/]+)/
(?P<major_version>[0-7][^/]*)
)
/
(?P<minor_version>(?:\$releasever|\$[0-9]+|[34][AEW]S|[34]Desktop))/
(?P<arch>[^/]+)/
(?P<rest>.+)$
type: true
platform: true
rhui: true
variant: true
major_version: true
minor_version: true
arch: true
rest: true
- name: DirectoryLayoutE
# "/content/<type>/<platform>/<rhui>/<variant>/<major>/<arch>/<rest>"
pattern: |-
(?x)^
/
(?:content|shadow)/
(?P<type>aus|dist|beta|(?:retired-)?els|eus|fastrack|htb|rhb|rc|preview|tus|e4s)/
(?P<platform>arm|cf-me|rhel|rhevh|rhes|rhs)/
(?P<rhui>rhui/)?
(?P<variant>[^/]+)/
(?P<major_version>[0-9][^./]*)/
(?P<arch>(?:arm|aarch64|ppc64|s390x|x86_64|multiarch|\$basearch))/
(?P<rest>.+)$
type: true
platform: true
rhui: true
variant: true
major_version: true
arch: true
rest: true
- name: DirectoryLayoutF
# "/content/<type>/<platform>/<rhui>/<variant>/<major>/<minor (no $releasever)/<arch>/<rest>"
pattern: |-
(?x)^
/
(?:content|shadow)/
(?P<type>aus|dist|beta|(?:retired-)?els|eus|fastrack|htb|rhb|preview|tus|e4s)/
(?P<platform>cf-me|rhel|rhevh|rhes|rhs)/
(?P<rhui>rhui/)?
(?P<variant>[^/]+)/
(?P<major_version>[0-9][^/]*)/
(?:[567](?:Client|ComputeNode|Server|Workstation|Everything))/
(?P<arch>(?:ppc64|s390x|x86_64|multiarch|\$basearch))/
(?!channel-dumps/)
(?P<rest>.+)$
type: true
platform: true
rhui: true
variant: true
major_version: true
arch: true
rest: true
- name: RhelAltLayout
# "/content/<type>/<platform>/<rhui>/<variant>/<major>/$releasever|<major>.<minor>|7$Variant/<vendor_arch>/<arch>/<rest>"
pattern: |-
(?x)^
/
(?:content|shadow)/
(?P<type>aus|dist|beta|(?:retired-)?els|eus|htb|rhb|tus|e4s)/
(?P<platform>rhel-alt)/
(?P<rhui>rhui/)?
(?P<variant>[^/]+)/
(?P<major_version>[0-9])/
(
(\$releasever)|7(Server|Client|ComputeNode|Workstation)|[0-9]\.
(?P<minor_version>[0-9]+)
)
/
(?P<vendor_arch>[^/]+)/
(?P<arch>[^/]+)/
(?P<rest>.+)$
type: true
platform: rhel
rhui: true
rhelalt: true
variant: true
major_version: true
minor_version: true
arch: true
rest: true
- name: ContentISOsLayout
# "/content/contentisos/
pattern: |-
(?x)^
/
content/
contentisos(
/
(?P<rest>.+)
)?$
type: dist
platform: rhel
major_version: 6
arch: x86_64
rest: ""
- name: SLESLayout
# "/content/dist/suse/server/[11/12/15]"
pattern: |-
(?x)^
/
content/
(?P<type>dist|beta)/
suse/server/
(?P<major>11|12|15)/
(?P<minor>sp[\d])/?
(?P<rest>.*)$
type: true
arch: "x86_64"
platform: "suse"
major_version: true
minor_version: true
rest: true
- name: PublicRepoFileLayout
pattern: |-
(?x)^
/
content/
public/
repofiles$
type: dist
repo: files
96 changes: 96 additions & 0 deletions src/cdn_definitions/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,99 @@
},
"type": "object"
},
"directory_layout": {
"additionalProperties": false,
"properties": {
"arch": {
"type": [
"string",
"boolean"
]
},
"layered_product": {
"type": [
"string",
"boolean"
]
},
"layered_product_version": {
"type": [
"string",
"boolean"
]
},
"major_version": {
"type": [
"string",
"boolean"
]
},
"minor_version": {
"type": [
"string",
"boolean"
]
},
"name": {
"type": "string"
},
"pattern": {
"type": "string"
},
"platform": {
"type": [
"string",
"boolean"
]
},
"product": {
"type": [
"string",
"boolean"
]
},
"repo": {
"type": "string"
},
"rest": {
"type": [
"string",
"boolean"
]
},
"rhelalt": {
"type": "boolean"
},
"rhui": {
"type": "boolean"
},
"type": {
"type": [
"string",
"boolean"
]
},
"variant": {
"type": [
"string",
"boolean"
]
}
},
"required": [
"name",
"pattern",
"type"
],
"type": "object"
},
"directory_layouts": {
"items": {
"$ref": "#/definitions/directory_layout"
},
"type": "array",
"uniqueItems": true
},
"env_to_releasever_mapping": {
"additionalProperties": false,
"patternProperties": {
Expand Down Expand Up @@ -350,6 +443,9 @@
"cfme_version_mappings": {
"$ref": "#/definitions/cfme_version_mappings_list"
},
"directory_layouts": {
"$ref": "#/definitions/directory_layouts"
},
"env_to_releasever_mappings": {
"$ref": "#/definitions/env_to_releasever_mapping"
},
Expand Down
Loading

0 comments on commit d96de03

Please sign in to comment.