Skip to content

ci(Taskfile): add a command to test autoupdate #1033

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 15, 2025
Merged
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
14 changes: 14 additions & 0 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,20 @@ tasks:
- task: go:vet
- task: go:lint

autoupdate:demo:
desc: Demo the local auto-update workflow for the Agent (for linux and mac user)
prompt: Before continuing, please make sure you’ve opened the "Open Configuration" option from the Agent menu and set the updateUrl=http://127.0.0.1:3000/
cmds:
- task: go:build
- go install github.com/sanbornm/go-selfupdate/...@latest
# NOTE: the path 'CreateAgent/Stable' is important to keep as is
# because agent searches the update files into "CreateAgent/Stable/{platform}.json" and "https://downloads.arduino.cc/CreateAgent/Stable/{version}/{platform}.gz"
- go-selfupdate -o public/CreateAgent/Stable ./arduino-cloud-agent {{.VERSION}}
- docker rm -f agent-static-server
- docker run --rm -d -v "$PWD/public:/usr/share/nginx/html:ro" -p 3000:80 --name agent-static-server nginx:alpine
- sleep 5 # wait the server is up before starting the update
- curl -X POST http://127.0.0.1:8991/update

vars:
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/release-go-task/Taskfile.yml
PROJECT_NAME: arduino-cloud-agent
Expand Down
Loading