Add new distribution
Ways to add a new distribution
cd /var/www/be
Create distribution folder:
mkdir data/distributions/%distribution-name%
Use/Copy the template:
cp SW/templates/distribution.yaml ./
Convert the yaml to json: (need to have node.js installed)
yaml2json distribution.yaml (this will create a distribution.json file in the same dir)
Now we have a json file:
distribution.json
Rename it to the distribution-name:
mv distribution.json %distribution-name%.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 `distributions_test`distributions`( distributionType, distributionVersion, currentState, majorVersion, minorVersion, revisionVersion, releaseDate, created, lastUpdated, description, repositoryURL, releaseNotes, additionalDetails, installationNotes, contact, technicalContact, knownIssues, changeLog ) VALUES ('','','','','','','','','','','','','','','','','','');
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 (Each distribution)
php export-products.php
php export-products.php --individual-products (Each product)
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:
{ "distributionType": "", "distributionVersion": "%version%0.0.0", "currentState": "deployed", "majorVersion": 0, "minorVersion": 0, "revisionVersion": 0, "releaseDate": "", "created": "", "lastUpdated": "", "description": "", "repositoryURL": "sw/production/%distribution-type%/%version-first-digit%0", "releaseNotes": "", "additionalDetails": "", "installationNotes": "", "contact": "", "technicalContact": "", "knownIssues": "", "changeLog": "" }
add distribution data (to the software distributions catalog):
data/software-distributions.json (item[] array)
ex. of distribution item: (DON'T FORGET TO ADD A COMMA , BEFORE THE BRACKETS)
, { "distributionType": "", "distributionVersion": "%version%0.0.0", "currentState": "deployed", "releaseDate": "", "description": "", "products": [ { "name": "product-name", "version": "0.0.0", "capabilities": ["Client Tools"], "status": 1 } ] }