Add new distribution and new product
Ways to add a new product to an existing distribution
Create distribution folder
cd /var/www/be mkdir data/distributions/%distribution-name%
Copy the template:
cp SW/templates/distribution.yaml ./
Convert the yaml to json:
yaml2json release.yaml (this will create a release.json file in the same dir)
Now we have a json file:
be$ release.json
1st approach - using the Database (DB)
Add the data manually to the DB:
- Product
- Distribution product data
Commands...
Examples:cat create_table.sql |sqlite3 db/egi-repos-fe-test.db
sqlite3 db/egi-repos-fe-test.db ".read insert_data.sql"
sqlite3 db/egi-repos-fe-test.db "select MAX(f1) from tbl2;" ".exit" sqlite3 db/egi-repos-fe-test.db "INSERT INTO tbl2 ('f1','f2','f3') VALUES('001','teste','ttttt');" ".exit"
INSERT INTO "main"."products" ("id", "name", "productName", "version", "majorVersion", "minorVersion", "revisionVersion", "distributionType", "distributionVersion", "description", "currentState", "contact", "technicalContact", "repositoryURL", "technologyProvider", "technologyProviderShortName", "releaseDate", "lastUpdated", "releaseNotes", "knownIssues", "changeLog", "additionalDetails", "installationNotes", "keywords", "apicallback", "documentationLinks", "capabilities", "capability", "targets", "softwareConfigurationLink") VALUES ('958', 'cesnet.rocci-server', 'rocci-server', '2.0.4', '2', '0', '4', 'CMD-ONE', '1.1.0', 'OCCI (the Open Cloud Computing Interface) is a standard defined by the Open Grid Forum, specifying a protocol and API to perform various remote management tasks in clouds. The rOCCI-server extends cloud managers, which are not OCCI-compliant natively, with its own OCCI interface. It is based on the rOCCI (Ruby OCCI) Framework. ', 'deployed', 'parak@cesnet.cz', 'parak@cesnet.cz', 'sw/production/cmd-one/1', 'CESNET', 'CESNET', '2018-11-12 12:34:40', '2018-11-12 12:34:40', 'https://github.com/the-rocci-project/rOCCI-server/releases/tag/v2.0.4', '', 'N/A', '', '', '[]', '', '{"documentationLink":{"link":"https:\/\/wiki.egi.eu\/wiki\/MAN10#EGI_Virtual_Machine_Management","type":"other"}}', '{"capability":{"value":"Client Tools","fullsupport":"yes"}}', '', '{"target":{"platform":"centos7","arch":"x86_64","repositoryURL":"sw\/production\/cmd-one\/1\/centos7\/x86_64\/updates","isnew":"no","ishidden":"no","displayVersion":"","apicallback":"http:\/\/admin-repo.egi.eu\/api\/report\/release\/xml?id=13797"}}', '');
Export/prepare all the data from DB (replacing the data in data/*)
$ export-full-dataset.sh
...................................................
php export-distributions.php
php export-distributions.php --individual-distributions
php export-products.php
php export-products.php --individual-products
2nd approach - add the data manually to the json files
Manually add product
cp release.json data/ cp release.json data/products/distribution-type/distribution-version/$productname(change this).json
add product data (to the products list in distribution):
data/distributions/distribution-type/$distribution-version.json (products[] array)
ex. of product item:
{ "productId": 32, "name": "emi.apel", "version": "3.2.7", "capabilities": ["Accounting"], "status": 1 }
add product full data (to the software catalog):
data/software-catalog.json (item[] array)
ex. of product item: (DON'T FORGET TO ADD A COMMA , BEFORE THE BRACKET)
, { "name": "bdii.site-bdii", "version": "1.2.1", "documentationLinks": [], "target": [ { "platform": "centos7", "arch": "x86_64", "repositoryURL": "sw\\/production\\/cmd-one\\/1\\/centos7\\/x86_64\\/updates", "gpgkey": "", "rpms": [], "status": 1 } ], "capabilities": ["Client Tools"], "currentState": "deployed", "technologyProvider": "BDII", "contact": "email of contact", "technicalContact": "email of contact", "description": "text description...", "releaseDate": "2018-11-12 12:34:40", "majorVersion": 1, "minorVersion": 2, "revisionVersion": 1, "releaseNotes": "http://gridinfo.web.cern.ch/developers/resource-bdii", "changeLog": "Same version as in SL6\n", "repositoryURL": "sw/production/cmd-one/1", "distributionType": "CMD-ONE", "distributionVersion": "1.1.0", "softwareConfigurationLink": "" }