Added option to configure the source and target branch
This commit is contained in:
parent
7999a86f58
commit
ec773bc57d
3 changed files with 28 additions and 8 deletions
16
services.go
16
services.go
|
|
@ -67,7 +67,21 @@ func (s *Services) PushRepository() error {
|
|||
return err
|
||||
}
|
||||
|
||||
if err := runCmd("git", "push", "dokku", "main"); err != nil {
|
||||
sourceBranch := s.cfg.LocalBranch
|
||||
if sourceBranch == "" {
|
||||
sourceBranch = "main"
|
||||
}
|
||||
remoteBranch := s.cfg.RemoteBranch
|
||||
if remoteBranch == "" {
|
||||
remoteBranch = sourceBranch
|
||||
}
|
||||
|
||||
branchArg := sourceBranch
|
||||
if sourceBranch != remoteBranch {
|
||||
branchArg = fmt.Sprintf("%v:%v", sourceBranch, remoteBranch)
|
||||
}
|
||||
|
||||
if err := runCmd("git", "push", "dokku", branchArg); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue