first commit
This commit is contained in:
27
cmii-uav-watchdog-agent/build_and_run_watchdog_agent.ps1
Normal file
27
cmii-uav-watchdog-agent/build_and_run_watchdog_agent.ps1
Normal file
@@ -0,0 +1,27 @@
|
||||
|
||||
|
||||
try {
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
Write-Host "1. Building binary exec file..." -ForegroundColor Cyan
|
||||
& "C:\Users\wdd\go\bin\gox.exe" -osarch="linux/amd64" -output "build/cmii-watchdog_linux_amd64"
|
||||
|
||||
# 执行远程ssh命令 ssh root@192.168.35.70 "rm /root/cmii-watchdog"
|
||||
Write-Host "2. Cleaning old binary file..." -ForegroundColor Yellow
|
||||
ssh root@192.168.35.70 "rm -f /root/wdd/cmii-watchdog/*"
|
||||
|
||||
Write-Host "3. Uploading binary exec..." -ForegroundColor Green
|
||||
scp build/cmii-watchdog_linux_amd64 root@192.168.35.70:/root/wdd/cmii-watchdog/
|
||||
scp java/* root@192.168.35.70:/root/wdd/cmii-watchdog/
|
||||
|
||||
Write-Host "4. Exec the command ..." -ForegroundColor Blue
|
||||
Write-Host ""
|
||||
Write-Host ""
|
||||
ssh root@192.168.35.70 "cd /root/wdd/cmii-watchdog/ && chmod +x cmii-watchdog_linux_amd64 && sudo bash build_cmii_watchdog.sh"
|
||||
Write-Host ""
|
||||
Write-Host ""
|
||||
|
||||
} catch {
|
||||
Write-Host "操作失败: $_" -ForegroundColor Red
|
||||
exit 1
|
||||
}
|
||||
9
cmii-uav-watchdog-agent/cmii-uav-watchdog-agent.iml
Normal file
9
cmii-uav-watchdog-agent/cmii-uav-watchdog-agent.iml
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="WEB_MODULE" version="4">
|
||||
<component name="Go" enabled="true" />
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$/cmii-uav-watchdog-agent" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
3
cmii-uav-watchdog-agent/go.mod
Normal file
3
cmii-uav-watchdog-agent/go.mod
Normal file
@@ -0,0 +1,3 @@
|
||||
module cmii-uav-watchdog-agent
|
||||
|
||||
go 1.23
|
||||
15
cmii-uav-watchdog-agent/java-run/Dockerfile
Normal file
15
cmii-uav-watchdog-agent/java-run/Dockerfile
Normal file
@@ -0,0 +1,15 @@
|
||||
FROM alpine:3.18
|
||||
|
||||
RUN apk add --no-cache openjdk17
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY wdd-springboot-test-0.0.1-SNAPSHOT.jar /app/jarfile.jar
|
||||
|
||||
COPY cmii-watchdog_linux_amd64 /app/cmii-watchdog
|
||||
|
||||
CMD ["chmod", "+x", "/app/cmii-watchdog"]
|
||||
|
||||
EXPOSE 8080
|
||||
|
||||
ENTRYPOINT ["/app/cmii-watchdog", "-business-program-type", "java", "-business-program-path", "/app/jarfile.jar"]
|
||||
16
cmii-uav-watchdog-agent/java-run/build_cmii_watchdog.sh
Normal file
16
cmii-uav-watchdog-agent/java-run/build_cmii_watchdog.sh
Normal file
@@ -0,0 +1,16 @@
|
||||
#!/bin/bash
|
||||
|
||||
cd /root/wdd/cmii-watchdog
|
||||
|
||||
pwd
|
||||
|
||||
current_date=$(date +"%Y-%m-%d-%H-%M-%S")
|
||||
|
||||
|
||||
docker build -t cmii-watchdog-java:${current_date} .
|
||||
|
||||
|
||||
docker run -d -p 9000:8080 --name=cmii-watchdog-java-${current_date} cmii-watchdog-java:${current_date}
|
||||
|
||||
|
||||
#docker run -d -p 9000:8080 cmii-watchdog-java:2025-02-25
|
||||
Binary file not shown.
1
cmii-uav-watchdog-agent/main.go
Normal file
1
cmii-uav-watchdog-agent/main.go
Normal file
@@ -0,0 +1 @@
|
||||
package cmii_uav_watchdog_agent
|
||||
Reference in New Issue
Block a user