360 Secure SkillHub
360 安全技能中心

aracli-deploy-management

该 Skill 提供 aracli 命令行工具的用法说明:初始化 aracli.toml 配置、SSH 认证、按服务与目标构建并发布,支持零停机、滚动与并行策略,一键回滚,查询部署历史与状态,并可接入 CI/CD 和部署钩子。

分类:开发
svemyh
svemyh
热度 0.00
最近更新 2026-03-20 11:51:52

安装

发给 Agent
帮我安装这个技能:npx secure-skills-cli add svemyh/aracli-deploy-management
兼容性
通用兼容
联网要求
需要联网
数据出网
可选出网
Metadata
name
aracli-deploy-management
description
CLI tool for managing multi-service deployments across bare metal and cloud providers with zero-downtime rollouts, rollback, and deploy history.
triggers
["deploy my app to production","set up aracli for deployment","rollback to previous deploy","check deploy status","ship a new version with zero downtime","manage deployments across multiple servers","view deploy history"]

aracli Deploy Management

Skill by ara.so — Daily 2026 Skills collection.

aracli is a lightweight CLI for managing multi-service deployments across bare metal and cloud providers. It supports zero-downtime rollouts, one-command rollback, and an append-only deploy history for auditability.


Installation

# Install via npm
npm install -g aracli

# Or via Homebrew
brew install aracli

# Verify
aracli --version

Quick Start

1. Initialize a project

aracli init

This creates an aracli.toml config in your project root:

[project]
name = "my-app"

[[services]]
name = "api"
type = "binary"
build = "make build"
artifact = "./build/api-server"
health = "http://localhost:8080/health"

[[services]]
name = "worker"
type = "binary"
build = "make build-worker"
artifact = "./build/worker"

[[targets]]
name = "prod-1"
host = "10.0.0.1"
user = "deploy"

[[targets]]
name = "prod-2"
host = "10.0.0.2"
user = "deploy"

2. Authenticate

# SSH-based auth (reads ~/.ssh/config)
aracli auth

# Or specify a key
aracli auth --key ~/.ssh/deploy_ed25519

3. Deploy

# Ship all services to all targets
aracli ship

# Ship a specific service
aracli ship --service api

# Ship to a specific target
aracli ship --target prod-1

Key Commands

Command Description
aracli init Create config in current directory
aracli auth Set up SSH credentials
aracli status Show running versions across all targets
aracli ship Build and deploy services
aracli ship --dry-run Preview what would be deployed
aracli rollback Revert to the previous deployed version
aracli rollback --to <version> Revert to a specific version
aracli history Show deploy history with timestamps
aracli logs <service> Tail logs from a running service
aracli health Run health checks across all targets

Deployment Strategies

Zero-Downtime (default)

Uploads the new artifact, starts it on an alternate port, waits for the health check to pass, then swaps traffic and stops the old process.

aracli ship --service api
# [1/4] Building api...
# [2/4] Uploading to prod-1, prod-2...
# [3/4] Starting on alternate port, waiting for health...
# [4/4] Swapping traffic. Done.

Rolling

Deploys to one target at a time, waiting for health before proceeding.

aracli ship --strategy rolling

All-at-once

Deploys to every target simultaneously. Faster but riskier.

aracli ship --strategy parallel

Rollback

Every deploy is versioned. Rollback restores the previous artifact and config in one command.

# Rollback to the immediately previous version
aracli rollback

# Rollback to a specific version
aracli rollback --to v42

# Preview what rollback would do
aracli rollback --dry-run

Deploy History

aracli keeps an append-only log of every deployment.

aracli history

# v44  2026-03-19 14:32  api@abc1234  prod-1,prod-2  success
# v43  2026-03-18 09:11  api@def5678  prod-1,prod-2  success
# v42  2026-03-17 16:45  api@ghi9012  prod-1,prod-2  rolled-back
# Filter by service
aracli history --service api

# Show last N deploys
aracli history --last 5

# JSON output for scripting
aracli history --json

Configuration Reference

Service Types

# Binary — uploads and runs an executable
[[services]]
name = "api"
type = "binary"
build = "make build"
artifact = "./build/api-server"
health = "http://localhost:8080/health"
env = ["DATABASE_URL", "API_KEY"]

# Docker — builds and pushes an image, then pulls on target
[[services]]
name = "web"
type = "docker"
build = "docker build -t myapp-web ."
image = "registry.example.com/myapp-web"
health = "http://localhost:3000/"

Target Options

[[targets]]
name = "prod-1"
host = "10.0.0.1"
user = "deploy"
port = 22
labels = ["region:us-east", "tier:primary"]

Deploy to labeled targets

# Deploy only to targets labeled region:us-east
aracli ship --label region:us-east

CI/CD Integration

GitHub Actions

- name: Deploy
  run: |
    aracli auth --key-env DEPLOY_SSH_KEY
    aracli ship --service api
  env:
    DEPLOY_SSH_KEY: ${{ secrets.DEPLOY_SSH_KEY }}

GitLab CI

deploy:
  script:
    - aracli auth --key-env DEPLOY_SSH_KEY
    - aracli ship --service api
  only:
    - main

Common Patterns

Pattern: Canary Deploy

Deploy to one target first, verify, then ship to the rest.

# Deploy to canary only
aracli ship --target prod-1

# Check health and metrics
aracli health --target prod-1

# If good, deploy everywhere
aracli ship

Pattern: Pre/Post Deploy Hooks

[hooks]
pre_deploy = "npm run migrate"
post_deploy = "curl -X POST https://hooks.slack.com/... -d '{\"text\": \"Deployed!\"}'"

Pattern: Multi-Environment

# Use a different config per environment
aracli ship --config aracli.staging.toml
aracli ship --config aracli.production.toml

Troubleshooting

Health check fails after deploy

# Check what's running
aracli status

# Tail the service logs
aracli logs api --target prod-1

# Rollback while you investigate
aracli rollback

SSH connection refused

# Verify connectivity
aracli auth --test

# Check target is reachable
ssh deploy@10.0.0.1 'echo ok'

Build fails during ship

aracli runs the build locally before uploading. Fix the build first:

# Run just the build step
aracli ship --build-only

# Then deploy the cached artifact
aracli ship --skip-build

Old process still running after deploy

# Force-stop the old version
aracli stop --service api --target prod-1

# Check for port conflicts
aracli status --verbose