Skip to content

Commit 0eec2ff

Browse files
committed
Update travis file
1 parent 3e0250a commit 0eec2ff

File tree

1 file changed

+67
-27
lines changed

1 file changed

+67
-27
lines changed

.travis.yml

Lines changed: 67 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,72 @@
1-
sudo: false
2-
language: python
3-
python:
4-
- 3.11
1+
# ===============================================================
2+
# Travis CI – two-stage build for the mcpgateway project
3+
# ===============================================================
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
9+
#
10+
# Stage ❷ docker :
11+
# • Uses the same repo checkout (depth-1 clone)
12+
# • Builds Containerfile → mcpgateway/mcpgateway:latest
13+
# • Starts the container and makes a quick health curl
14+
#
15+
# Requirements
16+
# • Works on Travis "jammy" image (Ubuntu 22.04; Python 3.10)
17+
# • Docker daemon available via services: docker
18+
# ===============================================================
19+
20+
dist: jammy # Ubuntu 22.04 – up-to-date packages
21+
language: generic # we'll manage Python ourselves
522
services:
6-
- docker
7-
os:
8-
- linux
23+
- docker # enable Docker Engine inside job
24+
25+
git:
26+
depth: 1 # shallow clone of current branch only
27+
28+
# ────────────────────────────────────────────────────────────────
29+
# Global helpers – available to *every* job
30+
# ────────────────────────────────────────────────────────────────
931
before_install:
10-
- rm -f ~/.netrc
11-
- sudo cat /etc/apt/sources.list; sudo ls /etc/apt/sources.list.d/
12-
- sudo sed -i '/erlang/s/^/#/' /etc/apt/sources.list.d/*.list
13-
- sudo apt-get -qq update || true
14-
- sudo apt-get install -y aspell aspell-en || true
15-
- make venv
16-
- source ${HOME}/.venv/mcpgateway/bin/activate
17-
- pip install .[dev]
32+
- echo "🔧 Python version -> $(python3 --version)"
33+
- make venv install install-dev # make target that installs deps
34+
- source ~/.venv/mcpgateway/bin/activate
35+
36+
# ────────────────────────────────────────────────────────────────
37+
# Job matrix (two explicit stages)
38+
# ────────────────────────────────────────────────────────────────
1839
jobs:
1940
include:
20-
- stage: build
21-
script:
22-
- make lint | tee docs/docs/test/lint.md
23-
- stage: build
41+
# -----------------------------------------------------------
42+
# ❶ Lint / Tests
43+
# -----------------------------------------------------------
44+
- stage: "build-test"
45+
name: "Lint + unit tests + package"
2446
script:
25-
- docker build -f Containerfile --platform=linux/amd64 -t mcpgateway/mcpgateway .
26-
- docker images
27-
- docker run --name mcpgateway -p 4444:4444 -d mcpgateway/mcpgateway
28-
- docker ps -a && sleep 10
29-
- curl -X POST http://localhost:4444/servers -u admin:changeme
30-
- docker logs mcpgateway
31-
git:
32-
depth: false
47+
- make dist # builds the package
48+
49+
# -----------------------------------------------------------
50+
# ❷ Docker build + smoke test
51+
# -----------------------------------------------------------
52+
- stage: "docker"
53+
name: "Build & run Docker image"
54+
script: |
55+
set -e
56+
echo "🏗️ Building container…"
57+
docker build -f Containerfile \
58+
-t mcpgateway/mcpgateway:latest .
59+
60+
echo "🚀 Launching container…"
61+
docker run -d --name mcpgateway -p 4444:4444 \
62+
mcpgateway/mcpgateway:latest
63+
64+
echo "⏳ Waiting for startup…"
65+
sleep 10
66+
67+
echo "🔍 Hitting health endpoint…"
68+
curl -fsSL http://localhost:4444/health || {
69+
echo "❌ Health check failed"; docker logs mcpgateway; exit 1;
70+
}
71+
72+
echo "✅ Container is healthy!"

0 commit comments

Comments
 (0)