def _generate_packages_dict(self, package_files):
package_json = json.loads(package_files[_package_json_filename], object_pairs_hook=collections.OrderedDict)
package_json['releaseVersion'] = 0
package_json['packagingVersion'] = '{}.0'.format(self._cosmos_packaging_version)
command_json = package_files.get(_command_json_filename)
if command_json is not None:
package_json['command'] = json.loads(command_json, object_pairs_hook=collections.OrderedDict)
config_json = package_files.get(_config_json_filename)
if config_json is not None:
package_json['config'] = json.loads(config_json, object_pairs_hook=collections.OrderedDict)
marathon_json = package_files.get(_marathon_json_filename)
if marathon_json is not None:
package_json['marathon'] = {
'v2AppMustacheTemplate': base64.standard_b64encode(bytearray(marathon_json, 'utf-8')).decode()}
resource_json = package_files.get(_resource_json_filename)
if resource_json is not None:
package_json['resource'] = json.loads(resource_json, object_pairs_hook=collections.OrderedDict)
return {'packages': [package_json]}
评论列表
文章目录