JJB alignment across DCAE components - DCAE-CLI
[dcaegen2/platform/cli.git] / blueprint-generator / README.md
1 # Blueprint Generator 
2
3 This tool allows the user to create a blueprint from a component spec json file 
4
5 # Instructions for building the tool locally
6 - cd into the root directory of the project (where the pom is located)
7 - Run the command: mvn clean install
8 - This will create a jar file and a tar file
9 - Unzip the tar file within this target directory
10 - cd into the folder that was created
11 - Instructions on how to run the tool from this folder are below
12 - If you're on windows type this out before you add your flags 
13
14 ```bash
15 java -cp "lib/blueprint-generator-1.0.0-SNAPSHOT.jar;lib/*" org.onap.blueprintgenerator.core.BlueprintGenerator
16 ```
17
18 -If you're on linux type this out before you add your flags
19
20 ```bash
21 java -cp blueprint-generator/lib/blueprint-generator-1.0.0-SNAPSHOT.jar:blueprint-generator/lib/* org.onap.blueprintgenerator.core.BlueprintGenerator
22 ```
23
24
25 # Instructions for running BlueprintGenerator:
26
27 ## Instructions for running:
28
29
30 -Run the program on the command line with the following tags:
31 OPTIONS:
32 - -p: The path to where the final blueprint yaml file will be created (Required)
33 - -i: The path to the JSON spec file (required)
34 - -n: Name of the blueprint (optional)
35 - -t: the path to the import yaml file (optional)
36
37
38 If you're on windows it will look like this:
39  
40 ```bash
41 java -cp "lib/blueprint-generator-onap-0.0.1-SNAPSHOT.jar;lib/*" org.onap.blueprintgenerator.core.BlueprintGenerator -p Blueprints -i ComponentSpecs/TestComponentSpec.json -n HelloWorld
42 ```
43
44 If you're on linux it will look like this
45
46 ```bash
47 java -cp blueprint-generator/lib/blueprint-generator-0.0.1-SNAPSHOT.jar:blueprint-generator/lib/* org.onap.blueprintgenerator.core.BlueprintGenerator -p Blueprints -i ComponentSpecs/TestComponentSpec.json -n HelloWorld
48 ```
49
50 This command will create a blueprint from the component spec TestComponentSpec. The blueprint file name will be called HelloWorld.yaml and it will be in the directory Blueprints.
51
52 ## Extra information:
53 - The component spec must be of the same format as stated in the onap [readthedocs](https://onap.readthedocs.io/en/latest/submodules/dcaegen2.git/docs/sections/components/component-specification/common-specification.html#working-with-component-specs) page 
54 - If the tag says required then the program will not run without those tags being there
55 - If the tag says optional then it is not necessary to run the program with those tags
56 - If you do not add a -n tag the blueprint name will default to what it is in the component spec
57 - If the directory you specified in the -p tag does not already exist the directory will be created for you
58 - The -t flag will override the default imports set for the blueprints. To see an example of how the import yaml file should be structured see the testImports.yaml file under the folder TestCases.