Deploy Agent
Push current or specified commit to a remote archetype agent host.
Arguments
- •
agent_id(optional): Agent ID to deploy to. Defaults to Agent-01 (614fc24c). - •
sha(optional): Git commit SHA to deploy. Defaults to current HEAD.
Known Agents
| Name | ID | Address | Mode |
|---|---|---|---|
| Agent-01 | 614fc24c | 10.14.23.181:8001 | systemd |
Steps
- •
Determine the target SHA:
- •If a SHA was provided as argument, use it
- •Otherwise, run
git rev-parse HEADto get the current commit
- •
Determine the agent ID:
- •If an agent ID was provided, use it
- •Otherwise, default to
614fc24c(Agent-01)
- •
Get the API base URL from the
.envfile (INTERNAL_URLvalue, e.g.http://10.14.23.93:8000) - •
Trigger the update:
bashcurl -X POST http://<api_host>:8000/agents/<agent_id>/update \ -H "Content-Type: application/json" \ -d '{"target_version": "<sha>"}' - •
Poll for completion (every 5 seconds, up to 2 minutes):
bashcurl http://<api_host>:8000/agents/<agent_id>/update-status
- •
Report the final status to the user (success, failed, or timeout).
Prerequisites
- •
INTERNAL_URLin.envmust be the host IP (e.g.,http://10.14.23.93:8000), NOT localhost - •The target commit must be pushed to the remote repository first
- •Agent must be registered and reachable from the API