Skip to content

Commit

Permalink
Update environments doc
Browse files Browse the repository at this point in the history
Signed-off-by: Md Soharab Ansari <[email protected]>
  • Loading branch information
soharab-ic committed Sep 13, 2024
1 parent 56d917c commit 1531456
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 3 deletions.
15 changes: 13 additions & 2 deletions static/data/environments.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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"
}
]
},
Expand Down
44 changes: 44 additions & 0 deletions tools/README.md
Original file line number Diff line number Diff line change
@@ -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
```
2 changes: 1 addition & 1 deletion tools/environments.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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'],
Expand Down

0 comments on commit 1531456

Please sign in to comment.