Skip to main content

Add new distribution

Ways to add a new distribution

Create distribution folder:

cd /var/www/be    
mkdir data/distributions/%distribution-name%

Use/Copy the template:

cp SW/templates/distribution.yaml  ./

Convert the yaml to json:

yaml2json distribution.yaml (this will create a distribution.json file in the same dir)

Now we have a json file:

be$ distribution.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:

{
  "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
        }
     ]
}