File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ package cmd
2+
3+ import (
4+ "gitte/config"
5+ "gitte/internal"
6+
7+ "github.com/spf13/cobra"
8+ )
9+
10+ // gitopsCmd represents the gitops command
11+ var actionsCmd = & cobra.Command {
12+ Use : "actions <action> <group> [project]" ,
13+ Annotations : map [string ]string {
14+ "need-config" : "true" ,
15+ },
16+ Short : "GitOps refer to GitOperations and will ensure that the enabled projects are cloned and up to date if possible." ,
17+ RunE : func (cmd * cobra.Command , args []string ) error {
18+ ctx := cmd .Context ()
19+ return internal .GitOps (ctx , config .CwdFromContext (ctx ), * config .ConfigFromContext (ctx ))
20+ },
21+ }
22+
23+ func init () {
24+ rootCmd .AddCommand (gitopsCmd )
25+ }
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ require (
1616 github.com/inconshreveable/mousetrap v1.1.0 // indirect
1717 github.com/pelletier/go-toml/v2 v2.2.4 // indirect
1818 github.com/sagikazarmark/locafero v0.11.0 // indirect
19+ github.com/samber/lo v1.52.0 // indirect
1920 github.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8 // indirect
2021 github.com/spf13/afero v1.15.0 // indirect
2122 github.com/spf13/cast v1.10.0 // indirect
Original file line number Diff line number Diff line change @@ -28,6 +28,8 @@ github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/f
2828github.com/russross/blackfriday/v2 v2.1.0 /go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM =
2929github.com/sagikazarmark/locafero v0.11.0 h1:1iurJgmM9G3PA/I+wWYIOw/5SyBtxapeHDcg+AAIFXc =
3030github.com/sagikazarmark/locafero v0.11.0 /go.mod h1:nVIGvgyzw595SUSUE6tvCp3YYTeHs15MvlmU87WwIik =
31+ github.com/samber/lo v1.52.0 h1:Rvi+3BFHES3A8meP33VPAxiBZX/Aws5RxrschYGjomw =
32+ github.com/samber/lo v1.52.0 /go.mod h1:4+MXEGsJzbKGaUEQFKBq2xtfuznW9oz/WrgyzMzRoM0 =
3133github.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8 h1:+jumHNA0Wrelhe64i8F6HNlS8pkoyMv5sreGx2Ry5Rw =
3234github.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8 /go.mod h1:3n1Cwaq1E1/1lhQhtRK2ts/ZwZEhjcQeJQ1RuC6Q/8U =
3335github.com/spf13/afero v1.15.0 h1:b/YBCLWAJdFWJTN9cLhiXXcD7mzKn9Dm86dNnfyQw1I =
You can’t perform that action at this time.
0 commit comments