Skip to content

Commit

Permalink
Merge pull request #234 from CircleCI-Public/CIRCLE-13830-tests-split…
Browse files Browse the repository at this point in the history
…-bug

[CIRCLE-13830]: Add a note regarding `circleci-agent` inside builds
  • Loading branch information
Zachary Scott authored Dec 20, 2018
2 parents 556938e + e01e8d6 commit 4403c8f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,18 @@ The CLI may also be used without installation by using Docker.
docker run --rm -v $(pwd):/data circleci/circleci-cli:alpine config validate /data/.circleci/config.yml --token $TOKEN
```

## circleci-agent

In order to maintain backwards compatibility with the `circleci` binary present in builds, some commands are proxied to a program called `circleci-agent`.

This program must exist in your `$PATH` as is the case inside of a job.

The following commands are affected:

* `circleci tests split`
* `circleci step halt`
* `circleci config migrate`

## Contributing

Development instructions for the CircleCI CLI can be found in [HACKING.md](HACKING.md).
Expand Down
5 changes: 2 additions & 3 deletions cmd/tests.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,19 @@ func newTestsCommand(config *settings.Config) *cobra.Command {
RunE: func(_ *cobra.Command, _ []string) error {
return globRun(opts)
},
Hidden: true,
}

splitCmd := &cobra.Command{
Use: "split",
Short: "Return a split batch of provided files",
Short: "Return a split batch of provided files (must be inside a build).",
Long: "This command wraps `circleci-agent` which must be run inside of a build.",
PreRun: func(cmd *cobra.Command, args []string) {
opts.args = args

},
RunE: func(_ *cobra.Command, _ []string) error {
return splitRunE(opts)
},
Hidden: true,
}
splitCmd.Flags().Uint("index", 0, "index of node.")
splitCmd.Flags().Uint("total", 1, "number of nodes.")
Expand Down

0 comments on commit 4403c8f

Please sign in to comment.