Commit 1f15aded authored by Ikram Haq's avatar Ikram Haq
Browse files

Delete README.md file

parent 618592dd
Loading
Loading
Loading
Loading

README.md

deleted100644 → 0
+0 −71
Original line number Original line Diff line number Diff line
# doc2oas Automation!

The `doc2oas_automation_script.py` is a Python script designed to automate the process of OpenAPI Specification (OAS) generation from the MEC Specs. What the script does is: it downloads the latest MEC Specs from the ETSI Portal, generates OAS, and pushes the generated OAS to the doc2oas repository under the `auto_generated_oas` branch. The script utilizes Selenium, a very famous web automation tool, to interact with the ETSI portal and then handle the necessary operations.

## Key Features

-   **Automated Document Extraction:** The script navigates through the ETSI portal, searches for the available latest MEC Specs,  and if they're there, it downloads the most recent versions of the documents.
-   **Version Management:** The script manages the document versions, stores the latest downloaded versions, updates the script's configuration, and next time it checks the next available versions.
-   **Conversion to OAS Format:** The `doc2oas_automation_script.py` script uses the `doc2oas.sh` script and generates the OAS from the downloaded MEC Specs, ensuring that the specifications are ready for integration with API tools and platforms.
-   **ETSI Forge Integration:** After successful generation of the OAS, the script automatically adds, commits, and pushes the changes to `auto_generated_oas` branch in a ETSI Forge doc2oas repository, keeping the repository up-to-date with the latest document versions.
-   **OAS Versions:** The script keeps all the generated OAS files, so developers can use the required OAS file(s).
-   **Cron Job Support:** The script can be scheduled to run at specific intervals using a cron job, allowing for regular and automated updates.

## Prerequisites

Before using the `doc2oas_automation_script.py` script, make sure you have all the following prerequisites:

1.  **Install Google Chrome and ChromeDriver:** It is essential to use Google Chrome browser and ChromeDriver of the same versions. To install Google Chrome and ChromeDriver, follow these steps:
    
    -   Install Google Chrome by following the instructions provided in this [Google Chrome Installation Guide](https://operavps.com/docs/install-google-chrome-on-ubuntu/).
    -   Download the ChromeDriver zip file from the [ChromeDriver Download Page](https://googlechromelabs.github.io/chrome-for-testing/) and follow the steps below to install it:

### Installing ChromeDriver on Ubuntu

As mentioned in the previous step, after downloading the ChromeDriver zip file, follow these steps to install it on Ubuntu:

1.  **Unzip the ChromeDriver Zip File:** Extract the contents of the downloaded ChromeDriver zip file using the following command:
    
    ```bash
    unzip chromedriver_linux64.zip
    ```

2.  **Move ChromeDriver to a System Directory:** Move the extracted ChromeDriver binary to a directory that is included in the system's PATH. The `/usr/local/bin` directory is a common choice for this purpose. Use the following command:
    
    ```bash
    sudo mv chromedriver /usr/local/bin/
    ```

3.  **Set Permissions:** Make sure that the ChromeDriver binary has the necessary permissions to be executed. Use the following command:
    
    ```bash
    sudo chmod +x /usr/local/bin/chromedriver
    ```

4.  **Verify Installation:** Check if ChromeDriver is successfully installed by running the following command:
    
    ```bash
    chromedriver --version
    ```
    This should display the version of ChromeDriver installed.
    

### Python Environment

Ensure you have Python 3.x installed on your system
-   Credentials for the ETSI portal and ETSI Forge repository configured within the script.

## Getting Started

1.  Clone this repository to your local machine.
2.  Open the cloned folder, check out to the `auto_generated_oas` branch, and Install the required Python packages by running `pip install -r requirement.txt`.
3.  It is essential have **same versions** of Chrome browser and ChromeDriver. This compatibility between the browser and driver versions is crucial for seamless and reliable web automation using the `doc2oas_automation_script.py` script.
4.  Modify the script variables such as `username`, `password`, `document_list`, and others according to your requirements.
5.  Run the script manually to test the automation process: `python3 doc2oas_automation_script.py`.

## Note About Generated OpenAPIs

Note that while the `doc2oas_automation_script.py` tool aims to provide  OpenAPI specifications, the generated OpenAPIs may not always be 100% correct. The reason for this is that the configuration files, which are used to generate the specifications, need to be updated manually. In many cases, the configuration file remains the same for the latest version, but there are instances where modifications in the configuration files are required for the latest versions.
## Suggestions

Suggestions to further improve the automation of OAS generation are highly encouraged. If you identify areas for improvement or encounter issues feel free to raise issues.
 No newline at end of file