Skip to content

Commit ae9ea6d

Browse files
committed
Action runner initial work
1 parent 5bb64b7 commit ae9ea6d

4 files changed

Lines changed: 397 additions & 0 deletions

File tree

cmd/actions.go

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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+
}

go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff 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

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/f
2828
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
2929
github.com/sagikazarmark/locafero v0.11.0 h1:1iurJgmM9G3PA/I+wWYIOw/5SyBtxapeHDcg+AAIFXc=
3030
github.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=
3133
github.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8 h1:+jumHNA0Wrelhe64i8F6HNlS8pkoyMv5sreGx2Ry5Rw=
3234
github.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8/go.mod h1:3n1Cwaq1E1/1lhQhtRK2ts/ZwZEhjcQeJQ1RuC6Q/8U=
3335
github.com/spf13/afero v1.15.0 h1:b/YBCLWAJdFWJTN9cLhiXXcD7mzKn9Dm86dNnfyQw1I=

0 commit comments

Comments
 (0)