-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add initial skeleton with cli options
- Loading branch information
1 parent
64d7f04
commit 09a96fa
Showing
8 changed files
with
587 additions
and
19 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
APP_NAME=jira-changelog | ||
APP_NAME=jira_changelog | ||
|
||
all: clean fmt tidy build install | ||
|
||
|
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 |
---|---|---|
@@ -1,22 +1,34 @@ | ||
/* | ||
Copyright © 2023 NAME HERE <EMAIL ADDRESS> | ||
*/ | ||
package cmd | ||
|
||
import ( | ||
"fmt" | ||
|
||
jira "github.com/handofgod94/jira_changelog/pkg/jira_changelog" | ||
"github.com/spf13/cobra" | ||
"golang.org/x/exp/slog" | ||
) | ||
|
||
var ( | ||
fromRef string | ||
toRef string | ||
) | ||
|
||
var generateCmd = &cobra.Command{ | ||
Use: "generate", | ||
Short: "Generates changelog", | ||
Run: func(cmd *cobra.Command, args []string) { | ||
fmt.Println("generate called") | ||
changelog := jira.Changelog{ | ||
JiraConfig: jira.JiraConfig{ProjectUrl: projectUrl, ProjectName: projectName, ApiToken: apiToken}, | ||
GitConfig: jira.GitConfig{FromRef: fromRef, ToRef: toRef}, | ||
} | ||
slog.Info("Generating changelog", "Jira Config", changelog.JiraConfig, "Git Config", changelog.GitConfig) | ||
changelog.Generate() | ||
}, | ||
} | ||
|
||
func init() { | ||
generateCmd.Flags().StringVar(&fromRef, "from", "", "Git ref to start from") | ||
generateCmd.Flags().StringVar(&toRef, "to", "main", "Git ref to end at") | ||
|
||
generateCmd.MarkFlagRequired("from") | ||
|
||
rootCmd.AddCommand(generateCmd) | ||
} |
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 |
---|---|---|
@@ -1,10 +1,27 @@ | ||
module github.com/handofgod94/jira-changelog | ||
module github.com/handofgod94/jira_changelog | ||
|
||
go 1.20 | ||
|
||
require github.com/spf13/cobra v1.7.0 | ||
require ( | ||
github.com/spf13/cobra v1.7.0 | ||
github.com/spf13/viper v1.16.0 | ||
golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 | ||
) | ||
|
||
require ( | ||
github.com/fsnotify/fsnotify v1.6.0 // indirect | ||
github.com/hashicorp/hcl v1.0.0 // indirect | ||
github.com/inconshreveable/mousetrap v1.1.0 // indirect | ||
github.com/magiconair/properties v1.8.7 // indirect | ||
github.com/mitchellh/mapstructure v1.5.0 // indirect | ||
github.com/pelletier/go-toml/v2 v2.0.8 // indirect | ||
github.com/spf13/afero v1.9.5 // indirect | ||
github.com/spf13/cast v1.5.1 // indirect | ||
github.com/spf13/jwalterweatherman v1.1.0 // indirect | ||
github.com/spf13/pflag v1.0.5 // indirect | ||
github.com/subosito/gotenv v1.4.2 // indirect | ||
golang.org/x/sys v0.8.0 // indirect | ||
golang.org/x/text v0.9.0 // indirect | ||
gopkg.in/ini.v1 v1.67.0 // indirect | ||
gopkg.in/yaml.v3 v3.0.1 // indirect | ||
) |
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,12 @@ | ||
package jira_changelog | ||
|
||
type JiraConfig struct { | ||
ProjectUrl string | ||
ProjectName string | ||
ApiToken string | ||
} | ||
|
||
type GitConfig struct { | ||
FromRef string | ||
ToRef string | ||
} |
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,10 @@ | ||
package jira_changelog | ||
|
||
type Changelog struct { | ||
JiraConfig JiraConfig | ||
GitConfig GitConfig | ||
} | ||
|
||
func (c Changelog) Generate() { | ||
|
||
} |