-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
1,059 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package cmd | ||
|
||
import ( | ||
"github.com/jlewi/p22h/backend/pkg/logging" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
func NewRootCmd() *cobra.Command { | ||
var level string | ||
var jsonLog bool | ||
rootCmd := &cobra.Command{ | ||
Short: "foyle releaser", | ||
PersistentPreRun: func(cmd *cobra.Command, args []string) { | ||
_, err := logging.InitLogger(level, !jsonLog) | ||
if err != nil { | ||
panic(err) | ||
} | ||
}, | ||
} | ||
rootCmd.PersistentFlags().StringVarP(&level, "level", "", "info", "The logging level.") | ||
rootCmd.PersistentFlags().BoolVarP(&jsonLog, "json-logs", "", false, "Enable json logging.") | ||
|
||
rootCmd.AddCommand(NewRunCmd()) | ||
return rootCmd | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package cmd | ||
|
||
import ( | ||
"fmt" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
func NewRunCmd() *cobra.Command { | ||
cmd := &cobra.Command{ | ||
Use: "run", | ||
Short: "Reconcile releases", | ||
Run: func(cmd *cobra.Command, args []string) { | ||
|
||
err := func() error { | ||
return Reconcile() | ||
}() | ||
if err != nil { | ||
fmt.Printf("generate failed; error %+v\n", err) | ||
} | ||
}, | ||
} | ||
return cmd | ||
} | ||
|
||
func Reconcile() error { | ||
// Use hydros to build the image | ||
|
||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
module github.com/jlewi/foyle/releaser | ||
|
||
go 1.22.1 | ||
|
||
require ( | ||
github.com/jlewi/p22h/backend v0.0.0-20220627190823-9107137fbd82 | ||
github.com/spf13/cobra v1.8.0 | ||
) | ||
|
||
require ( | ||
github.com/go-logr/logr v1.2.2 // indirect | ||
github.com/go-logr/zapr v1.2.2 // indirect | ||
github.com/inconshreveable/mousetrap v1.1.0 // indirect | ||
github.com/pkg/errors v0.9.1 // indirect | ||
github.com/spf13/pflag v1.0.5 // indirect | ||
go.uber.org/atomic v1.7.0 // indirect | ||
go.uber.org/multierr v1.6.0 // indirect | ||
go.uber.org/zap v1.19.0 // indirect | ||
) |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package main | ||
|
||
import ( | ||
"fmt" | ||
"github.com/jlewi/foyle/releaser/cmd" | ||
"os" | ||
) | ||
|
||
func main() { | ||
rootCmd := cmd.NewRootCmd() | ||
|
||
if err := rootCmd.Execute(); err != nil { | ||
fmt.Printf("Command failed with error: %+v", err) | ||
os.Exit(1) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Release foyle resources | ||
# https://github.com/jlewi/hydros/blob/main/docs/continuous_delivery.md | ||
apiVersion: hydros.dev/v1alpha1 | ||
kind: RepoConfig | ||
metadata: | ||
name: foyle | ||
namespace: foyle | ||
spec: | ||
repo: https://github.com/jlewi/foyle.git | ||
gitHubAppConfig: | ||
appID: 315982 | ||
privateKey: gcpsecretmanager:///projects/foyle-dev/secrets/foyle-ghapp-key/versions/latest | ||
globs: | ||
- "**/*.yaml" | ||
selectors: | ||
- matchLabels: | ||
env: release |