scripts: publish unified Agent artifacts and restore CI coverage [CI]
Remove Probe build jobs and release paths. Transfer Gitea publishing credentials to both Agent architecture jobs, publish each platform archive once, and run slow tests after development images are published.
This commit is contained in:
1 parent
c9beeee8e3
commit
4515d7b075
14 files changed
+52
-179
No files matched your search
+17
-35
@@ -39,6 +39,9 @@ steps:
|
||||
- name: build-linux-amd64-agent
|
||||
image: bash
|
||||
environment:
|
||||
GITEA_BASE: http://127.0.0.1:3100
|
||||
GITEA_TOKEN:
|
||||
from_secret: gitea_token
|
||||
ZOT_REGISTRY: registry.oeo.one
|
||||
ZOT_USERNAME: justme
|
||||
ZOT_SECRET:
|
||||
@@ -50,7 +53,8 @@ steps:
|
||||
- bash ci/build-dev-image.sh agent
|
||||
depends_on: []
|
||||
|
||||
- name: build-linux-amd64-probe
|
||||
# Build both node architectures in parallel; publish both indexes together after both builds.
|
||||
- name: build-linux-arm64-agent
|
||||
image: bash
|
||||
environment:
|
||||
GITEA_BASE: http://127.0.0.1:3100
|
||||
@@ -63,42 +67,10 @@ steps:
|
||||
RELEASE_API_URL: https://mo.oeo.one
|
||||
RELEASE_SIGNING_KEY:
|
||||
from_secret: release_signing_key
|
||||
commands:
|
||||
- bash ci/build-dev-image.sh probe
|
||||
depends_on: []
|
||||
|
||||
# Build both node architectures in parallel; publish both indexes together after all four builds.
|
||||
- name: build-linux-arm64-agent
|
||||
image: bash
|
||||
environment:
|
||||
ZOT_REGISTRY: registry.oeo.one
|
||||
ZOT_USERNAME: justme
|
||||
ZOT_SECRET:
|
||||
from_secret: zot_secret
|
||||
RELEASE_API_URL: https://mo.oeo.one
|
||||
RELEASE_SIGNING_KEY:
|
||||
from_secret: release_signing_key
|
||||
commands:
|
||||
- bash ci/build-dev-image.sh agent arm64
|
||||
depends_on: []
|
||||
|
||||
- name: build-linux-arm64-probe
|
||||
image: bash
|
||||
environment:
|
||||
GITEA_BASE: http://127.0.0.1:3100
|
||||
GITEA_TOKEN:
|
||||
from_secret: gitea_token
|
||||
ZOT_REGISTRY: registry.oeo.one
|
||||
ZOT_USERNAME: justme
|
||||
ZOT_SECRET:
|
||||
from_secret: zot_secret
|
||||
RELEASE_API_URL: https://mo.oeo.one
|
||||
RELEASE_SIGNING_KEY:
|
||||
from_secret: release_signing_key
|
||||
commands:
|
||||
- bash ci/build-dev-image.sh probe arm64
|
||||
depends_on: []
|
||||
|
||||
- name: publish-linux-node-indexes
|
||||
image: bash
|
||||
environment:
|
||||
@@ -113,6 +85,16 @@ steps:
|
||||
- bash ci/publish-dev-node-indexes.sh
|
||||
depends_on:
|
||||
- build-linux-amd64-agent
|
||||
- build-linux-amd64-probe
|
||||
- build-linux-arm64-agent
|
||||
- build-linux-arm64-probe
|
||||
|
||||
- name: backend-e2e-tests
|
||||
image: bash
|
||||
when:
|
||||
- evaluate: 'not (CI_COMMIT_MESSAGE contains "[SKIP TESTS]")'
|
||||
environment:
|
||||
NUGET_PACKAGES: /home/justme/woodpecker/cache/nuget/packages
|
||||
commands:
|
||||
- bash ci/verify-backend.sh slow
|
||||
depends_on:
|
||||
- publish-linux-node-indexes
|
||||
- build-linux-amd64-backend
|
||||
@@ -17,7 +17,7 @@ depends_on:
|
||||
- windows-release
|
||||
|
||||
steps:
|
||||
- name: publish-agent-probe-oci
|
||||
- name: publish-agent-oci
|
||||
image: bash
|
||||
environment:
|
||||
GITEA_BASE: http://127.0.0.1:3100
|
||||
@@ -45,4 +45,4 @@ steps:
|
||||
commands:
|
||||
- bash ci/publish-gitea-release.sh
|
||||
depends_on:
|
||||
- publish-agent-probe-oci
|
||||
- publish-agent-oci
|
||||
@@ -30,14 +30,6 @@ steps:
|
||||
- ./ci/release-cross-platform.ps1 -RuntimeIdentifier $env:RID -Component $env:COMPONENT
|
||||
depends_on: []
|
||||
|
||||
- name: build-linux-x64-probe
|
||||
image: powershell
|
||||
environment: &rid-linux-x64-probe
|
||||
<<: *build-environment
|
||||
COMPONENT: probe
|
||||
commands: *build-commands
|
||||
depends_on: []
|
||||
|
||||
- name: build-linux-x64-enroll
|
||||
image: powershell
|
||||
environment: &rid-linux-x64-enroll
|
||||
@@ -54,14 +46,6 @@ steps:
|
||||
commands: *build-commands
|
||||
depends_on: []
|
||||
|
||||
- name: build-linux-arm64-probe
|
||||
image: powershell
|
||||
environment: &rid-linux-arm64-probe
|
||||
<<: *rid-linux-arm64-agent
|
||||
COMPONENT: probe
|
||||
commands: *build-commands
|
||||
depends_on: []
|
||||
|
||||
- name: build-linux-arm64-enroll
|
||||
image: powershell
|
||||
environment: &rid-linux-arm64-enroll
|
||||
@@ -78,14 +62,6 @@ steps:
|
||||
commands: *build-commands
|
||||
depends_on: []
|
||||
|
||||
- name: build-linux-musl-x64-probe
|
||||
image: powershell
|
||||
environment: &rid-linux-musl-x64-probe
|
||||
<<: *rid-linux-musl-x64-agent
|
||||
COMPONENT: probe
|
||||
commands: *build-commands
|
||||
depends_on: []
|
||||
|
||||
- name: build-linux-musl-x64-enroll
|
||||
image: powershell
|
||||
environment: &rid-linux-musl-x64-enroll
|
||||
@@ -102,14 +78,6 @@ steps:
|
||||
commands: *build-commands
|
||||
depends_on: []
|
||||
|
||||
- name: build-linux-musl-arm64-probe
|
||||
image: powershell
|
||||
environment: &rid-linux-musl-arm64-probe
|
||||
<<: *rid-linux-musl-arm64-agent
|
||||
COMPONENT: probe
|
||||
commands: *build-commands
|
||||
depends_on: []
|
||||
|
||||
- name: build-linux-musl-arm64-enroll
|
||||
image: powershell
|
||||
environment: &rid-linux-musl-arm64-enroll
|
||||
@@ -126,14 +94,6 @@ steps:
|
||||
commands: *build-commands
|
||||
depends_on: []
|
||||
|
||||
- name: build-macos-x64-probe
|
||||
image: powershell
|
||||
environment: &rid-macos-x64-probe
|
||||
<<: *rid-macos-x64-agent
|
||||
COMPONENT: probe
|
||||
commands: *build-commands
|
||||
depends_on: []
|
||||
|
||||
- name: build-macos-x64-enroll
|
||||
image: powershell
|
||||
environment: &rid-macos-x64-enroll
|
||||
@@ -150,14 +110,6 @@ steps:
|
||||
commands: *build-commands
|
||||
depends_on: []
|
||||
|
||||
- name: build-macos-arm64-probe
|
||||
image: powershell
|
||||
environment: &rid-macos-arm64-probe
|
||||
<<: *rid-macos-arm64-agent
|
||||
COMPONENT: probe
|
||||
commands: *build-commands
|
||||
depends_on: []
|
||||
|
||||
- name: build-macos-arm64-enroll
|
||||
image: powershell
|
||||
environment: &rid-macos-arm64-enroll
|
||||
@@ -174,14 +126,6 @@ steps:
|
||||
commands: *build-commands
|
||||
depends_on: []
|
||||
|
||||
- name: build-windows-x64-probe
|
||||
image: powershell
|
||||
environment: &rid-windows-x64-probe
|
||||
<<: *rid-windows-x64-agent
|
||||
COMPONENT: probe
|
||||
commands: *build-commands
|
||||
depends_on: []
|
||||
|
||||
- name: build-windows-x64-enroll
|
||||
image: powershell
|
||||
environment: &rid-windows-x64-enroll
|
||||
@@ -198,14 +142,6 @@ steps:
|
||||
commands: *build-commands
|
||||
depends_on: []
|
||||
|
||||
- name: build-windows-arm64-probe
|
||||
image: powershell
|
||||
environment: &rid-windows-arm64-probe
|
||||
<<: *rid-windows-arm64-agent
|
||||
COMPONENT: probe
|
||||
commands: *build-commands
|
||||
depends_on: []
|
||||
|
||||
- name: build-windows-arm64-enroll
|
||||
image: powershell
|
||||
environment: &rid-windows-arm64-enroll
|
||||
@@ -222,26 +158,18 @@ steps:
|
||||
- ./ci/package-cross-platform.ps1
|
||||
depends_on:
|
||||
- build-linux-x64-agent
|
||||
- build-linux-x64-probe
|
||||
- build-linux-x64-enroll
|
||||
- build-linux-arm64-agent
|
||||
- build-linux-arm64-probe
|
||||
- build-linux-arm64-enroll
|
||||
- build-linux-musl-x64-agent
|
||||
- build-linux-musl-x64-probe
|
||||
- build-linux-musl-x64-enroll
|
||||
- build-linux-musl-arm64-agent
|
||||
- build-linux-musl-arm64-probe
|
||||
- build-linux-musl-arm64-enroll
|
||||
- build-macos-x64-agent
|
||||
- build-macos-x64-probe
|
||||
- build-macos-x64-enroll
|
||||
- build-macos-arm64-agent
|
||||
- build-macos-arm64-probe
|
||||
- build-macos-arm64-enroll
|
||||
- build-windows-x64-agent
|
||||
- build-windows-x64-probe
|
||||
- build-windows-x64-enroll
|
||||
- build-windows-arm64-agent
|
||||
- build-windows-arm64-probe
|
||||
- build-windows-arm64-enroll
|
||||
@@ -7,10 +7,10 @@ set -euo pipefail
|
||||
exit 2
|
||||
}
|
||||
|
||||
component="${1:?usage: build-dev-image.sh <backend|agent|probe> [amd64|arm64]}"
|
||||
component="${1:?usage: build-dev-image.sh <backend|agent> [amd64|arm64]}"
|
||||
arch="${2:-amd64}"
|
||||
case "$component" in
|
||||
backend|agent|probe) ;;
|
||||
backend|agent) ;;
|
||||
*) echo "unsupported component: $component" >&2; exit 2 ;;
|
||||
esac
|
||||
case "$arch" in
|
||||
@@ -183,21 +183,21 @@ for tag in "$image_version-$arch"; do
|
||||
echo "pushed development image $repository:$tag"
|
||||
done
|
||||
|
||||
# Reuse the static Probe/enrollment binaries already built above; do not compile again.
|
||||
# Reuse the static Agent/enrollment binaries already built above; do not compile again.
|
||||
# Publish before the multi-arch image offer wakes online native nodes.
|
||||
if [[ "$component" == probe ]]; then
|
||||
if [[ "$component" == agent ]]; then
|
||||
buildah rm "moshiro-openwrt-extract-$arch" >/dev/null 2>&1 || true
|
||||
native_container="$(buildah from --arch "$arch" --name "moshiro-openwrt-extract-$arch" "$local_image")"
|
||||
native_dir="$work/openwrt"
|
||||
mkdir -p "$native_dir"
|
||||
native_mount="$(buildah mount "$native_container")"
|
||||
cp "$native_mount/usr/local/bin/moshiro-probe" "$native_mount/usr/local/bin/fleet-enroll" "$native_dir/"
|
||||
cp "$native_mount/usr/local/bin/moshiro-agent" "$native_mount/usr/local/bin/fleet-enroll" "$native_dir/"
|
||||
buildah unmount "$native_container" >/dev/null
|
||||
buildah rm "$native_container" >/dev/null
|
||||
bash "$root/ci/publish-openwrt.sh" dev "$node_rid" "$native_dir"
|
||||
fi
|
||||
|
||||
# Agent and Probe manifests are signed after both architecture-specific images
|
||||
# Agent manifests are signed after both architecture-specific images
|
||||
# have been pushed. Backend is still a single-architecture development image.
|
||||
if [[ "$component" == backend && -n "${RELEASE_SIGNING_KEY:-}" ]]; then
|
||||
bash "$root/ci/publish-release-offer.sh" "$component" "$repository" "$(cat "$work/$component.digest")" "$MOSHIRO_TAG" dev "$work/$component-release"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
# Prepare the native MsQuic runtime for in-process Agent/Probe tests.
|
||||
# Prepare the native MsQuic runtime for in-process Agent tests.
|
||||
# Debian packages are extracted locally (no root install); downloads live in
|
||||
# the persistent backend test cache so fast and slow workflows reuse them.
|
||||
set -euo pipefail
|
||||
|
||||
@@ -49,9 +49,8 @@ try {
|
||||
$uploadFiles = [System.Collections.Generic.List[string]]::new()
|
||||
foreach ($target in $targets) {
|
||||
$agentDirectory = Join-Path $root ".release\publish\$($target.Rid)\agent"
|
||||
$probeDirectory = Join-Path $root ".release\publish\$($target.Rid)\probe"
|
||||
$enrollDirectory = Join-Path $root ".release\publish\$($target.Rid)\fleet-enroll"
|
||||
foreach ($path in @($agentDirectory, $probeDirectory, $enrollDirectory)) {
|
||||
foreach ($path in @($agentDirectory, $enrollDirectory)) {
|
||||
if (-not (Test-Path -LiteralPath $path -PathType Container)) {
|
||||
throw "Build output is missing: $path"
|
||||
}
|
||||
@@ -64,7 +63,7 @@ try {
|
||||
if ($LASTEXITCODE -and $LASTEXITCODE -ne 0) { throw "Could not bundle QUIC runtime for $($target.Rid)." }
|
||||
}
|
||||
|
||||
foreach ($role in @('agent', 'probe')) {
|
||||
foreach ($role in @('agent')) {
|
||||
$stage = Join-Path $root ".release\stage\$($target.Rid)\$role"
|
||||
$null = New-Item -ItemType Directory -Force -Path $stage
|
||||
$extension = if ($target.Windows) { '.exe' } else { '' }
|
||||
@@ -85,10 +84,10 @@ try {
|
||||
$systemd = Join-Path $stage 'systemd'
|
||||
$null = New-Item -ItemType Directory -Force -Path $systemd
|
||||
Copy-Item -LiteralPath (Join-Path $root "packaging/systemd/moshiro-$role.service") -Destination $systemd
|
||||
if ($role -eq 'probe') {
|
||||
if ($role -eq 'agent') {
|
||||
$openwrt = Join-Path $stage 'openwrt'
|
||||
$null = New-Item -ItemType Directory -Force -Path $openwrt
|
||||
Copy-Item -LiteralPath (Join-Path $root 'packaging/openwrt/moshiro-probe.init') -Destination $openwrt
|
||||
Copy-Item -LiteralPath (Join-Path $root 'packaging/openwrt/moshiro-agent.init') -Destination $openwrt
|
||||
Copy-Item -LiteralPath (Join-Path $root 'packaging/openwrt/moshiro.keep') -Destination $openwrt
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
#!/usr/bin/env bash
|
||||
# Publish the pullable multi-architecture development tags for Agent or Probe.
|
||||
# Publish the pullable multi-architecture development tags for Agent.
|
||||
set -euo pipefail
|
||||
|
||||
component="${1:?usage: publish-dev-node-index.sh <agent|probe>}"
|
||||
component="${1:?usage: publish-dev-node-index.sh <agent>}"
|
||||
case "$component" in
|
||||
agent|probe) ;;
|
||||
agent) ;;
|
||||
*) echo "unsupported component: $component" >&2; exit 2 ;;
|
||||
esac
|
||||
[[ "${CI_PIPELINE_EVENT:-}" == push && "${CI_COMMIT_BRANCH:-}" == main && "${CI_COMMIT_MESSAGE:-}" == *"[CI]"* ]] || {
|
||||
|
||||
@@ -1,31 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
# Publish Agent and Probe multi-architecture indexes concurrently in one CI step.
|
||||
# Publish the unified Agent multi-architecture index.
|
||||
set -euo pipefail
|
||||
|
||||
root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
publish_pids=()
|
||||
|
||||
cancel_publishers() {
|
||||
local pid
|
||||
trap - TERM INT HUP
|
||||
for pid in "${publish_pids[@]}"; do
|
||||
kill -TERM "$pid" 2>/dev/null || true
|
||||
done
|
||||
for pid in "${publish_pids[@]}"; do
|
||||
wait "$pid" 2>/dev/null || true
|
||||
done
|
||||
exit 143
|
||||
}
|
||||
trap cancel_publishers TERM INT HUP
|
||||
|
||||
for component in agent probe; do
|
||||
python3 "$root/ci/run-with-timeout.py" 900 \
|
||||
bash "$root/ci/publish-dev-node-index.sh" "$component" &
|
||||
publish_pids+=("$!")
|
||||
done
|
||||
|
||||
publish_status=0
|
||||
for pid in "${publish_pids[@]}"; do
|
||||
wait "$pid" || publish_status=1
|
||||
done
|
||||
exit "$publish_status"
|
||||
exec python3 "$root/ci/run-with-timeout.py" 900 bash "$root/ci/publish-dev-node-index.sh" agent
|
||||
@@ -29,7 +29,7 @@ trap 'rm -rf "$tmp"' EXIT
|
||||
root_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
install_sh="$(sha256sum "$root_dir/packaging/install/install.sh" | cut -d" " -f1)"
|
||||
install_ps1="$(sha256sum "$root_dir/packaging/install/install.ps1" | cut -d" " -f1)"
|
||||
release_body="Install script SHA-256 (compare with the panel before you run an install command): install.sh $install_sh, install.ps1 $install_ps1. Agent and Probe builds: Linux glibc and musl (x64, arm64), macOS (x64, arm64), and Windows (x64, arm64). Linux glibc Agent and Probe OCI images: registry.oeo.one/moshiro/moshiro-agent:$version and registry.oeo.one/moshiro/moshiro-probe:$version (linux/amd64 and linux/arm64). Backend OCI image: registry.oeo.one/moshiro/moshiro-backend:$version (linux/amd64 and linux/arm64). Compose files for Agent, Probe and Backend: moshiro-compose-<role>.yaml (images use :latest, or pin MOSHIRO_VERSION in .env). macOS binaries are not Developer ID signed or notarized."
|
||||
release_body="Install script SHA-256 (compare with the panel before you run an install command): install.sh $install_sh, install.ps1 $install_ps1. Agent builds: Linux glibc and musl (x64, arm64), macOS (x64, arm64), and Windows (x64, arm64). Linux musl Agent OCI image: registry.oeo.one/moshiro/moshiro-agent:$version (linux/amd64 and linux/arm64). Backend OCI image: registry.oeo.one/moshiro/moshiro-backend:$version (linux/amd64 and linux/arm64). Compose files for Agent and Backend: moshiro-compose-<role>.yaml (images use :latest, or pin MOSHIRO_VERSION in .env). macOS binaries are not Developer ID signed or notarized."
|
||||
payload="$(printf '{"tag_name":"%s","target_commitish":"%s","name":"MoShiro %s","body":"%s","draft":false,"prerelease":false}' \
|
||||
"$tag" "${CI_COMMIT_SHA:-}" "$tag" "$release_body")"
|
||||
release_status="$(curl --silent --show-error --retry 3 --netrc-file "$netrc" \
|
||||
@@ -65,20 +65,12 @@ curl --fail-with-body --silent --show-error --retry 3 --netrc-file "$netrc" \
|
||||
assets=(
|
||||
"moshiro-agent-v$version-linux-amd64.tar.gz"
|
||||
"moshiro-agent-v$version-linux-arm64.tar.gz"
|
||||
"moshiro-probe-v$version-linux-amd64.tar.gz"
|
||||
"moshiro-probe-v$version-linux-arm64.tar.gz"
|
||||
"moshiro-agent-v$version-linux-musl-amd64.tar.gz"
|
||||
"moshiro-probe-v$version-linux-musl-amd64.tar.gz"
|
||||
"moshiro-agent-v$version-linux-musl-arm64.tar.gz"
|
||||
"moshiro-probe-v$version-linux-musl-arm64.tar.gz"
|
||||
"moshiro-agent-v$version-macos-x64.tar.gz"
|
||||
"moshiro-probe-v$version-macos-x64.tar.gz"
|
||||
"moshiro-agent-v$version-macos-arm64.tar.gz"
|
||||
"moshiro-probe-v$version-macos-arm64.tar.gz"
|
||||
"moshiro-agent-v$version-windows-amd64.zip"
|
||||
"moshiro-agent-v$version-windows-arm64.zip"
|
||||
"moshiro-probe-v$version-windows-amd64.zip"
|
||||
"moshiro-probe-v$version-windows-arm64.zip"
|
||||
)
|
||||
|
||||
upload_release_asset() {
|
||||
@@ -129,13 +121,13 @@ upload_local_asset() {
|
||||
echo "attached $name"
|
||||
}
|
||||
|
||||
# compose 文件(Agent、Probe、Backend 各一份)和节点的 Podman Quadlet 单元(Agent、Probe 各一份),都是静态的(镜像用 :latest):作为发布资产,
|
||||
# compose 文件(Agent、Backend 各一份)和节点的 Podman Quadlet 单元(Agent 各一份),都是静态的(镜像用 :latest):作为发布资产,
|
||||
# 第一次部署 Backend 时还没有面板,就从这里下载;它们也记进 SHA256SUMS(有签名密钥时一起签名)。
|
||||
for role in agent probe backend; do
|
||||
for role in agent backend; do
|
||||
cp "$root_dir/packaging/compose/$role/compose.yaml" "$tmp/moshiro-compose-$role.yaml"
|
||||
upload_local_asset "moshiro-compose-$role.yaml" "$tmp/moshiro-compose-$role.yaml"
|
||||
done
|
||||
for role in agent probe; do
|
||||
for role in agent; do
|
||||
cp "$root_dir/packaging/quadlet/moshiro-$role.container" "$tmp/moshiro-quadlet-$role.container"
|
||||
upload_local_asset "moshiro-quadlet-$role.container" "$tmp/moshiro-quadlet-$role.container"
|
||||
done
|
||||
@@ -149,7 +141,7 @@ if [[ -n "${RELEASE_SIGNING_KEY:-}" ]]; then
|
||||
cat "$tmp/$archive.sha256" >> "$sums"
|
||||
done
|
||||
[[ "$(wc -l < "$sums")" -eq "${#assets[@]}" ]] || { echo "SHA256SUMS does not have one line per archive" >&2; exit 1; }
|
||||
for file in moshiro-compose-agent.yaml moshiro-compose-probe.yaml moshiro-compose-backend.yaml moshiro-quadlet-agent.container moshiro-quadlet-probe.container; do
|
||||
for file in moshiro-compose-agent.yaml moshiro-compose-backend.yaml moshiro-quadlet-agent.container; do
|
||||
printf '%s %s\n' "$(sha256sum "$tmp/$file" | cut -d' ' -f1)" "$file" >> "$sums"
|
||||
done
|
||||
signing_key="$(mktemp)"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
# Package an already-built native Probe and publish an independently signed feed.
|
||||
# Package an already-built native Agent and publish an independently signed feed.
|
||||
# Used after verify/web-build gates for dev, and after all release builds for tags.
|
||||
set -euo pipefail
|
||||
channel="${1:?usage: publish-openwrt.sh <dev|release> <rid> <binary-directory>}"
|
||||
@@ -19,25 +19,25 @@ version="$MOSHIRO_VERSION"
|
||||
work="$(mktemp -d)"
|
||||
trap 'rm -rf "$work"' EXIT
|
||||
mkdir "$work/stage"
|
||||
install -m 755 "$source_dir/moshiro-probe" "$source_dir/fleet-enroll" "$work/stage/"
|
||||
install -m 755 "$source_dir/moshiro-agent" "$source_dir/fleet-enroll" "$work/stage/"
|
||||
for library in "$source_dir"/lib*.so.*; do
|
||||
[[ ! -f "$library" ]] || install -m 644 "$library" "$work/stage/"
|
||||
done
|
||||
install -m 755 "$root/packaging/openwrt/install.sh" "$work/stage/openwrt.sh"
|
||||
install -m 755 "$root/packaging/openwrt/native-probe.init" "$work/stage/probe.init"
|
||||
install -m 755 "$root/packaging/openwrt/native-agent.init" "$work/stage/agent.init"
|
||||
install -m 755 "$root/packaging/openwrt/updater.init" "$work/stage/updater.init"
|
||||
members=()
|
||||
for file in "$work/stage/"*; do members+=("$(basename "$file")"); done
|
||||
tar --sort=name --owner=0 --group=0 --numeric-owner -czf "$work/package.tar.gz" -C "$work/stage" "${members[@]}"
|
||||
hash="$(sha256sum "$work/package.tar.gz" | cut -d' ' -f1)"
|
||||
size="$(stat -c%s "$work/package.tar.gz")"
|
||||
package="probe-$rid-$hash.tar.gz"
|
||||
package="agent-$rid-$hash.tar.gz"
|
||||
seq="$(git -C "$root" show -s --format=%ct HEAD)"
|
||||
# Commit time is stable across retries; equal timestamps intentionally do not auto-upgrade.
|
||||
python3 - "$channel" "$rid" "$version" "$package" "$hash" "$size" "$seq" > "$work/manifest.json" <<'PY'
|
||||
import json, sys
|
||||
channel, rid, version, package, sha256, size, seq = sys.argv[1:]
|
||||
print(json.dumps(dict(schema=1, component='probe', channel=channel, rid=rid,
|
||||
print(json.dumps(dict(schema=1, component='agent', channel=channel, rid=rid,
|
||||
version=version, package=package, sha256=sha256, size=int(size), seq=int(seq)), separators=(',', ':')), end='')
|
||||
PY
|
||||
chmod 700 "$work"
|
||||
@@ -65,4 +65,4 @@ upload "$version/$package" "$work/package.tar.gz"
|
||||
# Publish the channel pointer only after its immutable payload is downloadable.
|
||||
upload "$channel/manifest-$rid.sig" "$work/manifest.sig" true
|
||||
upload "$channel/manifest-$rid.json" "$work/manifest.json" true
|
||||
echo "published signed OpenWrt Probe $version ($channel/$rid)"
|
||||
echo "published signed OpenWrt Agent $version ($channel/$rid)"
|
||||
@@ -7,7 +7,7 @@ param(
|
||||
)]
|
||||
[string]$RuntimeIdentifier,
|
||||
[Parameter(Mandatory)]
|
||||
[ValidateSet('agent', 'probe', 'fleet-enroll')]
|
||||
[ValidateSet('agent', 'fleet-enroll')]
|
||||
[string]$Component
|
||||
)
|
||||
|
||||
@@ -44,7 +44,6 @@ if ($RuntimeIdentifier -in @('win-x64', 'win-arm64')) {
|
||||
|
||||
$project = switch ($Component) {
|
||||
'agent' { 'agent/src/MoShiro.Agent' }
|
||||
'probe' { 'probe/src/MoShiro.Probe' }
|
||||
'fleet-enroll' { 'fleet/tools/fleet-enroll' }
|
||||
}
|
||||
$output = Join-Path $root ".release\publish\$RuntimeIdentifier\$Component"
|
||||
|
||||
@@ -8,7 +8,7 @@ set -euo pipefail
|
||||
|
||||
component="${1:?usage: release-manifest.sh <component> <repository> <digest> <tag> <channel> <outdir>}"
|
||||
repository="${2:?}"; digest="${3:?}"; tag="${4:?}"; channel="${5:?}"; outdir="${6:?}"
|
||||
[[ "$component" =~ ^(agent|probe|backend)$ ]] || { echo "unsupported component: $component" >&2; exit 2; }
|
||||
[[ "$component" =~ ^(agent|backend)$ ]] || { echo "unsupported component: $component" >&2; exit 2; }
|
||||
[[ "$digest" =~ ^sha256:[0-9a-f]{64}$ ]] || { echo "digest must look like sha256:<64 hex>" >&2; exit 2; }
|
||||
[[ "$repository" =~ ^[a-z0-9./_-]+$ && "$tag" =~ ^[A-Za-z0-9._-]+$ && "$channel" =~ ^[a-z0-9._-]+$ ]] || { echo "unexpected characters in repository, tag or channel" >&2; exit 2; }
|
||||
[[ -n "${RELEASE_SIGNING_KEY:-}" ]] || { echo "RELEASE_SIGNING_KEY is required" >&2; exit 2; }
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
# Publish musl OCI images for the Linux Agent and Probe on amd64 and arm64.
|
||||
# Publish musl OCI images for the Linux Agent on amd64 and arm64.
|
||||
set -euo pipefail
|
||||
|
||||
tag="${CI_COMMIT_TAG:-}"
|
||||
@@ -70,7 +70,7 @@ build_arch_image() {
|
||||
install -m 0755 "$work/fleet-enroll" "$context/app/fleet-enroll"
|
||||
install -m 0755 "$work/moshiro-$component" "$context/app/moshiro-$component"
|
||||
install -m 0644 "$work"/lib*.so.* "$context/app/"
|
||||
if [[ "$component" == probe && -n "${RELEASE_SIGNING_KEY:-}" && "$version" != *-* ]]; then
|
||||
if [[ "$component" == agent && -n "${RELEASE_SIGNING_KEY:-}" && "$version" != *-* ]]; then
|
||||
native_rid=linux-musl-x64
|
||||
[[ "$arch" != arm64 ]] || native_rid=linux-musl-arm64
|
||||
bash "$root/ci/publish-openwrt.sh" release "$native_rid" "$context/app"
|
||||
@@ -115,7 +115,7 @@ publish_index() {
|
||||
fi
|
||||
}
|
||||
|
||||
for component in agent probe; do
|
||||
for component in agent; do
|
||||
build_arch_image "$component" amd64 musl-amd64
|
||||
build_arch_image "$component" arm64 musl-arm64
|
||||
publish_index "$component"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Stage source and restore files for a Linux Agent or Probe image build."""
|
||||
"""Stage source and restore files for a Linux Agent image build."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
@@ -27,7 +27,6 @@ GLOBAL_BACKEND_FILES = {
|
||||
ROOT_BUILD_FILES = {"Directory.Packages.props", "global.json"}
|
||||
CONTAINERFILES = {
|
||||
"agent": ROOT / "packaging/container/Agent.NativeBuild.Containerfile",
|
||||
"probe": ROOT / "packaging/container/Probe.NativeBuild.Containerfile",
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user