Skip to content

Commit 78e938f

Browse files
committed
ci: replace custom chart justfile with centralised hotosm/justfiles
1 parent 645295d commit 78e938f

File tree

3 files changed

+45
-171
lines changed

3 files changed

+45
-171
lines changed

Justfile

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
set dotenv-load
22

33
mod test 'tasks/test'
4-
mod chart 'tasks/chart'
54
mod docs 'tasks/docs'
65

76
# List available commands
@@ -13,6 +12,18 @@ default:
1312
help:
1413
just --justfile {{justfile()}} --list
1514

15+
# Prep module from https://github.com/hotosm/justfiles
16+
prep *args:
17+
@curl -sS https://raw.githubusercontent.com/hotosm/justfiles/main/prep.just \
18+
-o {{justfile_directory()}}/tasks/prep.just;
19+
@just --justfile {{justfile_directory()}}/tasks/prep.just {{args}}
20+
21+
# Chart module from https://github.com/hotosm/justfiles
22+
chart *args:
23+
@curl -sS https://raw.githubusercontent.com/hotosm/justfiles/main/chart.just \
24+
-o {{justfile_directory()}}/tasks/chart.just;
25+
@just --justfile {{justfile_directory()}}/tasks/chart.just --set chart_name "scaleodm" {{args}}
26+
1627
# Install curl if missing
1728
[private]
1829
_install-curl:
@@ -191,6 +202,37 @@ example-python:
191202
echo "Shutting down containers..."
192203
docker compose down --remove-orphans
193204

205+
# Example the API usage via pyodm SDK
206+
example-pyodm:
207+
#!/usr/bin/env bash
208+
set -euo pipefail
209+
210+
just test cluster-available
211+
212+
echo "Starting API..."
213+
docker compose up --wait --detach api
214+
215+
echo "Running pyodm example inside container..."
216+
docker run --rm \
217+
--network host \
218+
--env-file .env \
219+
-v "$PWD/examples/pyodm:/app" \
220+
--workdir /app \
221+
-e PYTHONDONTWRITEBYTECODE=1 \
222+
-e PYTHONUNBUFFERED=1 \
223+
-e PYTHONFAULTHANDLER=1 \
224+
docker.io/python:3.13-slim-trixie \
225+
bash -lc '
226+
set -euo pipefail
227+
python -V
228+
pip install --no-cache-dir uv
229+
uv sync
230+
uv run python main.py
231+
'
232+
233+
echo "Shutting down containers..."
234+
docker compose down --remove-orphans
235+
194236
# Echo to terminal with blue colour
195237
[no-cd]
196238
_echo-blue text:

tasks/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Justfiles imported from https://github.com/hotosm/justfiles
2+
*.just

tasks/chart

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

0 commit comments

Comments
 (0)