Skip to content

Commit f989a69

Browse files
authored
Add many new features and some small fixes (#44)
1 parent 62f5b3c commit f989a69

File tree

160 files changed

+8294
-3664
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

160 files changed

+8294
-3664
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ jobs:
1212
strategy:
1313
matrix:
1414
os: [ubuntu-latest]
15-
go: [1.18]
15+
go: [1.19]
1616

1717
steps:
1818
- name: Set up Go
1919
uses: actions/setup-go@v3
2020
with:
21-
go-version: 1.18
21+
go-version: 1.19
2222

2323
- name: Check out code
2424
uses: actions/checkout@v3

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- name: Set up Go
1919
uses: actions/setup-go@v3
2020
with:
21-
go-version: 1.18
21+
go-version: 1.19
2222

2323
- name: Create release notes
2424
run: ./scripts/release.sh

Makefile

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ NAME := sake
22
PACKAGE := github.com/alajmo/$(NAME)
33
DATE := $(shell date +%FT%T%Z)
44
GIT := $(shell [ -d .git ] && git rev-parse --short HEAD)
5-
VERSION := v0.12.1
5+
VERSION := v0.13.0
66

77
default: build
88

@@ -28,17 +28,15 @@ benchmark-save:
2828

2929
test:
3030
# Unit tests
31-
go test -v ./core/*.go -v
32-
go test -v ./core/dao/*.go -v
31+
go test -v ./core/...
3332

3433
# Integration tests
3534
cd ./test && docker-compose up -d
3635
go test -v ./test/integration/... -count=5 -clean
3736
cd ./test && docker-compose down
3837

3938
unit-test:
40-
go test -v ./core/*.go -v
41-
go test -v ./core/dao/*.go -v
39+
go test -v ./core/...
4240

4341
integration-test:
4442
go test -v ./test/integration/... -clean

README.md

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ This readme is also accessible on [sakecli.com](https://sakecli.com/).
4040

4141
![demo](res/output.gif)
4242

43-
Interested in managing your git repositiories in a similar way? Check out [mani](https://github.com/alajmo/mani)!
43+
Interested in managing your git repositories in a similar way? Check out [mani](https://github.com/alajmo/mani)!
4444

4545
## Table of Contents
4646

@@ -78,7 +78,7 @@ Auto-completion is available via `sake completion bash|zsh|fish` and man page vi
7878

7979
### Building From Source
8080

81-
Requires [go 1.18 or above](https://golang.org/doc/install).
81+
Requires [go 1.19 or above](https://golang.org/doc/install).
8282

8383
1. Clone the repo
8484
2. Build and run the executable
@@ -133,7 +133,7 @@ TASK ping: Pong ************
133133
0.0.0.0 | pong
134134
135135
# Count number of files in each server in parallel
136-
$ sake exec --all --output table --parallel 'find . -type f | wc -l'
136+
$ sake exec --all --output table --strategy=free 'find . -type f | wc -l'
137137
138138
Server | Output
139139
-----------+--------
@@ -150,10 +150,22 @@ Check out the [examples page](/docs/examples.md) for more advanced examples and
150150
- [Recipes](docs/recipes.md)
151151
- [Config Reference](docs/config-reference.md)
152152
- [Command Reference](docs/command-reference.md)
153+
- Documentation
154+
- [Inventory](docs/inventory.md)
155+
- [Task Execution](docs/task-execution.md)
156+
- [Error Handling](docs/error-handling.md)
157+
- [Variables](docs/variables.md)
158+
- [Working Directory](docs/work-dir.md)
159+
- [Output](docs/output.md)
160+
- Project
161+
- [Background](docs/background.md)
162+
- [Roadmap](docs/roadmap.md)
163+
- [Ansible](docs/ansible.md)
164+
- [Performance](docs/performance.md)
165+
- Development
166+
- [Development](docs/development.md)
167+
- [Contributing](docs/contributing.md)
153168
- [Changelog](docs/changelog.md)
154-
- [Roadmap](docs/roadmap.md)
155-
- [Project Background](docs/project-background.md)
156-
- [Contributing](docs/contributing.md)
157169

158170
## [License](LICENSE)
159171

cmd/completion.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ PowerShell:
5151
# and source this file from your PowerShell profile.
5252
`,
5353
ValidArgs: []string{"bash", "zsh", "fish", "powershell"},
54-
Args: cobra.ExactValidArgs(1),
54+
Args: cobra.MatchAll(cobra.ExactArgs(1), cobra.OnlyValidArgs),
5555
Run: generateCompletion,
5656
}
5757

cmd/describe.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ func describeCmd(config *dao.Config, configErr *error) *cobra.Command {
1010
cmd := cobra.Command{
1111
Aliases: []string{"desc"},
1212
Use: "describe <servers|tasks>",
13-
Short: "Describe servers and tasks",
14-
Long: "Describe servers and tasks.",
13+
Short: "Describe servers, tasks, specs and targets",
14+
Long: "Describe servers, tasks, specs and targets",
1515
Example: ` # Describe servers
1616
sake describe servers
1717

cmd/describe_servers.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,7 @@ func describeServersCmd(config *dao.Config, configErr *error) *cobra.Command {
3737
return values, cobra.ShellCompDirectiveNoFileComp
3838
},
3939
}
40-
41-
cmd.Flags().StringVarP(&serverFlags.Regex, "regex", "r", "", "filter servers on host regex")
42-
43-
cmd.Flags().BoolVarP(&serverFlags.Invert, "invert", "v", false, "invert matching on servers")
40+
cmd.Flags().SortFlags = false
4441

4542
cmd.Flags().StringSliceVarP(&serverFlags.Tags, "tags", "t", []string{}, "filter servers by their tag")
4643
err := cmd.RegisterFlagCompletionFunc("tags", func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
@@ -53,6 +50,8 @@ func describeServersCmd(config *dao.Config, configErr *error) *cobra.Command {
5350
})
5451
core.CheckIfError(err)
5552

53+
cmd.Flags().StringVarP(&serverFlags.Regex, "regex", "r", "", "filter servers on host regex")
54+
cmd.Flags().BoolVarP(&serverFlags.Invert, "invert", "v", false, "invert matching on servers")
5655
cmd.Flags().BoolVarP(&serverFlags.Edit, "edit", "e", false, "edit server")
5756

5857
return &cmd

cmd/describe_specs.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ func describeSpecsCmd(config *dao.Config, configErr *error) *cobra.Command {
3232
},
3333
DisableAutoGenTag: true,
3434
}
35+
cmd.Flags().SortFlags = false
3536

3637
cmd.Flags().BoolVarP(&specFlags.Edit, "edit", "e", false, "edit spec")
3738

cmd/describe_targets.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ func describeTargetsCmd(config *dao.Config, configErr *error) *cobra.Command {
3232
},
3333
DisableAutoGenTag: true,
3434
}
35+
cmd.Flags().SortFlags = false
3536

3637
cmd.Flags().BoolVarP(&targetFlags.Edit, "edit", "e", false, "edit target")
3738

cmd/describe_tasks.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ func describeTasksCmd(config *dao.Config, configErr *error) *cobra.Command {
3636
DisableAutoGenTag: true,
3737
}
3838

39+
cmd.Flags().SortFlags = false
40+
3941
cmd.Flags().BoolVarP(&taskFlags.Edit, "edit", "e", false, "edit task")
4042

4143
return &cmd

0 commit comments

Comments
 (0)