Skip to content

Commit 0979ee3

Browse files
committed
close #183 phlow configuration
1 parent 6d5730d commit 0979ee3

File tree

16 files changed

+302
-174
lines changed

16 files changed

+302
-174
lines changed

.phlow

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
[default]
2+
integration_branch = master
3+
remote = origin
4+
service = github
5+
delivery_branch_prefix = ready
6+
[jira]
7+
integration_branch = gh_pages
8+
remote = fork
9+
service = jira
10+
delivery_branch_prefix = integrateme
11+
12+
[gitlab]
13+
integration_branch = gh_pages
14+
remote = fork
15+
service = jira
16+
delivery_branch_prefix = integrateme

ci/pipeline.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ jobs:
5555
- name: darwin-pilot-check
5656
plan:
5757
- get: gp-version
58+
passed: [heating-engines, deploying-flaps]
5859
- get: git-phlow
5960
passed: [heating-engines, deploying-flaps]
6061
trigger: true
@@ -66,6 +67,7 @@ jobs:
6667
- name: linux-pilot-check
6768
plan:
6869
- get: gp-version
70+
passed: [heating-engines, deploying-flaps]
6971
- get: git-phlow
7072
passed: [heating-engines, deploying-flaps]
7173
trigger: true
@@ -77,6 +79,7 @@ jobs:
7779
- name: windows-pilot-check
7880
plan:
7981
- get: gp-version
82+
passed: [heating-engines, deploying-flaps]
8083
- get: git-phlow
8184
passed: [heating-engines, deploying-flaps]
8285
trigger: true

cmd/cmdperm/prerunperm.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ import (
66

77
"github.com/praqma/git-phlow/githandler"
88
"github.com/praqma/git-phlow/ui"
9-
"github.com/praqma/git-phlow/platform"
9+
"github.com/praqma/git-phlow/setting"
1010
)
1111

1212
//RequiredAuthentication ...
1313
//Validates if the user has logged in before running the command
1414
func RequiredAuthentication() {
15-
conf := platform.DefaultConfiguration()
16-
token := conf.Get(platform.PhlowToken)
17-
user := conf.Get(platform.PhlowUser)
15+
stg := setting.NewToolStg()
16+
token := stg.Token
17+
user := stg.User
1818

1919
if token == "" || user == "" {
2020
fmt.Printf("Please run %s to connect to github \n", ui.Format.Bold("auth"))

main.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
package main
22

3-
import (
4-
"github.com/praqma/git-phlow/cmd"
5-
)
3+
import "github.com/praqma/git-phlow/cmd"
64

75
func main() {
86
cmd.Execute()

phlow/auth.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,22 @@ import (
1010
"golang.org/x/crypto/ssh/terminal"
1111
"io"
1212
"github.com/praqma/git-phlow/plugins"
13-
"github.com/praqma/git-phlow/platform"
1413
"github.com/praqma/git-phlow/executor"
14+
"github.com/praqma/git-phlow/setting"
1515
)
1616

1717
//AuthCaller
1818
//Wraps auth and injects dependencies
1919
func AuthCaller() {
20-
cf := platform.KeyConfiguration{Run: executor.Run}
20+
cf := setting.GitConfig{Run: executor.Run}
2121
Auth(cf)
2222
}
2323

2424
//Auth ...
2525
//Authenticates the user
26-
func Auth(cf platform.Configurator) {
27-
token := cf.Get(platform.PhlowToken)
28-
user := cf.Get(platform.PhlowUser)
26+
func Auth(cf setting.Configurator) {
27+
token := cf.Get(setting.PhlowToken)
28+
user := cf.Get(setting.PhlowUser)
2929

3030
if token != "" && user != "" {
3131
fmt.Println("Checking token validity...")
@@ -34,8 +34,8 @@ func Auth(cf platform.Configurator) {
3434
fmt.Println("Token test expected HTTP code 200 but received " + err.Error())
3535
if ReadInput("Delete local token and reauthenticate? (y/n): ", os.Stdin) == "y" {
3636
fmt.Println("Deleting local token and reauthenticating...")
37-
cf.Unset(platform.PhlowToken)
38-
cf.Unset(platform.PhlowUser)
37+
cf.Unset(setting.PhlowToken)
38+
cf.Unset(setting.PhlowUser)
3939
AuthCaller()
4040
} else {
4141
fmt.Println("Aborting...")
@@ -59,8 +59,8 @@ func Auth(cf platform.Configurator) {
5959
fmt.Println(err)
6060
return
6161
}
62-
cf.Set(platform.PhlowUser, username)
63-
cf.Set(platform.PhlowToken, token)
62+
cf.Set(setting.PhlowUser, username)
63+
cf.Set(setting.PhlowToken, token)
6464

6565
fmt.Println("")
6666
fmt.Println(fmt.Sprintf("%s Successfully authorized: 'git phlow' is now enabled", username))

phlow/mkalias.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
package phlow
22

33
import (
4-
"github.com/praqma/git-phlow/platform"
54
"fmt"
65
"github.com/praqma/git-phlow/ui"
6+
"github.com/praqma/git-phlow/setting"
77
)
88

99
//MakeAliasCaller ...
1010
func MakeAliasCaller() {
11-
MakeAlias(platform.DefaultConfiguration())
11+
MakeAlias(setting.GitConfig{})
1212
}
1313

1414
//MakeAlias ...
15-
func MakeAlias(conf platform.Configurator) {
15+
func MakeAlias(conf setting.Configurator) {
1616
aliases := make(map[string]string)
1717
aliases["alias.wrapup"] = "phlow wrapup"
1818
aliases["alias.workon"] = "phlow workon"

phlow/park.go

Lines changed: 0 additions & 5 deletions
This file was deleted.

phlow/workon.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"github.com/praqma/git-phlow/githandler"
1010
"github.com/praqma/git-phlow/plugins"
1111
"github.com/praqma/git-phlow/ui"
12+
"github.com/praqma/git-phlow/setting"
1213
)
1314

1415
//WorkOn ...
@@ -78,7 +79,8 @@ func WorkOn(issue int) {
7879
//Set Label and assignee on a GitHub issue
7980
func UpdateIssue(issue int) {
8081
//Retrieve token
81-
user := ""//githandler.ConfigGet("user", "phlow")
82+
stg := setting.NewToolStg()
83+
user := stg.User
8284

8385
if _, err := plugins.GitHub.SetLabel(plugins.PhlowLabels["Status - in progress"].Title, issue); err != nil {
8486
fmt.Println(err)

platform/platform.go

Lines changed: 0 additions & 54 deletions
This file was deleted.

platform/platform_test.go

Lines changed: 0 additions & 68 deletions
This file was deleted.

0 commit comments

Comments
 (0)