Skip to content

Commit b8c7f9e

Browse files
committed
feat: add demo task for local auto-update workflow of the Agent
1 parent e7ea376 commit b8c7f9e

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

Taskfile.yml

+20
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,26 @@ tasks:
149149
- task: go:vet
150150
- task: go:lint
151151

152+
autoupdate:demo:
153+
desc: Demo the local auto-update workflow for the Agent
154+
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/
155+
cmds:
156+
- task: go:build
157+
- go install github.com/sanbornm/go-selfupdate/...@latest
158+
# agent will search the new bin into "CreateAgent/Stable/{platform}.json" and "https://downloads.arduino.cc/CreateAgent/Stable/{version}/{platform}.gz"
159+
- go-selfupdate -o public/CreateAgent/Stable ./arduino-cloud-agent {{.VERSION}}
160+
- docker rm -f agent-static-server
161+
- docker run --rm -d -v "$PWD/public:/usr/share/nginx/html:ro" -p 3000:80 --name agent-static-server nginx:alpine
162+
- |
163+
echo "Waiting for http://127.0.0.1:3000 to become available..."
164+
until nc -z 127.0.0.1 3000; do
165+
sleep 1
166+
done
167+
echo "Server is up!"
168+
- curl -X POST http://127.0.0.1:8991/update
169+
170+
171+
152172
vars:
153173
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/release-go-task/Taskfile.yml
154174
PROJECT_NAME: arduino-cloud-agent

0 commit comments

Comments
 (0)