スキル一覧に戻る
koedame

test-server-deploy

by koedame

0🍴 0📅 2026年1月24日
GitHubで見るManusで実行

SKILL.md


name: test-server-deploy description: Deploy services to test server via SSH. Builds Docker images locally, transfers them, and cleans up old images on both host and remote. allowed-tools: Bash(docker *), Bash(ansible-playbook *), Bash(gzip *), Bash(cargo run *), Bash(ssh *), Bash(rm *), Bash(ls *), Bash(sleep *), Read

Test Server Deploy

Deploy jamjam services (signaling-server, echo-server, cloudflared) to the test server.

Includes automatic cleanup of unused Docker images on both the local machine and remote server to prevent disk bloat.

Instructions

1. Build Docker Images

Build both images locally for AMD64 platform (test server is x86_64):

docker build --platform linux/amd64 -f Dockerfile.signaling -t jamjam-signaling:latest .
docker build --platform linux/amd64 -f Dockerfile.echo -t jamjam-echo:latest .

Note: The --platform linux/amd64 flag is required when building on Apple Silicon (ARM64) Mac for deployment to x86_64 servers. If you encounter platform mismatch errors on the server, rebuild with --no-cache:

docker build --platform linux/amd64 --no-cache -f Dockerfile.signaling -t jamjam-signaling:latest .
docker build --platform linux/amd64 --no-cache -f Dockerfile.echo -t jamjam-echo:latest .

2. Cleanup Old Images (Host)

After building, remove dangling images on the local machine to prevent disk bloat:

docker image prune -f

This removes:

  • Intermediate build layers no longer used
  • Untagged images left behind by previous builds

Report how much space was reclaimed.

3. Export Images

Save and compress the images for transfer:

rm -f /tmp/jamjam-images.tar.gz
docker save jamjam-signaling:latest jamjam-echo:latest | gzip > /tmp/jamjam-images.tar.gz
ls -lh /tmp/jamjam-images.tar.gz

Report the file size to the user (typically ~35MB).

4. Deploy via Ansible

Run the Ansible playbook to deploy:

cd ansible && ansible-playbook -i inventory/test.yml playbooks/site.yml

This will:

  • Transfer the Docker images to the server
  • Load the images into Docker
  • Create/update .env file with environment variables
  • Create/update docker-compose.yml
  • Start or restart services
  • Wait for services to become healthy

5. Cleanup Old Images (Remote)

After deployment, remove unused images on the remote server:

ssh -i PrivateDocs/jamjam_vps ubuntu@160.16.61.28 "docker image prune -f"

This removes old versions of images that are no longer tagged (replaced by the new deployment).

Report how much space was reclaimed on the server.

6. Cleanup (Local Temp Files)

Remove the temporary image archive:

rm -f /tmp/jamjam-images.tar.gz

7. Verify Server Status

Check service status on the server:

ssh -i PrivateDocs/jamjam_vps ubuntu@160.16.61.28 "cd /opt/jamjam && docker compose ps"

All three services should be running:

  • jamjam-signaling - healthy
  • jamjam-echo - healthy
  • jamjam-cloudflared - running (no healthcheck)

8. Test CLI Connection

Test the signaling server connection using the CLI:

cargo run --release --bin jamjam -- rooms --server wss://test-signaling-jamjam.koeda.me

Expected output:

INFO Connecting to signaling server: wss://test-signaling-jamjam.koeda.me
INFO Connected, listing rooms...
Available rooms:
  xxxxxxxx - [BOT] Echo Server (1000ms delay) (1/10 peers)

If the Echo Server room appears, the deployment is successful.

Server Information

ItemValue
Host160.16.61.28
Userubuntu
SSH KeyPrivateDocs/jamjam_vps
App Directory/opt/jamjam

Services Deployed

  • signaling-server - WebSocket signaling server (port 8080, localhost only)
  • echo-server - Audio echo test server (port 5000/UDP)
  • cloudflared - Cloudflare Tunnel for TLS termination

Troubleshooting

If deployment fails:

  1. Platform mismatch error ("The requested image's platform (linux/arm64) does not match the detected host platform (linux/amd64)"):

    • This occurs when building on Apple Silicon without specifying the target platform
    • Solution: Rebuild images with --platform linux/amd64 --no-cache flags
    • See Step 1 for the correct build commands
  2. Check SSH connectivity:

    ssh -i PrivateDocs/jamjam_vps ubuntu@160.16.61.28 "echo OK"
    
  3. Check Docker images on server:

    ssh -i PrivateDocs/jamjam_vps ubuntu@160.16.61.28 "docker images | grep jamjam"
    
  4. Check container logs:

    ssh -i PrivateDocs/jamjam_vps ubuntu@160.16.61.28 "cd /opt/jamjam && docker compose logs --tail=50"
    

スコア

総合スコア

60/100

リポジトリの品質指標に基づく評価

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

+10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

レビュー

💬

レビュー機能は近日公開予定です