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 13, 2024
1 parent 3a1dd86 commit d8bfb3a
Show file tree
Hide file tree
Showing 4 changed files with 321 additions and 0 deletions.
45 changes: 45 additions & 0 deletions src/cdn_definitions/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,51 @@
"cfme_version_mappings": {
"0.0": "0.0"
},
"directory_layouts": [
{
"name": "DirectoryLayoutC",
"pattern": "(?x)^\n/\n(?:content|shadow)/\n(?P<type>aus|dist|beta|(?:retired-)?els|eus|htb|rhb|tus|e4s)/\n(?P<platform>rhes|rhs|cf-me)/\n(?P<rhui>rhui/)?\n(?P<variant>[^/]+)/\n(?P<major_version>[0-9])\\.(?P<minor_version>[0-9]+)/\n(?P<arch>[^/]+)/\n(?P<rest>.+)$"
},
{
"name": "DirectoryLayoutD",
"pattern": "(?x)^\n(?P<up_to_minor>\n /\n (?:content|shadow)/\n (?P<type>aus|dist|beta|(?:retired-)?els|eus|fastrack|htb|rhb|tus|e4s)/\n (?P<platform>cf-me|rhel|rhevh|rhes|rhs)/\n (?P<rhui>rhui/)?(?P<variant>[^/]+)/\n (?P<major_version>[0-7][^/]*)\n)\n/\n(?P<minor_version>(?:\\$releasever|\\$[0-9]+|[34][AEW]S|[34]Desktop))/\n(?P<arch>[^/]+)/\n(?P<rest>.+)$"
},
{
"name": "DirectoryLayoutE",
"pattern": "(?x)^\n/\n(?:content|shadow)/\n(?P<type>aus|dist|beta|(?:retired-)?els|eus|fastrack|htb|rhb|rc|preview|tus|e4s)/\n(?P<platform>arm|cf-me|rhel|rhevh|rhes|rhs)/\n(?P<rhui>rhui/)?\n(?P<variant>[^/]+)/\n(?P<major_version>[0-9][^./]*)/\n(?P<arch>(?:arm|aarch64|ppc64|s390x|x86_64|multiarch|\\$basearch))/\n(?P<rest>.+)$"
},
{
"name": "DirectoryLayoutF",
"pattern": "(?x)^\n/\n(?:content|shadow)/\n(?P<type>aus|dist|beta|(?:retired-)?els|eus|fastrack|htb|rhb|preview|tus|e4s)/\n(?P<platform>cf-me|rhel|rhevh|rhes|rhs)/\n(?P<rhui>rhui/)?\n(?P<variant>[^/]+)/\n(?P<major_version>[0-9][^/]*)/\n(?:[567](?:Client|ComputeNode|Server|Workstation|Everything))/\n(?P<arch>(?:ppc64|s390x|x86_64|multiarch|\\$basearch))/\n(?!channel-dumps/)\n(?P<rest>.+)$"
},
{
"name": "RhelAltLayout",
"pattern": "(?x)^\n/\n(?:content|shadow)/\n(?P<type>aus|dist|beta|(?:retired-)?els|eus|htb|rhb|tus|e4s)/\n(?P<platform>rhel-alt)/\n(?P<rhui>rhui/)?\n(?P<variant>[^/]+)/\n(?P<major_version>[0-9])/\n(\n (\\$releasever)|7(Server|Client|ComputeNode|Workstation)|[0-9]\\.\n (?P<minor_version>[0-9]+)\n)\n/\n(?P<vendor_arch>[^/]+)/\n(?P<arch>[^/]+)/\n(?P<rest>.+)$",
"platform": "rhel",
"rhelalt": true
},
{
"arch": "x86_64",
"major_version": "6",
"name": "ContentISOsLayout",
"pattern": "(?x)^\n/\ncontent/\ncontentisos(\n /\n (?P<rest>.+)\n)?$",
"platform": "rhel",
"rest": "",
"type": "dist"
},
{
"arch": "x86_64",
"name": "SLESLayout",
"pattern": "(?x)^\n/\ncontent/\n(?P<type>dist|beta)/\nsuse/server/\n(?P<major_version>11|12|15)/\n(?P<minor_version>sp[\\d])/?\n(?P<rest>.*)$",
"platform": "suse"
},
{
"name": "PublicRepoFileLayout",
"pattern": "(?x)^\n/\ncontent/\npublic/\nrepofiles$",
"repo": "files",
"type": "dist"
}
],
"env_to_releasever_mappings": {
"prod": {
"current_rhel0_beta": "0.0",
Expand Down
114 changes: 114 additions & 0 deletions src/cdn_definitions/data.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -251,3 +251,117 @@ 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,
# at least, a name and a pattern to match against content URL. Attributes for
# the DirectoryLayout object can be overridden here, otherwise an attempt will
# be made to fill them from the pattern.
#
# Allowed value types; string, boolean, null
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>[^/]+)/
- 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>[^/]+)/
- 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))/
- 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/)
- 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>[^/]+)/
platform: rhel
rhelalt: true
- name: ContentISOsLayout
# "/content/contentisos/
pattern: |-
(?x)^
/
content/
contentisos(/)?
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_version>11|12|15)/
(?P<minor_version>sp[\d])/?
arch: "x86_64"
platform: "suse"
- name: PublicRepoFileLayout
pattern: |-
(?x)^
/
content/
public/
repofiles$
type: dist
repo: files
95 changes: 95 additions & 0 deletions src/cdn_definitions/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,98 @@
},
"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": "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 +442,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
67 changes: 67 additions & 0 deletions src/cdn_definitions/schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,70 @@ definitions:
$ref: "#/definitions/repo_override"
additionalProperties: false

directory_layout:
type: object
properties:
name:
type: string
pattern:
type: string
type:
type:
- string
- boolean
variant:
type:
- string
- boolean
arch:
type:
- string
- boolean
platform:
type:
- string
- boolean
major_version:
type:
- string
- boolean
minor_version:
type:
- string
- boolean
rhui:
type: boolean
rhelalt:
type: boolean
product:
type:
- string
- boolean
layered_product:
type:
- string
- boolean
layered_product_version:
type:
- string
- boolean
repo:
type: string
rest:
type:
- string
- boolean
required:
- name
- pattern
additionalProperties: false

directory_layouts:
type: array
items:
$ref: "#/definitions/directory_layout"
uniqueItems: true

type: object
properties:

Expand Down Expand Up @@ -331,4 +395,7 @@ properties:
repo_overrides:
$ref: "#/definitions/repo_overrides"

directory_layouts:
$ref: "#/definitions/directory_layouts"

additionalProperties: false

0 comments on commit d8bfb3a

Please sign in to comment.