Skip to content

Commit 53a316a

Browse files
authored
Merge pull request #4 from mend/OPS-5421-reportportal-mcp-server
Ops 5421 reportportal mcp server
2 parents 38dee5d + 4526a65 commit 53a316a

File tree

2 files changed

+41
-67
lines changed

2 files changed

+41
-67
lines changed
Lines changed: 36 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,45 @@
1-
name: Build and Push Docker Image
1+
name: Deploy Existing Image
22

33
on:
4-
push:
5-
branches:
6-
- main
7-
tags:
8-
- 'v*'
9-
pull_request:
10-
branches:
11-
- main
12-
13-
env:
14-
ECR_REGISTRY: ${{ vars.ECR_REGISTRY }}
15-
ECR_REPOSITORY: ${{ vars.ECR_REPOSITORY }}
16-
AWS_REGION: ${{ vars.AWS_REGION }}
4+
workflow_dispatch:
5+
inputs:
6+
image_tag:
7+
description: 'Image tag to deploy (e.g. v1.2.3)'
8+
required: true
9+
type: string
1710

1811
permissions:
19-
id-token: write
20-
contents: read
21-
actions: read
12+
contents: write
2213

2314
jobs:
24-
build-and-test:
15+
prepare:
2516
runs-on: [mend-self-hosted, profile=sast-qa]
26-
17+
outputs:
18+
TAG: ${{ steps.set-tag.outputs.TAG }}
2719
steps:
28-
- name: Checkout code
29-
uses: actions/checkout@v4
30-
31-
- name: Setup Go
32-
uses: actions/setup-go@v5
33-
with:
34-
go-version: '1.24.4'
35-
36-
- name: Install Task
37-
uses: arduino/setup-task@v2
38-
39-
- name: Run unit tests
40-
run: task test
41-
42-
- name: Run build (local Go binary)
43-
run: task app:build
44-
45-
- name: Configure AWS credentials
46-
uses: aws-actions/configure-aws-credentials@v4
47-
with:
48-
role-to-assume: ${{ vars.AWS_IAM_ROLE_ARN }}
49-
role-session-name: GitHubActionsSession
50-
aws-region: ${{ env.AWS_REGION }}
51-
52-
- name: Login to Amazon ECR
53-
id: login-ecr
54-
uses: aws-actions/amazon-ecr-login@v2
55-
56-
- name: Extract metadata
57-
id: meta
58-
uses: docker/metadata-action@v5
59-
with:
60-
images: ${{ steps.login-ecr.outputs.registry }}/${{ env.ECR_REPOSITORY }}
61-
tags: |
62-
type=ref,event=pr
63-
type=sha,prefix=sha-,format=short
64-
type=raw,value=latest,enable={{is_default_branch}}
65-
66-
- name: Build and push Docker image
67-
uses: docker/build-push-action@v5
20+
- id: set-tag
21+
run: echo "TAG=${{ github.event.inputs.image_tag }}" >> "$GITHUB_OUTPUT"
22+
23+
deploy-and-wait-for-sync:
24+
needs: [prepare]
25+
runs-on: [mend-self-hosted, profile=arch-small]
26+
env:
27+
IMAGE_TAG: ${{ needs.prepare.outputs.TAG }}
28+
steps:
29+
- name: Check out Mend helm-charts Repo
30+
uses: actions/checkout@v3
6831
with:
69-
context: .
70-
push: ${{ github.event_name != 'pull_request' }}
71-
tags: ${{ steps.meta.outputs.tags }}
72-
labels: ${{ steps.meta.outputs.labels }}
32+
repository: mend/helm-charts
33+
token: ${{ secrets.GH_TOKEN }}
34+
ref: main
35+
path: helm-charts-clone
36+
37+
- name: Change image in helm chart values file
38+
run: |
39+
cd ./helm-charts-clone/values/reportportal-mcp-server/infra
40+
sed -i 's/tag: .*/tag: '"${IMAGE_TAG}"'/g' ./values-infra-dev.yaml
41+
git config --global user.name 'AutoRelease'
42+
git config --global user.email 'AutoRelease'
43+
git add .
44+
git commit -m "GH Actions AutoRelease ${IMAGE_TAG}" || echo "No changes to commit"
45+
git push

Dockerfile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ FROM gcr.io/distroless/base-debian12
2323
WORKDIR /server
2424
# Copy the binary from the build stage
2525
COPY --from=build /build/reportportal-mcp-server .
26-
# Expose MCP SSE port (informational)
27-
EXPOSE 4389
28-
# Default to SSE mode on port 4389
29-
CMD ["./reportportal-mcp-server", "sse", "--addr", ":4389"]
26+
27+
ENTRYPOINT ["./reportportal-mcp-server"]
28+
29+
# Command to run the server
30+
CMD ["stdio"]

0 commit comments

Comments
 (0)