Migrate from cnr -> appr
This commit is contained in:
parent
fe6760749a
commit
6336a4a971
16 changed files with 106 additions and 68 deletions
|
@ -1,7 +1,7 @@
|
|||
import bisect
|
||||
|
||||
from cnr.exception import PackageAlreadyExists
|
||||
from cnr.models.package_base import manifest_media_type
|
||||
from appr.exception import PackageAlreadyExists
|
||||
from appr.models.package_base import manifest_media_type
|
||||
|
||||
from data.database import (db_transaction, get_epoch_timestamp, Manifest, ManifestList, Tag,
|
||||
ManifestListManifest, Blob, ManifestBlob)
|
||||
|
@ -10,6 +10,7 @@ from data.oci_model import (blob as blob_model, manifest as manifest_model,
|
|||
tag as tag_model)
|
||||
|
||||
|
||||
# @TODO(ant31): cnr for retro-compat prepare a data migration
|
||||
LIST_MEDIA_TYPE = 'application/vnd.cnr.manifest.list.v0.json'
|
||||
SCHEMA_VERSION = 'v0'
|
||||
|
||||
|
@ -103,7 +104,7 @@ def create_app_release(repo, tag_name, manifest_data, digest, force=False):
|
|||
list_json.insert(insert_point, manifest.manifest_json)
|
||||
list_manifest_ids.insert(insert_point, manifest.id)
|
||||
manifestlist = manifest_list_model.get_or_create_manifest_list(list_json, LIST_MEDIA_TYPE,
|
||||
SCHEMA_VERSION)
|
||||
SCHEMA_VERSION)
|
||||
manifest_list_model.create_manifestlistmanifest(manifestlist, list_manifest_ids, list_json)
|
||||
|
||||
tag = tag_model.create_or_update_tag(repo, tag_name, manifest_list=manifestlist,
|
||||
|
|
Reference in a new issue