Skip to content

Commit

Permalink
Merge pull request #3 from geo-engine/no-default-color
Browse files Browse the repository at this point in the history
No default color
  • Loading branch information
ChristianBeilschmidt authored Nov 28, 2023
2 parents 064fb8e + 9781a8f commit cd17d49
Show file tree
Hide file tree
Showing 268 changed files with 4,992 additions and 1,890 deletions.
20 changes: 20 additions & 0 deletions .generation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,23 @@ From the root of the repository run:
```bash
.generation/generate.py
```

## Dev-Mode

To run the generation in dev mode, run:

```bash
DEV_RUN=1 .generation/generate.py
```

This will skip the running of the container and instead use the local files.

## Update config.ini

To update the config.ini file, run:

```bash
.generation/update_config.py --backendTag pro-nightly-2023-11-28
```

This will set a new backend tag and increment the version number.
5 changes: 3 additions & 2 deletions .generation/config.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
[input]
backendTag = pro-nightly-2023-11-27
backendtag = pro-nightly-2023-11-28

[package]
name = geoengine_openapi_client
version = 0.0.1
version = 0.0.2
url = https://github.com/geo-engine/geoengine-python-openapi-client

15 changes: 10 additions & 5 deletions .generation/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from urllib import request
from urllib.error import URLError
import configparser
import json
import os
import shutil
import subprocess
Expand Down Expand Up @@ -36,7 +37,11 @@
# Generate the openapi.json file.
#
# Imitating manually fetching it, e.g.
# `wget http://localhost:3030/api/api-docs/openapi.json -O .generation/input/openapi.json`
#
# ```bash
# wget http://localhost:3030/api/api-docs/openapi.json -O - \
# | python -m json.tool --indent 2 > .generation/input/openapi.json
# ```
#
if not DEV_RUN:
print("Starting Geo Engine backend.", file=sys.stderr)
Expand All @@ -51,17 +56,17 @@
],
)

for _ in range(60):
for _ in range(90):
print("Requesting `openapi.json`….", file=sys.stderr)
try:
with request.urlopen(
"http://localhost:8080/api/api-docs/openapi.json",
timeout=10,
) as w:
api_json = w.read()
api_json = json.load(w)

with open(CWD / "input/openapi.json", "wb") as f:
f.write(api_json)
with open(CWD / "input/openapi.json", "w", encoding='utf-8') as f:
json.dump(api_json, f, indent=2)

print("Stored `openapi.json`.", file=sys.stderr)
break
Expand Down
Loading

0 comments on commit cd17d49

Please sign in to comment.