Skip to content

Commit ea34a15

Browse files
contributing
1 parent 08d2abb commit ea34a15

File tree

4 files changed

+37
-21
lines changed

4 files changed

+37
-21
lines changed

.build.py

Lines changed: 0 additions & 19 deletions
This file was deleted.

.build/build-manifest.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# create a json description of all the projects with links and names
2+
# frontend will embed the json and display on the docs page
3+
4+
import os
5+
import json
6+
7+
8+
# covert example directory into a line item
9+
def example_item(path):
10+
return {"name": path.replace("-", " ").title(), "url": github + path, "directory": path}
11+
12+
13+
# get a list of directories in the example project
14+
manifest_path = os.environ["MANIFEST_PATH"]
15+
github = "https://www.github.com/mailslurp/examples/tree/master/"
16+
directories = next(os.walk(os.environ["ROOT"]))[1]
17+
directories = [path for path in directories if "." not in path]
18+
19+
# map each directory and save the json
20+
links = list(map(example_item, directories))
21+
json_object = json.dumps({"links": links}, indent=2)
22+
with open(manifest_path, 'w+') as output_file:
23+
output_file.write(json_object)
24+
25+
print(f'Build complete. {manifest_path} file written')

CONTRIBUTING.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Contributing
2+
This repository contains examples projects for MailSlurp.
3+
4+
## Testing
5+
Hosted on Github the project uses many actions inside .github folder to run tests in each example directory.
6+
Each action typically sets an API_KEY env variable and runs `make test`.
7+
8+
## Server

Makefile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
build:
2-
python3 .build.py
1+
build: build-manifest
2+
3+
build-manifest:
4+
ROOT=$(PWD) MANIFEST_PATH=$(PWD)/.manifest.json python3 .build/build-manifest.py
35

46
ci-env:
57
echo "API_KEY=$$API_KEY" > .env

0 commit comments

Comments
 (0)