Skip to content

Commit 27d3e9b

Browse files
committed
return rune instructions
1 parent 433c076 commit 27d3e9b

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ RUN --mount=type=ssh source /.venv/bin/activate \
8989
&& chmod a+x /docker-entrypoint.sh \
9090
&& true
9191

92+
RUN mkdir -p /opt/templates \
93+
&& curl -L https://github.com/pvarki/rune-fake-metadata/releases/latest/download/rune.json -o /opt/templates/rune-fake.json
9294

9395
#########################
9496
# Main production build #
@@ -122,6 +124,8 @@ RUN --mount=type=ssh apt-get update && apt-get install -y \
122124
&& true
123125
ENTRYPOINT ["/usr/bin/tini", "--", "/docker-entrypoint.sh"]
124126

127+
RUN mkdir -p /opt/templates \
128+
&& curl -L https://github.com/pvarki/rune-fake-metadata/releases/latest/download/rune.json -o /opt/templates/rune-fake.json
125129

126130
#####################################
127131
# Base stage for development builds #
@@ -133,6 +137,8 @@ RUN --mount=type=ssh source /.venv/bin/activate \
133137
&& poetry install --no-interaction --no-ansi \
134138
&& true
135139

140+
RUN mkdir -p /opt/templates \
141+
&& curl -L https://github.com/pvarki/rune-fake-metadata/releases/latest/download/rune.json -o /opt/templates/rune-fake.json
136142

137143
#0############
138144
# Run tests #

src/rmfpapi/api/instructions.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@
1414
@router.post("/{language}")
1515
async def user_intructions(user: UserCRUDRequest) -> Dict[str, str]:
1616
"""return user instructions"""
17-
return {
18-
"callsign": user.callsign,
19-
"instructions": "FIXME: Return something sane",
20-
"language": "en",
21-
}
17+
instructions_json_file = Path("/opt/templates/rune-fake.json")
18+
19+
tak_instructions_data = json.loads(instructions_json_file.read_text(encoding="utf-8"))
20+
21+
return {"callsign": user.callsign, "instructions": json.dumps(tak_instructions_data), "language": language}
22+

0 commit comments

Comments
 (0)