Add new product to an existing distribution
Ways to add a new product to an existing distribution
Steps to add a new product to a distribution
dir structure:
/var/www/be/ data/ (The latest json data for the FE) ├── config.js ├── distributions/ │ ├── CMD-ONE │ │ ├── 0.0.0.json │ │ └── ... │ ├── CMD-OS │ │ ├── 0.0.0.json │ │ └── ... │ ├── UMD │ │ ├── 1.0.0.json │ │ └── ... ├── products/ │ ├── CMD-ONE │ │ ├── 0.0.0/ │ │ │ └── productname.json │ │ │ └── ... │ ├── CMD-OS │ │ ├── 0.0.0/ │ │ │ └── productname.json │ │ │ └── ... │ ├── UMD │ │ ├── 1.0.0/ │ │ │ └── productname.json │ │ │ └── ... ├── software-catalog.json (Complete list of products) ├── software-distributions.json (Complete list of distributions) │ templates/ (All the templates needed to convert yaml to json or using json directly) ├── product.yaml ├── distribution.yaml ├── product.json └── distribution.json
For both approaches the first step is always convert/prepare the release.json
cd /var/www/be
Copy the template:
cp SW/templates/product.yaml ./release.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...
cat create_table.sql |sqlite3 db/egi-repos-fe-test.db
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:
{
"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": ""
}