Skip to content
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

Renamed --file to --playbook & SPOT_FILE to SPOT_PLAYBOOK #38

Merged
merged 1 commit into from
May 2, 2023
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ Spot (aka `simplotask`) is a powerful and easy-to-use tool for effortless deploy

Spot supports the following command-line options:

- `-p`, `--file=`: Specifies the playbook file to be used. Defaults to `spot.yml`. You can also set the environment
variable `$SPOT_FILE` to define the playbook file path.
- `-p`, `--playbook=`: Specifies the playbook file to be used. Defaults to `spot.yml`. You can also set the environment
variable `$SPOT_PLAYBOOK` to define the playbook file path.
- `-t`, `--task=`: Specifies the task name to execute. The task should be defined in the playbook file.
If not specified all the tasks will be executed.
- `-d`, `--target=`: Specifies the target name to use for the task execution. The target should be defined in the playbook file and can represent remote hosts, inventory files, or inventory URLs. If not specified the `default` target will be used. User can pass a host name or IP instead of the target name for a quick override. Providing the `-d`, `--target` flag multiple times with different targets sets multiple destination targets or multiple hosts, e.g., `-d prod -d dev` or `-d example1.com -d example2.com`.
Expand Down
2 changes: 1 addition & 1 deletion app/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ type options struct {
AdHocCmd string `positional-arg-name:"command" description:"run ad-hoc command on target hosts"`
} `positional-args:"yes" positional-optional:"yes"`

PlaybookFile string `short:"p" long:"file" env:"SPOT_FILE" description:"playbook file" default:"spot.yml"`
PlaybookFile string `short:"p" long:"playbook" env:"SPOT_PLAYBOOK" description:"playbook file" default:"spot.yml"`
TaskName string `short:"t" long:"task" description:"task name"`
Targets []string `short:"d" long:"target" description:"target name" default:"default"`
Concurrent int `short:"c" long:"concurrent" description:"concurrent tasks" default:"1"`
Expand Down
2 changes: 1 addition & 1 deletion app/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func Test_main(t *testing.T) {
hostAndPort, teardown := startTestContainer(t)
defer teardown()

args := []string{"simplotask", "--dbg", "--file=runner/testdata/conf-local.yml", "--user=test", "--key=runner/testdata/test_ssh_key", "--target=" + hostAndPort}
args := []string{"simplotask", "--dbg", "--playbook=runner/testdata/conf-local.yml", "--user=test", "--key=runner/testdata/test_ssh_key", "--target=" + hostAndPort}
os.Args = args
main()
}
Expand Down