Skip to content

Commit

Permalink
🔊 Add GitHub Actions logging support
Browse files Browse the repository at this point in the history
  • Loading branch information
gabe565 committed Dec 7, 2021
1 parent 26e9071 commit fd5eb5e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ func init() {
Command.PersistentFlags().String("kubeconfig", kubeconfigDefault, "absolute path to the kubeconfig file")
Command.PersistentFlags().StringP("namespace", "n", "", "the namespace scope for this CLI request")

Command.PersistentFlags().Bool("github-actions", false, "Enables GitHub Actions log output")
_ = Command.PersistentFlags().MarkHidden("github-actions")

Command.AddCommand(
exec.Command,
dump.Command,
Expand Down
4 changes: 4 additions & 0 deletions cmd/dump/dump.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"bufio"
"bytes"
"compress/gzip"
"fmt"
"github.com/clevyr/kubedb/internal/database/sqlformat"
"github.com/clevyr/kubedb/internal/kubernetes"
"github.com/clevyr/kubedb/internal/postgres"
Expand Down Expand Up @@ -111,6 +112,9 @@ func run(cmd *cobra.Command, args []string) (err error) {
pr, pw := io.Pipe()

log.Println("Dumping \"" + postgresPod.Name + "\" to \"" + filename + "\"")
if githubActions, _ := cmd.Flags().GetBool("github-actions"); githubActions {
fmt.Println("::set-output name=filename::" + filename)
}

ch := make(chan error)
go func() {
Expand Down

0 comments on commit fd5eb5e

Please sign in to comment.