Skip to content

Commit

Permalink
Add a RepoConfig.yaml file.
Browse files Browse the repository at this point in the history
  • Loading branch information
jlewi committed Apr 11, 2024
1 parent febf4ff commit e8901ec
Show file tree
Hide file tree
Showing 7 changed files with 1,059 additions and 1 deletion.
2 changes: 1 addition & 1 deletion frontend/foyle/image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
name: vscode-ext
namespace: foyle
labels:
env: dev
env: release
spec:
image: us-west1-docker.pkg.dev/foyle-public/images/foyle-vscode-ext
source:
Expand Down
25 changes: 25 additions & 0 deletions releaser/cmd/root.go
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
}
29 changes: 29 additions & 0 deletions releaser/cmd/run.go
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
}
19 changes: 19 additions & 0 deletions releaser/go.mod
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
)
952 changes: 952 additions & 0 deletions releaser/go.sum

Large diffs are not rendered by default.

16 changes: 16 additions & 0 deletions releaser/main.go
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)
}
}
17 changes: 17 additions & 0 deletions releasing.yaml
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

0 comments on commit e8901ec

Please sign in to comment.