From 153145636f46ce5cd26528d7b2ad568f5bb568d6 Mon Sep 17 00:00:00 2001 From: Md Soharab Ansari Date: Fri, 13 Sep 2024 12:43:44 +0530 Subject: [PATCH] Update environments doc Signed-off-by: Md Soharab Ansari --- static/data/environments.json | 15 ++++++++++-- tools/README.md | 44 +++++++++++++++++++++++++++++++++++ tools/environments.py | 2 +- 3 files changed, 58 insertions(+), 3 deletions(-) create mode 100644 tools/README.md diff --git a/static/data/environments.json b/static/data/environments.json index 23dccb3f..d4bb97fa 100644 --- a/static/data/environments.json +++ b/static/data/environments.json @@ -43,6 +43,17 @@ } ] }, + { + "name": "Python (FastAPI)", + "logo": "/images/lang-logo/python-logo.svg", + "repo": "https://github.com/fission/environments/tree/master/python-fastapi", + "images": [ + { + "main": "python-fastapi-env", + "builder": "python-fastapi-builder" + } + ] + }, { "name": "PHP", "logo": "/images/lang-logo/php-logo.svg", @@ -71,8 +82,8 @@ "repo": "https://github.com/fission/environments/tree/master/jvm-jersey", "images": [ { - "main": "jvm-jersey-env-11", - "builder": "jvm-jersey-builder-11" + "main": "jvm-jersey-env-22", + "builder": "jvm-jersey-builder-22" } ] }, diff --git a/tools/README.md b/tools/README.md new file mode 100644 index 00000000..3705914e --- /dev/null +++ b/tools/README.md @@ -0,0 +1,44 @@ +# Tools + +- `environments.py` updates `static/data/environments.json`. +- `notes.py` generates content for changelog section in release notes. + +## Environments +### Updating the existing environments +Copy [environments.json](https://github.com/fission/environments/blob/master/environments.json) from [environments](https://github.com/fission/environments/tree/master) repository to `tools/` directory. + +Update the `static/data/environments.json` by running the command: +``` +python3 environments.py +``` + +### Adding a new environment +Add static data for new environment to `static/data/environments.json`: +Ex: For FastAPI environment +``` + { + "name": "Python (FastAPI)", + "logo": "/images/lang-logo/python-logo.svg", + "repo": "https://github.com/fission/environments/tree/master/python-fastapi", + "images": [] + }, +``` + +Add a key-value pair for new environment to `environments.py` `env_dict` dictionary. +Where key is the name of new environment in [environments.json](https://github.com/fission/environments/blob/master/environments.json) and +value is the name for new environment in `static/data/environments.json`. +``` + Python FastAPI Environment: Python (FastAPI) +``` + +Now, run the script. +``` +python3 environments.py +``` + +## ChangeLog +Copy the changelog section from draft release to a file `notes.txt`. +Run `notes.py` on it. +``` +python3 notes.py +``` diff --git a/tools/environments.py b/tools/environments.py index 2fd4b611..9fcfc0d6 100644 --- a/tools/environments.py +++ b/tools/environments.py @@ -5,6 +5,7 @@ 'JVM Jersey Environment': 'Java (JVM-Jersey)', 'Ruby Environment': 'Ruby', 'Python Environment': 'Python', + 'Python FastAPI Environment': 'Python (FastAPI)', 'Fission Binary Environment': 'Misc', 'PHP Environment': 'PHP', 'Dotnet 2 Environment': '.NET Core', @@ -29,7 +30,6 @@ def create_env_string(src_envs, dst_envs): num_envs = len(src_env) for i in range(0, num_envs): if name == env_dict[src_env[i]['name']]: - print(name) if 'image' in src_env[i] and 'builder' in src_env[i]: data_list.append({ "main": src_env[i]['image'],