diff --git a/README.md b/README.md index 7c56f86..34e3725 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,16 @@ [**2. Info**](#info)
[**3. Repositories**](#repositories)
[**4. Requirements**](#requirements)
+[4.1 Python](#python)
+[4.2 Packages](#packages)
[**5. Documentation**](#documentation)
+[5.1 Arguments](#arguments)
+[*5.1.1 Examples*](#examples)
+[5.2 Jenkins Pipeline](#jenkins-pipeline)
+[5.3 Data Structure of YAML Files](#data-structure-of-yaml-files)
+[*5.3.1 Supported Metrics*](#supported-metrics)
+[5.4 Jinja Templates](#jinja-templates)
+[5.5 Terraform Output Folder Structure](#terraform-output-folder-structure)
## **1. Description** @@ -17,31 +26,34 @@ This repository contains a first draft script that can use a specific YAML file - YAML files should be stored according to the business line (DE-3, DE-4, DE-7, EC-DE) within the respective business line folder! - Some YAML files have already been created for testing purposes based on the shared_configuration and coco_terraform_config repositories and were therefore added in this repository. > ⚠️ Currently the input from YAML filenames starting with the prefix **`TP_`** are supported! - - + + ## **3. Repositories** The following repositores have been used to create some YAML files. - [shared_configuration](https://atc.bmwgroup.net/bitbucket/projects/OPAPM/repos/shared_configuration) - [coco_terraform_config](https://atc.bmwgroup.net/bitbucket/projects/OPAPM/repos/coco_terraform_config) - + ## **4. Requirements** -### **Python** + +### 4.1 Python The used python version for running the script is 3.11.2. -### **Libraries** + +### 4.2 Packages Some python packages need to be installed. Please use the requirements.txt file to install missing packages. The command for installing the missing packages is: ```sh pip3 install --user -r requirements.txt ``` - + + ## **5. Documentation** The following section is just a small exhibit tailored to the use of the script. -### **Arguments** + +### 5.1 Arguments If the script needs to be used for local execution, then the following command should be used: - ``` .\generate.py ``` @@ -49,7 +61,8 @@ Please note that two arguments are necessary: - `` - Here it is necessary to provide the path to the folder where the yaml files are stored. Fore example, if the yaml files are stored within the DE-3 business line folder, then it is important to convey the correct path as an argument for the script, in this case `.\DE-3\`. It is also possible to provide multiple folders, but they have to be delimited by a comma when parsing, in this case `.\DE-3\,.\DE-4\,.\DE-7\`! - `` - If it is necessary to store the generated Terraform files to a specific location, then the correct path to that particular folder needs to be provided! Alternatively, the default path `.\output\` will be used which is within the current working directory of the script. -#### **Examples** + +#### *5.1.1 Examples* Here are some examples when executing the script: ```sh # The YAML Files are stored within the business line folder DE-3, in the same working directory as the script, and by the following command it is possible to generate the Terraform files and store them into the default output folder. @@ -77,7 +90,9 @@ Here are some examples when executing the script: # Note here: If all yaml files of the shared_configuration repository need to be provided as an input argument it would also suffice to use the following command: .\generate.py ..\shared_configuration\ ..\coco_terraform_config\ ``` -### **Jenkins Pipeline** + + +### 5.2 Jenkins Pipeline This is the link to the pipeline: [Pipeline CoCo SLO YAML 2 TF](https://jaws.bmwgroup.net/opapm/job/CoCo%20SLO%20YAML%202%20TF/). There are basically five main stages: - Fetch Repositories: @@ -89,11 +104,10 @@ This is the link to the pipeline: - Execute Script: The script is executed and the YAML files with the corresponding business lines - Push Changes: Once the script finished with its exection the changes will be pushed with a commit that just includes a timestamp. The changes will be pushed to the newly created branch as mentioned above! -### **Data Structure of the YAML Files** + +### 5.3 Data Structure of YAML Files The majority of the key and value pairs have been taken respectively from the [shared_configuration](https://atc.bmwgroup.net/bitbucket/projects/OPAPM/repos/shared_configuration/) repository. - > ⚠️ **Please make sure that the YAML File does not include any tabs otherwise the correct functionality cannot be assured!** - ```yaml slo_id: # - Order of the given SLO within the dashboard slo_name: # - Touchpoint Mobile or Vehicle @@ -137,7 +151,8 @@ slo_definition: - # ``` -#### **Supported Metrics** + +#### *5.3.1 Supported Metrics* Currently the following metrics are supported: ```yaml builtin:service.keyRequest.errors.fivexx.rate @@ -146,7 +161,8 @@ builtin:service.keyRequest.errors.fivexx.count builtin:service.errors.server.successCount builtin:service.errors.fivexx.successCount ``` -### **Jinja Templates** + +### 5.4 Jinja Templates Currently there are only five Jinja Templates setup to cover mainly five different types of metrics as mentioned before. They can be found within the jinja-templates folder. ```sh ├───jinja-templates @@ -162,7 +178,8 @@ Currently there are only five Jinja Templates setup to cover mainly five differe - terraform-template-4.j2 is used for builtin:service.errors.server.successCount - terraform-template-5.j2 is used for builtin:service.errors.fivexx.successCount -### **Terraform Output Folder Structure** + +### 5.5 Terraform Output Folder Structure The output folder structure will look like the following example: ```sh C:.s @@ -212,4 +229,4 @@ C:.s TP_Vehicle_eRoute.tf TP_Vehicle_FTS.tf TP_Vehicle_RTTI.tf -``` +``` \ No newline at end of file