Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add directory_layouts to definitions [RHELDST-6065] #47

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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": [
{
"name": "ChannelDumpsLayout",
"pattern": "(?x)^\n/\n(?:content|shadow)/\n(?P<type>aus|dist|beta|(?:retired-)?els|eus|htb|rhb|tus|e4s)/\n(?P<platform>rhel)/\n(?P<rhui>rhui/)?\n(?P<variant>[^/]+)/\n(?P<major_version>[0-9][^/]*)/\n(?:[567](?:Client|ComputeNode|Server|Workstation|Everything))/\n(?P<arch>[^/]+)/\n(?:channel\\-dumps/)?"
},
{
"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>[^/]+)/"
},
{
"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>[^/]+)/"
},
{
"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))/"
},
{
"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/)"
},
{
"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>[^/]+)/",
"platform": "rhel",
"rhelalt": true
},
{
"arch": "x86_64",
"major_version": "6",
"name": "ContentISOsLayout",
"pattern": "(?x)^\n/\ncontent/\ncontentisos(?:/)?",
"platform": "rhel",
"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])/?",
"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
127 changes: 127 additions & 0 deletions src/cdn_definitions/data.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -251,3 +251,130 @@ 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: ChannelDumpsLayout
# "/content/<type>/<platform>/<variant>/<major>/<minor>/<arch>/channel-dumps/"
pattern: |-
(?x)^
/
(?:content|shadow)/
(?P<type>aus|dist|beta|(?:retired-)?els|eus|htb|rhb|tus|e4s)/
(?P<platform>rhel)/
(?P<rhui>rhui/)?
(?P<variant>[^/]+)/
(?P<major_version>[0-9][^/]*)/
(?:[567](?:Client|ComputeNode|Server|Workstation|Everything))/
(?P<arch>[^/]+)/
(?:channel\-dumps/)?
- name: DirectoryLayoutC
# "/content/<type>/<platform>/<rhui>/<variant>/<major>.<minor>/<arch>/"
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>/"
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>/"
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>/"
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>/"
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
- 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
62 changes: 62 additions & 0 deletions src/cdn_definitions/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,65 @@
},
"type": "object"
},
"directory_layout": {
"additionalProperties": false,
"properties": {
"arch": {
"$ref": "#/definitions/arch"
},
"layered_product": {
"type": "string"
},
"layered_product_version": {
"type": "string"
},
"major_version": {
"$ref": "#/definitions/major_version_string"
},
"minor_version": {
"$ref": "#/definitions/major_version_string"
},
"name": {
"type": "string"
},
"pattern": {
"type": "string"
},
"platform": {
"type": "string"
},
"product": {
"type": "string"
},
"repo": {
"type": "string"
},
"rhelalt": {
"type": "boolean"
},
"rhui": {
"type": "boolean"
},
"type": {
"type": "string"
},
"variant": {
"type": "string"
}
},
"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 +409,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
45 changes: 45 additions & 0 deletions src/cdn_definitions/schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,48 @@ definitions:
$ref: "#/definitions/repo_override"
additionalProperties: false

directory_layout:
type: object
properties:
name:
type: string
pattern:
type: string
type:
type: string
variant:
type: string
arch:
$ref: "#/definitions/arch"
platform:
type: string
major_version:
$ref: "#/definitions/major_version_string"
minor_version:
$ref: "#/definitions/major_version_string"
rhui:
type: boolean
rhelalt:
type: boolean
product:
type: string
layered_product:
type: string
layered_product_version:
type: string
repo:
type: string
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 +373,7 @@ properties:
repo_overrides:
$ref: "#/definitions/repo_overrides"

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

additionalProperties: false
Loading