NXENG-374: add AGENTS.md with coding agent guidance #36
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Package Docker Image | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| package-docker-image: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Docker meta | |
| id: meta | |
| uses: docker/metadata-action@030e881283bb7a6894de51c315a6bfe6a94e05cf # v6.0.0 | |
| with: | |
| images: | | |
| docker-private.packages.nuxeo.com/nuxeo/nuxeo-mcp-server | |
| - name: Setup Python and install dependencies | |
| id: setup | |
| uses: ./.github/actions/setup-and-install-dep | |
| # Build the image | |
| - name: Set up QEMU | |
| if: github.event_name != 'pull_request' # needed when building multi-platform image and pushing it | |
| uses: docker/setup-qemu-action@ce360397dd3f832beb865e1373c09c0e9f86d70a # v4.0.0 | |
| - name: Set up Docker Buildx | |
| if: github.event_name != 'pull_request' # needed when building multi-platform image and pushing it | |
| uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0 | |
| - name: Build and export to Docker | |
| uses: docker/build-push-action@d08e5c354a6adb9ed34480a06d141179aa583294 # v7.0.0 | |
| with: | |
| context: . | |
| load: true | |
| build-args: | | |
| PYTHON_VERSION=${{ steps.setup.outputs.python-version }} | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| # Test the image | |
| - name: Login to Nuxeo Docker Registry | |
| uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 # v4.0.0 | |
| with: | |
| registry: docker-private.packages.nuxeo.com | |
| username: ${{ secrets.REPOSITORY_MANAGER_USERNAME }} | |
| password: ${{ secrets.REPOSITORY_MANAGER_PASSWORD }} | |
| - name: Start services with Docker Compose | |
| env: | |
| MCP_DOCKER_TAGS: ${{ steps.meta.outputs.tags }} | |
| run: | | |
| docker compose up -d | |
| - name: Wait for Nuxeo to start | |
| run: | | |
| echo "Waiting for Nuxeo to start..." | |
| timeout=300 | |
| start_time=$(date +%s) | |
| while ! curl -s http://localhost:8080/nuxeo/runningstatus > /dev/null; do | |
| current_time=$(date +%s) | |
| elapsed=$((current_time - start_time)) | |
| if [ $elapsed -gt $timeout ]; then | |
| echo "Timeout waiting for Nuxeo to start" | |
| exit 1 | |
| fi | |
| echo "Waiting for Nuxeo to start... ($elapsed seconds)" | |
| sleep 5 | |
| done | |
| echo "Nuxeo is running" | |
| - name: Initialize Nuxeo repository | |
| run: | | |
| uv run python seed_nuxeo.py --url http://localhost:8080/nuxeo --username Administrator --password Administrator | |
| - name: Wait for MCP Server to start | |
| run: | | |
| echo "Waiting for MCP Server to start..." | |
| timeout=60 | |
| start_time=$(date +%s) | |
| while ! curl -s http://localhost:8081/health > /dev/null; do | |
| current_time=$(date +%s) | |
| elapsed=$((current_time - start_time)) | |
| if [ $elapsed -gt $timeout ]; then | |
| echo "Timeout waiting for MCP Server to start" | |
| echo "=== MCP Server Logs ===" | |
| docker compose logs mcp | |
| exit 1 | |
| fi | |
| echo "Waiting for MCP Server to start... ($elapsed seconds)" | |
| sleep 2 | |
| done | |
| echo "MCP Server is running" | |
| echo "" | |
| echo "=== MCP Server Configuration (from /health endpoint) ===" | |
| curl -s http://localhost:8081/health | python -m json.tool | |
| echo "" | |
| echo "=== MCP Server Startup Logs ===" | |
| docker compose logs mcp | head -50 | |
| - name: Test search tool | |
| run: | | |
| uv run python mcp_client.py --url http://localhost:8081 search "SELECT * FROM Document WHERE ecm:primaryType = 'File'" | |
| - name: Test get-document tool | |
| run: | | |
| uv run python mcp_client.py --url http://localhost:8081 get-document --path "/default-domain" | |
| # Push the image | |
| - name: Build and push | |
| if: github.event_name != 'pull_request' | |
| uses: docker/build-push-action@d08e5c354a6adb9ed34480a06d141179aa583294 # v7.0.0 | |
| with: | |
| context: . | |
| platforms: linux/amd64,linux/arm64 | |
| push: true | |
| build-args: | | |
| PYTHON_VERSION=${{ steps.setup.outputs.python-version }} | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} |