Skip to content
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
13 changes: 7 additions & 6 deletions Taskfile.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: "3"

vars:
BINARY_NAME: cagent{{if eq OS "windows"}}.exe{{end}}
DEPRECATED_BINARY_NAME: cagent{{if eq OS "windows"}}.exe{{end}}
CLI_PLUGIN_BINARY_NAME: docker-agent{{if eq OS "windows"}}.exe{{end}}
MAIN_PKG: ./main.go
BUILD_DIR: ./bin
Expand All @@ -24,8 +24,9 @@ tasks:
aliases: [b]
desc: Build the application binary
cmds:
- go build -ldflags "{{.LDFLAGS}}" -o {{.BUILD_DIR}}/{{.BINARY_NAME}} {{.MAIN_PKG}}
- '{{if ne .CI "true"}}ln -sf {{.USER_WORKING_DIR}}/{{.BUILD_DIR}}/{{.BINARY_NAME}} {{.HOME}}/bin/{{.BINARY_NAME}}{{end}}'
- go build -ldflags "{{.LDFLAGS}}" -o {{.BUILD_DIR}}/{{.CLI_PLUGIN_BINARY_NAME}} {{.MAIN_PKG}}
- cp "{{.BUILD_DIR}}/{{.CLI_PLUGIN_BINARY_NAME}}" {{.BUILD_DIR}}/{{.DEPRECATED_BINARY_NAME}}
- '{{if ne .CI "true"}}ln -sf {{.USER_WORKING_DIR}}/{{.BUILD_DIR}}/{{.CLI_PLUGIN_BINARY_NAME}} {{.HOME}}/bin/{{.CLI_PLUGIN_BINARY_NAME}}{{end}}'
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MEDIUM: Missing symlink for DEPRECATED_BINARY_NAME breaks backward compatibility

The build task creates a symlink in ~/bin only for docker-agent (CLI_PLUGIN_BINARY_NAME), but not for cagent (DEPRECATED_BINARY_NAME). Users who previously relied on having ~/bin/cagent in their PATH will lose that functionality after this change.

While the deprecated binary copy exists in BUILD_DIR, the missing symlink means users won't have the convenient cagent command available from their PATH.

Suggestion: Add a second symlink for backward compatibility:

- '{{if ne .CI "true"}}ln -sf {{.USER_WORKING_DIR}}/{{.BUILD_DIR}}/{{.DEPRECATED_BINARY_NAME}} {{.HOME}}/bin/{{.DEPRECATED_BINARY_NAME}}{{end}}'

Copy link
Contributor Author

@gtardif gtardif Mar 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed that symlink on purpose, we want users to start using docker-agent instead of cagent (happy to change if anyone else disagree)

sources:
- "{{.GO_SOURCES}}"
- "**/*.template"
Expand All @@ -34,15 +35,15 @@ tasks:
- "go.mod"
- "go.sum"
generates:
- "{{.BUILD_DIR}}/{{.BINARY_NAME}}"
- "{{.BUILD_DIR}}/{{.CLI_PLUGIN_BINARY_NAME}}"
- "{{.BUILD_DIR}}/{{.DEPRECATED_BINARY_NAME}}"

deploy-local:
desc: Deploy the docker agent cli-plugin
deps: ["build"]
cmds:
- mkdir -p ~/.docker/cli-plugins
- cp "{{.BUILD_DIR}}/{{.BINARY_NAME}}" ~/.docker/cli-plugins/{{.CLI_PLUGIN_BINARY_NAME}}
- cp "{{.BUILD_DIR}}/{{.BINARY_NAME}}" {{.BUILD_DIR}}/{{.CLI_PLUGIN_BINARY_NAME}}
- cp -P "{{.BUILD_DIR}}/{{.CLI_PLUGIN_BINARY_NAME}}" ~/.docker/cli-plugins/{{.CLI_PLUGIN_BINARY_NAME}}

lint:
desc: Run golangci-lint
Expand Down