Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/agent-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -280,8 +280,8 @@ jobs:
platforms: linux/amd64,linux/arm64
push: ${{ secrets.DOCKERHUB_USERNAME != '' }}
tags: |
serverkit/agent:latest
serverkit/agent:${{ steps.version.outputs.version }}
jhd3197/serverkit-agent:latest
jhd3197/serverkit-agent:${{ steps.version.outputs.version }}
build-args: |
VERSION=${{ steps.version.outputs.version }}
BUILD_TIME=${{ github.event.repository.updated_at }}
Expand Down Expand Up @@ -368,8 +368,8 @@ jobs:

#### Docker
```bash
docker pull serverkit/agent:${{ steps.version.outputs.version }}
docker pull serverkit/agent:latest
docker pull jhd3197/serverkit-agent:${{ steps.version.outputs.version }}
docker pull jhd3197/serverkit-agent:latest
```

### Quick Install
Expand Down Expand Up @@ -401,7 +401,7 @@ jobs:
docker run -d --name serverkit-agent \
-v /var/run/docker.sock:/var/run/docker.sock:ro \
-v serverkit-config:/etc/serverkit-agent \
serverkit/agent:${{ steps.version.outputs.version }}
jhd3197/serverkit-agent:${{ steps.version.outputs.version }}
```

### Verification
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.2.56
1.2.61
26 changes: 26 additions & 0 deletions agent/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Binaries
serverkit-agent
serverkit-agent.exe
*.exe
*.dll
*.so
*.dylib

# Build output
/dist/
/output/
/packages/

# Test binaries
*.test
*.test.exe

# IDE
.idea/
.vscode/
*.swp
*.swo

# OS files
.DS_Store
Thumbs.db
2 changes: 1 addition & 1 deletion agent/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

services:
agent:
image: serverkit/agent:latest
image: jhd3197/serverkit-agent:latest
container_name: serverkit-agent
restart: unless-stopped

Expand Down
1 change: 1 addition & 0 deletions agent/internal/agent/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package agent

import (
"context"
"encoding/base64"
"encoding/json"
"fmt"
"sync"
Expand Down
83 changes: 20 additions & 63 deletions agent/packaging/msi/Product.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@

Build instructions:
1. Install WiX Toolset v4
2. Run: wix build Product.wxs -o serverkit-agent.msi
2. Run: wix build Product.wxs -o serverkit-agent.msi -define Version=1.0.0
-->
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">

<!-- Product definition -->
<Package
Name="ServerKit Agent"
Manufacturer="ServerKit"
Version="!(bind.FileVersion.ServerKitAgentExe)"
Version="$(var.Version)"
UpgradeCode="E8B7F3A2-4C5D-4E6F-8A9B-0C1D2E3F4A5B"
Scope="perMachine">

Expand All @@ -30,42 +30,12 @@
<!-- Media -->
<MediaTemplate EmbedCab="yes" />

<!-- License -->
<WixVariable Id="WixUILicenseRtf" Value="License.rtf" />

<!-- UI -->
<UI>
<UIRef Id="WixUI_InstallDir" />
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLFOLDER" />
</UI>

<!-- Feature -->
<Feature Id="ProductFeature" Title="ServerKit Agent" Level="1">
<ComponentGroupRef Id="ProductComponents" />
<ComponentRef Id="ServiceComponent" />
<ComponentRef Id="ConfigComponent" />
</Feature>

<!-- Custom Actions -->
<CustomAction Id="StopService"
Directory="INSTALLFOLDER"
ExeCommand="[SystemFolder]net.exe stop ServerKitAgent"
Execute="deferred"
Impersonate="no"
Return="ignore" />

<CustomAction Id="StartService"
Directory="INSTALLFOLDER"
ExeCommand="[SystemFolder]net.exe start ServerKitAgent"
Execute="deferred"
Impersonate="no"
Return="ignore" />

<InstallExecuteSequence>
<Custom Action="StopService" Before="InstallFiles">
Installed AND NOT UPGRADINGPRODUCTCODE
</Custom>
</InstallExecuteSequence>
</Package>

<!-- Directory Structure -->
Expand All @@ -89,40 +59,27 @@
<Component Id="MainExecutable" Guid="A1B2C3D4-E5F6-7890-ABCD-EF1234567890">
<File Id="ServerKitAgentExe"
Source="serverkit-agent.exe"
KeyPath="yes">
<Shortcut Id="StartMenuShortcut"
Directory="ProgramMenuFolder"
Name="ServerKit Agent"
Description="ServerKit Agent Management"
WorkingDirectory="INSTALLFOLDER"
Advertise="yes" />
</File>
KeyPath="yes" />
<!-- Windows Service -->
<ServiceInstall
Id="ServiceInstall"
Name="ServerKitAgent"
DisplayName="ServerKit Agent"
Description="ServerKit Agent - Remote server management service"
Type="ownProcess"
Start="auto"
ErrorControl="normal"
Arguments="start" />
<ServiceControl
Id="ServiceControl"
Name="ServerKitAgent"
Start="install"
Stop="both"
Remove="uninstall"
Wait="yes" />
</Component>
</ComponentGroup>

<!-- Windows Service -->
<Component Id="ServiceComponent" Directory="INSTALLFOLDER" Guid="B2C3D4E5-F6A7-8901-BCDE-F23456789012">
<File Id="ServiceExe" Source="serverkit-agent.exe" KeyPath="yes" />
<ServiceInstall
Id="ServiceInstall"
Name="ServerKitAgent"
DisplayName="ServerKit Agent"
Description="ServerKit Agent - Remote server management service"
Type="ownProcess"
Start="auto"
ErrorControl="normal"
Arguments="start">
<ServiceDependency Id="Tcpip" />
</ServiceInstall>
<ServiceControl
Id="ServiceControl"
Name="ServerKitAgent"
Start="install"
Stop="both"
Remove="uninstall"
Wait="yes" />
</Component>

<!-- Configuration -->
<Component Id="ConfigComponent" Directory="AgentDataFolder" Guid="C3D4E5F6-A7B8-9012-CDEF-345678901234">
<File Id="ConfigYaml" Source="config.yaml" KeyPath="yes" />
Expand Down
18 changes: 11 additions & 7 deletions agent/packaging/rpm/build.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
# Build .rpm package for ServerKit Agent
# Usage: ./build.sh <version> <architecture> <binary_path>
# Example: ./build.sh 1.0.0 x86_64 ../../dist/serverkit-agent-linux-amd64
# Usage: ./build.sh <version> <architecture> <binary_path> <output_dir>
# Example: ./build.sh 1.0.0 x86_64 ../../dist/serverkit-agent-linux-amd64 ./packages

set -e

Expand All @@ -10,6 +10,12 @@ ARCH="${2:-x86_64}"
BINARY_PATH="${3:-../../dist/serverkit-agent-linux-amd64}"
PACKAGE_NAME="serverkit-agent"

# Convert paths to absolute before any cd commands
BINARY_PATH="$(cd "$(dirname "$BINARY_PATH")" && pwd)/$(basename "$BINARY_PATH")"
OUTPUT_DIR="${4:-./output}"
mkdir -p "$OUTPUT_DIR"
OUTPUT_DIR="$(cd "$OUTPUT_DIR" && pwd)"

# Map Go arch to RPM arch
case "$ARCH" in
amd64) RPM_ARCH="x86_64" ;;
Expand All @@ -21,6 +27,7 @@ echo "Building .rpm package..."
echo " Version: $VERSION"
echo " Architecture: $RPM_ARCH"
echo " Binary: $BINARY_PATH"
echo " Output: $OUTPUT_DIR"

# Create build directory structure
BUILD_ROOT="$(mktemp -d)"
Expand Down Expand Up @@ -117,7 +124,6 @@ License: MIT
URL: https://github.com/serverkit/serverkit
Source0: serverkit-agent-%{version}.tar.gz

BuildArch: $RPM_ARCH
Requires: ca-certificates

%description
Expand Down Expand Up @@ -189,12 +195,10 @@ fi
- Release $VERSION
EOF

# Build the RPM
rpmbuild --define "_topdir $BUILD_ROOT" -bb "$BUILD_ROOT/SPECS/serverkit-agent.spec"
# Build the RPM (disable build-id for Go binaries, use --target for cross-arch)
rpmbuild --define "_topdir $BUILD_ROOT" --define "_build_id_links none" --target "$RPM_ARCH" -bb "$BUILD_ROOT/SPECS/serverkit-agent.spec"

# Copy output
OUTPUT_DIR="${4:-./output}"
mkdir -p "$OUTPUT_DIR"
cp "$BUILD_ROOT/RPMS/$RPM_ARCH"/*.rpm "$OUTPUT_DIR/"

# Cleanup
Expand Down
Binary file removed agent/serverkit-agent.exe
Binary file not shown.
Loading