|
1 | 1 | # ===============================================================
|
2 |
| -# Travis CI – two-stage build for the mcpgateway project |
| 2 | +# Travis CI – two‑stage build for the mcpgateway project |
3 | 3 | # ===============================================================
|
4 | 4 | #
|
5 |
| -# Stage ❶ build-test : |
6 |
| -# • Creates a Python venv → ~/.venv/mcpgateway |
7 |
| -# • Runs `make venv install` (== installs deps + project) |
8 |
| -# • Executes your lint / unit-test targets |
| 5 | +# Updated 2025‑06‑21 |
| 6 | +# • Moves to **Ubuntu 24.04 LTS (Noble Numbat)** build image |
| 7 | +# • Uses the distro‑default **Python 3.12** (no external PPAs) |
| 8 | +# • Installs only python3‑venv & python3‑dev from the main repo |
| 9 | +# • Keeps the existing two‑stage workflow (build‑test → docker) |
| 10 | +# |
| 11 | +# Stage ❶ build‑test : |
| 12 | +# • Creates Python venv → ~/.venv/mcpgateway |
| 13 | +# • Runs `make venv install` (deps + project) |
| 14 | +# • Executes lint / unit‑test targets |
9 | 15 | #
|
10 | 16 | # Stage ❷ docker :
|
11 |
| -# • Uses the same repo checkout (depth-1 clone) |
| 17 | +# • Uses the same repo checkout (depth‑1 clone) |
12 | 18 | # • Builds Containerfile → mcpgateway/mcpgateway:latest
|
13 | 19 | # • Starts the container and makes a quick health curl
|
14 | 20 | #
|
15 | 21 | # Requirements
|
16 |
| -# • Works on Travis "jammy" image (Ubuntu 22.04; Python 3.10) |
17 |
| -# • Docker daemon available via services: docker |
| 22 | +# • Works on Travis "noble" image (Ubuntu 24.04; system Python 3.12) |
| 23 | +# • Docker daemon available via services: docker |
18 | 24 | # ===============================================================
|
19 | 25 |
|
20 |
| -dist: jammy # Ubuntu 22.04 – up-to-date packages |
21 |
| -language: generic # we'll manage Python ourselves |
| 26 | +dist: noble # Ubuntu 24.04 – up‑to‑date packages |
| 27 | +language: generic # using the image's default Python 3.12 |
22 | 28 | services:
|
23 |
| - - docker # enable Docker Engine inside job |
| 29 | + - docker # enable Docker Engine inside job |
24 | 30 |
|
25 | 31 | git:
|
26 |
| - depth: 1 # shallow clone of current branch only |
| 32 | + depth: 1 # shallow clone of current branch only |
27 | 33 |
|
28 | 34 | # ────────────────────────────────────────────────────────────────
|
29 |
| -# Global helpers – available to *every* job |
| 35 | +# Ensure venv & build headers are available for system Python 3.12 |
30 | 36 | # ────────────────────────────────────────────────────────────────
|
| 37 | +addons: |
| 38 | + apt: |
| 39 | + update: true |
| 40 | + packages: |
| 41 | + - python3-venv # venv module for virtual environments |
| 42 | + - python3-dev # C headers for compiling wheels |
| 43 | + |
| 44 | +# Display Python version & prep environment |
31 | 45 | before_install:
|
32 |
| - - echo "🔧 Python version -> $(python3 --version)" |
33 |
| - - make venv install install-dev # make target that installs deps |
| 46 | + - echo "🔧 Python version -> $(python3 --version)" # should be 3.12.x |
| 47 | + - make venv install install-dev # installs deps |
34 | 48 | - source ~/.venv/mcpgateway/bin/activate
|
35 | 49 |
|
36 | 50 | # ────────────────────────────────────────────────────────────────
|
|
42 | 56 | # ❶ Lint / Tests
|
43 | 57 | # -----------------------------------------------------------
|
44 | 58 | - stage: "build-test"
|
45 |
| - name: "Lint + unit tests + package" |
| 59 | + name: "Lint + unit tests + package (Python 3.12)" |
46 | 60 | script:
|
47 |
| - - make dist # builds the package |
| 61 | + - make dist # builds the package |
48 | 62 |
|
49 | 63 | # -----------------------------------------------------------
|
50 | 64 | # ❷ Docker build + smoke test
|
|
54 | 68 | script: |
|
55 | 69 | set -e
|
56 | 70 | echo "🏗️ Building container…"
|
57 |
| - docker build -f Containerfile \ |
58 |
| - -t mcpgateway/mcpgateway:latest . |
| 71 | + docker build -f Containerfile -t mcpgateway/mcpgateway:latest . |
59 | 72 |
|
60 | 73 | echo "🚀 Launching container…"
|
61 | 74 | docker run -d --name mcpgateway -p 4444:4444 \
|
|
0 commit comments