Support specifying upload options for image builds
The upload options are expected to be provided as a JSON file. The same options will be used for all image type and architecture combinations, similarly as it is done for ostree options. Extend unit tests to cover the newly added functionality.
This commit is contained in:
parent
4e32ae5439
commit
c76e97ddc9
4 changed files with 151 additions and 0 deletions
|
|
@ -94,6 +94,15 @@ OSBUILD_IMAGE_SCHEMA = {
|
|||
"type": "object",
|
||||
"$ref": "#/definitions/ostree"
|
||||
},
|
||||
"upload_options": {
|
||||
"oneOf": [
|
||||
{"$ref": "#/definitions/AWSEC2UploadOptions"},
|
||||
{"$ref": "#/definitions/AWSS3UploadOptions"},
|
||||
{"$ref": "#/definitions/GCPUploadOptions"},
|
||||
{"$ref": "#/definitions/AzureUploadOptions"},
|
||||
{"$ref": "#/definitions/ContainerUploadOptions"}
|
||||
],
|
||||
},
|
||||
"repo": {
|
||||
"type": "array",
|
||||
"description": "Repositories",
|
||||
|
|
@ -113,6 +122,91 @@ OSBUILD_IMAGE_SCHEMA = {
|
|||
"description": "Omit tagging the result"
|
||||
}
|
||||
}
|
||||
},
|
||||
"AWSEC2UploadOptions": {
|
||||
"type": "object",
|
||||
"additionalProperties": False,
|
||||
"required": ["region", "share_with_accounts"],
|
||||
"properties": {
|
||||
"region": {
|
||||
"type": "string",
|
||||
},
|
||||
"snapshot_name": {
|
||||
"type": "string",
|
||||
},
|
||||
"share_with_accounts": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"AWSS3UploadOptions": {
|
||||
"type": "object",
|
||||
"additionalProperties": False,
|
||||
"required": ["region"],
|
||||
"properties": {
|
||||
"region": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"AzureUploadOptions": {
|
||||
"type": "object",
|
||||
"additionalProperties": False,
|
||||
"required": ["tenant_id", "subscription_id", "resource_group", "location"],
|
||||
"properties": {
|
||||
"tenant_id": {
|
||||
"type": "string"
|
||||
},
|
||||
"subscription_id": {
|
||||
"type": "string"
|
||||
},
|
||||
"resource_group": {
|
||||
"type": "string"
|
||||
},
|
||||
"location": {
|
||||
"type": "string"
|
||||
},
|
||||
"image_name": {
|
||||
"type": "string",
|
||||
}
|
||||
}
|
||||
},
|
||||
"GCPUploadOptions": {
|
||||
"type": "object",
|
||||
"additionalProperties": False,
|
||||
"required": ["region", "bucket"],
|
||||
"properties": {
|
||||
"region": {
|
||||
"type": "string"
|
||||
},
|
||||
"bucket": {
|
||||
"type": "string"
|
||||
},
|
||||
"image_name": {
|
||||
"type": "string",
|
||||
},
|
||||
"share_with_accounts": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"ContainerUploadOptions": {
|
||||
"type": "object",
|
||||
"additionalProperties": False,
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"tag": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue