-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #58 from minnek-digital-studio/feature/55
feature/55
- Loading branch information
Showing
18 changed files
with
190 additions
and
136 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
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,7 @@ | ||
# These owners will be the default owners for everything in | ||
# the repo. Unless a later match takes precedence, | ||
# @global-owner1 and @global-owner2 will be requested for | ||
# review when someone opens a pull request. | ||
# | ||
# Change the owner's username with the project lead. | ||
* @isaacismaelx14 |
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,38 @@ | ||
name: Tests | ||
on: [pull_request] | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
build: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest, windows-latest, macos-latest] | ||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- name: Set up Go 1.19 | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.19 | ||
|
||
- name: Check out code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Restore Go modules cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/go/pkg/mod | ||
key: go-${{ runner.os }}-${{ hashFiles('go.mod') }} | ||
restore-keys: | | ||
go-${{ runner.os }}- | ||
- name: Download dependencies | ||
run: go mod download | ||
|
||
# - name: Run tests | ||
# run: go test -race ./... | ||
|
||
- name: Build | ||
run: go build -v ./... |
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/Minnek-Digital-Studio/cominnek/cmd/branch" | ||
pkg_action "github.com/Minnek-Digital-Studio/cominnek/pkg/cli/actions" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
var branchCmd = &cobra.Command{ | ||
Use: "branch", | ||
Short: "Create a new branch. This is variant of git-flow by Minnek", | ||
Run: func(cmd *cobra.Command, args []string) { | ||
pkg_action.Branch() | ||
}, | ||
} | ||
|
||
func init() { | ||
branch.SetFlags() | ||
branchCmd.AddCommand(branch.BranchFeatureCmd) | ||
branchCmd.AddCommand(branch.BranchReleaseCmd) | ||
branchCmd.AddCommand(branch.BranchHotfixCmd) | ||
branchCmd.AddCommand(branch.BranchSupportCmd) | ||
branchCmd.AddCommand(branch.BranchBugfixCmd) | ||
rootCmd.AddCommand(branchCmd) | ||
} |
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,19 +1,19 @@ | ||
package flow | ||
package branch | ||
|
||
import ( | ||
"github.com/Minnek-Digital-Studio/cominnek/config" | ||
pkg_action "github.com/Minnek-Digital-Studio/cominnek/pkg/cli/actions" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
var FlowBugfixCmd = &cobra.Command{ | ||
var BranchBugfixCmd = &cobra.Command{ | ||
Use: "bugfix <name>", | ||
Short: "create a new feature branch", | ||
Short: "create a new feature branch from develop", | ||
Run: func(cmd *cobra.Command, args []string) { | ||
config.AppData.Flow.Type = "bugfix" | ||
config.AppData.Flow.Stash = stash | ||
config.AppData.Branch.Type = "bugfix" | ||
config.AppData.Branch.Stash = stash | ||
setTicket(args) | ||
|
||
pkg_action.Flow() | ||
pkg_action.Branch() | ||
}, | ||
} |
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,19 +1,19 @@ | ||
package flow | ||
package branch | ||
|
||
import ( | ||
"github.com/Minnek-Digital-Studio/cominnek/config" | ||
pkg_action "github.com/Minnek-Digital-Studio/cominnek/pkg/cli/actions" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
var FlowFeatureCmd = &cobra.Command{ | ||
var BranchFeatureCmd = &cobra.Command{ | ||
Use: "feature <name>", | ||
Short: "create a new feature branch", | ||
Short: "create a new feature branch from develop", | ||
Run: func(cmd *cobra.Command, args []string) { | ||
config.AppData.Flow.Type = "feature" | ||
config.AppData.Flow.Stash = stash | ||
config.AppData.Branch.Type = "feature" | ||
config.AppData.Branch.Stash = stash | ||
setTicket(args) | ||
|
||
pkg_action.Flow() | ||
pkg_action.Branch() | ||
}, | ||
} |
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,19 +1,19 @@ | ||
package flow | ||
package branch | ||
|
||
import ( | ||
"github.com/Minnek-Digital-Studio/cominnek/config" | ||
pkg_action "github.com/Minnek-Digital-Studio/cominnek/pkg/cli/actions" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
var FlowHotfixCmd = &cobra.Command{ | ||
var BranchHotfixCmd = &cobra.Command{ | ||
Use: "hotfix <name>", | ||
Short: "create a new hotfix branch", | ||
Short: "create a new hotfix branch from master", | ||
Run: func(cmd *cobra.Command, args []string) { | ||
config.AppData.Flow.Type = "hotfix" | ||
config.AppData.Flow.Stash = stash | ||
config.AppData.Branch.Type = "hotfix" | ||
config.AppData.Branch.Stash = stash | ||
setTicket(args) | ||
|
||
pkg_action.Flow() | ||
pkg_action.Branch() | ||
}, | ||
} |
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,19 +1,19 @@ | ||
package flow | ||
package branch | ||
|
||
import ( | ||
"github.com/Minnek-Digital-Studio/cominnek/config" | ||
pkg_action "github.com/Minnek-Digital-Studio/cominnek/pkg/cli/actions" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
var FlowReleaseCmd = &cobra.Command{ | ||
var BranchReleaseCmd = &cobra.Command{ | ||
Use: "release <name>", | ||
Short: "create a new release branch", | ||
Short: "create a new release branch from develop", | ||
Run: func(cmd *cobra.Command, args []string) { | ||
config.AppData.Flow.Type = "release" | ||
config.AppData.Flow.Stash = stash | ||
config.AppData.Branch.Type = "release" | ||
config.AppData.Branch.Stash = stash | ||
setTicket(args) | ||
|
||
pkg_action.Flow() | ||
pkg_action.Branch() | ||
}, | ||
} |
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,19 +1,19 @@ | ||
package flow | ||
package branch | ||
|
||
import ( | ||
"github.com/Minnek-Digital-Studio/cominnek/config" | ||
pkg_action "github.com/Minnek-Digital-Studio/cominnek/pkg/cli/actions" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
var FlowSupportCmd = &cobra.Command{ | ||
var BranchSupportCmd = &cobra.Command{ | ||
Use: "support <name>", | ||
Short: "create a new support branch", | ||
Short: "create a new support branch from master", | ||
Run: func(cmd *cobra.Command, args []string) { | ||
config.AppData.Flow.Type = "support" | ||
config.AppData.Flow.Stash = stash | ||
config.AppData.Branch.Type = "support" | ||
config.AppData.Branch.Stash = stash | ||
setTicket(args) | ||
|
||
pkg_action.Flow() | ||
pkg_action.Branch() | ||
}, | ||
} |
This file was deleted.
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
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,27 @@ | ||
package git_controller | ||
|
||
import "fmt" | ||
|
||
func getBaseCmd(branch string) string { | ||
return fmt.Sprintf("git branch %s; git checkout %s", branch, branch) | ||
} | ||
|
||
func Feature(ticket string) string { | ||
return getBaseCmd("feature/" + ticket) | ||
} | ||
|
||
func Bugfix(ticket string) string { | ||
return getBaseCmd("bugfix/" + ticket) | ||
} | ||
|
||
func Hotfix(ticket string) string { | ||
return getBaseCmd("hotfix/" + ticket) | ||
} | ||
|
||
func Release(ticket string) string { | ||
return getBaseCmd("release/" + ticket) | ||
} | ||
|
||
func Support(ticket string) string { | ||
return getBaseCmd("support/" + ticket) | ||
} |
Oops, something went wrong.