forked from IBM/mcp-context-forge
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.travis.yml
More file actions
85 lines (75 loc) · 3.65 KB
/
.travis.yml
File metadata and controls
85 lines (75 loc) · 3.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# ===============================================================
# Travis CI - two-stage build for the mcpgateway project
# ===============================================================
#
# Updated 2025-06-21
# - Moves to **Ubuntu 24.04 LTS (Noble Numbat)** build image
# - Uses the distro-default **Python 3.12** (no external PPAs)
# - Installs only python3-venv & python3-dev from the main repo
# - Keeps the existing two-stage workflow (build-test → docker)
#
# Stage ❶ build-test :
# - Creates Python venv → ~/.venv/mcpgateway
# - Runs `make venv install` (deps + project)
# - Executes lint / unit-test targets
#
# Stage ❷ docker :
# - Uses the same repo checkout (depth-1 clone)
# - Builds Containerfile → mcpgateway/mcpgateway:latest
# - Starts the container and makes a quick health curl
#
# Requirements
# - Works on Travis "noble" image (Ubuntu 24.04; system Python 3.12)
# - Docker daemon available via services: docker
# ===============================================================
dist: noble # Ubuntu 24.04 - up-to-date packages
language: generic # using the image's default Python 3.12
services:
- docker # enable Docker Engine inside job
git:
depth: 1 # shallow clone of current branch only
# ────────────────────────────────────────────────────────────────
# Ensure venv & build headers are available for system Python 3.12
# ────────────────────────────────────────────────────────────────
addons:
apt:
update: true
packages:
- python3-venv # venv module for virtual environments
- python3-dev # C headers for compiling wheels
# Display Python version & prep environment
before_install:
- echo "🔧 Python version -> $(python3 --version)" # should be 3.12.x
- make venv install install-dev # installs deps
- source ~/.venv/mcpgateway/bin/activate
# ────────────────────────────────────────────────────────────────
# Job matrix (two explicit stages)
# ────────────────────────────────────────────────────────────────
jobs:
include:
# -----------------------------------------------------------
# ❶ Lint / Tests
# -----------------------------------------------------------
- stage: "build-test"
name: "Lint + unit tests + package (Python 3.12)"
script:
- make dist # builds the package
# -----------------------------------------------------------
# ❷ Docker build + smoke test
# -----------------------------------------------------------
- stage: "docker"
name: "Build & run Docker image"
script: |
set -e
echo "🏗️ Building container..."
docker build -f Containerfile -t mcpgateway/mcpgateway:latest .
echo "🚀 Launching container..."
docker run -d --name mcpgateway -p 4444:4444 \
-e HOST=0.0.0.0 mcpgateway/mcpgateway:latest
echo "⏳ Waiting for startup..."
sleep 10
echo "🔍 Hitting health endpoint..."
curl -fsSL http://localhost:4444/health || {
echo "❌ Health check failed"; docker logs mcpgateway; exit 1;
}
echo "✅ Container is healthy!"