Skip to main content

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...

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:


 {
      "productId": 32,
      "name": "emi.apel",
      "version": "3.2.7",
      "capabilities": ["Accounting"],
      "status": 1
    }