Skip to content

server: api: rest: Show error message of the connection info #62

server: api: rest: Show error message of the connection info

server: api: rest: Show error message of the connection info #62

# This workflow performs continuous delivery (CD) to CM servers.
# This workflow will build the agent and server binaries. Then deploy to CM servers.
name: Deploy to CM Servers
on:
push:
branches:
- main
paths-ignore:
- "**.md"
- ".gitignore"
- "LICENSE"
- "CODEOWNERS"
- "agent/docs/**"
- "server/docs/**"
- "agent/scripts/**"
- "server/scripts/**"
# - "assets/**"
# - "scripts/**"
# - "src/testclient/scripts/**"
# - ".all-contributorsrc"
jobs:
build-and-deploy-agent:
name: Build and deploy agent
strategy:
matrix:
go-version: ["1.23.0"]
os: [ubuntu-22.04]
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{matrix.go-version}}
- name: Build
run: make -C agent
- name: Copy agent binary to NFS server
uses: appleboy/[email protected]
with:
host: ${{ secrets.CM_SERVER_IP_NFS }}
username: ${{ secrets.CM_SERVER_SSH_USER }}
password: ${{ secrets.CM_SERVER_SSH_PASSWORD }}
port: ${{ secrets.CM_SERVER_SSH_PORT }}
source: "agent/cmd/cm-honeybee-agent/cm-honeybee-agent"
strip_components: 3
target: "/tmp/"
overwrite: true
- name: Restart agent from NFS server with new binary
uses: appleboy/[email protected]
with:
host: ${{ secrets.CM_SERVER_IP_NFS }}
username: ${{ secrets.CM_SERVER_SSH_USER }}
password: ${{ secrets.CM_SERVER_SSH_PASSWORD }}
port: ${{ secrets.CM_SERVER_SSH_PORT }}
script: |
systemctl stop cm-honeybee-agent
mv -f /tmp/cm-honeybee-agent /usr/bin/cm-honeybee-agent
systemctl start cm-honeybee-agent
echo "[cm-honeybee-agent Version]"
/usr/bin/cm-honeybee-agent version
- name: Copy agent binary to Web server
uses: appleboy/[email protected]
with:
host: ${{ secrets.CM_SERVER_IP_WEB }}
username: ${{ secrets.CM_SERVER_SSH_USER }}
password: ${{ secrets.CM_SERVER_SSH_PASSWORD }}
port: ${{ secrets.CM_SERVER_SSH_PORT }}
source: "agent/cmd/cm-honeybee-agent/cm-honeybee-agent"
target: "/tmp/"
strip_components: 3
overwrite: true
- name: Restart agent from Web server with new binary
uses: appleboy/[email protected]
with:
host: ${{ secrets.CM_SERVER_IP_WEB }}
username: ${{ secrets.CM_SERVER_SSH_USER }}
password: ${{ secrets.CM_SERVER_SSH_PASSWORD }}
port: ${{ secrets.CM_SERVER_SSH_PORT }}
script: |
systemctl stop cm-honeybee-agent
mv -f /tmp/cm-honeybee-agent /usr/bin/cm-honeybee-agent
systemctl start cm-honeybee-agent
echo "[cm-honeybee-agent Version]"
/usr/bin/cm-honeybee-agent version
build-and-deploy-server:
name: Build and deploy server
strategy:
matrix:
go-version: ["1.23.0"]
os: [ubuntu-22.04]
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{matrix.go-version}}
- name: Build
run: make -C server
- name: Copy server binary to NFS server
uses: appleboy/[email protected]
with:
host: ${{ secrets.CM_SERVER_IP_NFS }}
username: ${{ secrets.CM_SERVER_SSH_USER }}
password: ${{ secrets.CM_SERVER_SSH_PASSWORD }}
port: ${{ secrets.CM_SERVER_SSH_PORT }}
source: "server/cmd/cm-honeybee/cm-honeybee"
target: "/tmp/"
strip_components: 3
overwrite: true
- name: Restart server from NFS server with new binary
uses: appleboy/[email protected]
with:
host: ${{ secrets.CM_SERVER_IP_NFS }}
username: ${{ secrets.CM_SERVER_SSH_USER }}
password: ${{ secrets.CM_SERVER_SSH_PASSWORD }}
port: ${{ secrets.CM_SERVER_SSH_PORT }}
script: |
systemctl stop cm-honeybee
mv -f /tmp/cm-honeybee /usr/bin/cm-honeybee
systemctl start cm-honeybee