Skip to content
This repository has been archived by the owner on Aug 9, 2021. It is now read-only.

Commit

Permalink
finishing off ProcessPushPayload in Github Scm.
Browse files Browse the repository at this point in the history
  • Loading branch information
AnalogJ committed Jul 16, 2017
1 parent cf544dd commit 91f95d0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
8 changes: 5 additions & 3 deletions lib/scm/github.go
Expand Up @@ -13,6 +13,7 @@ import (
"capsulecd/lib/errors"
"fmt"
"net/url"
"capsulecd/lib/utils"
)

type scmGithub struct {
Expand Down Expand Up @@ -145,11 +146,12 @@ func (g *scmGithub) ProcessPushPayload(payload *ScmPayload) error {
// clone the merged branch
// https://sethvargo.com/checkout-a-github-pull-request/
// https://coderwall.com/p/z5rkga/github-checkout-a-pull-request-as-a-branch
// @source_git_local_path = CapsuleCD::GitUtils.clone(@source_git_parent_path, @source_git_head_info['repo']['name'], @source_git_remote)
// CapsuleCD::GitUtils.checkout(@source_git_local_path, @source_git_head_info['repo']['sha1'])

gitLocalPath, cerr := utils.GitClone(g.options.GitParentPath, g.options.GitHeadInfo.Repo.Name, g.options.GitRemote)
if(cerr != nil){return cerr}
g.options.GitLocalPath = gitLocalPath

return nil
return utils.GitCheckout(g.options.GitLocalPath, g.options.GitHeadInfo.Sha)
}

// all capsule CD processing will be kicked off via a payload. In Github's case, the payload is the pull request data.
Expand Down
1 change: 0 additions & 1 deletion lib/utils/git_test.go
Expand Up @@ -181,7 +181,6 @@ func TestGitGenerateChangelog(t *testing.T) {
2016-02-28T06:52Z | d4b8c3b5 | Update README.md | Jason Kulatunga
2016-02-28T00:01Z | d0d3fc8f | (v0.1.10) Automated packaging of release by CapsuleCD | CapsuleCD
`, changelog)

}

func deleteTestRepo(testRepoDirectory string){
Expand Down

0 comments on commit 91f95d0

Please sign in to comment.