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

Commit

Permalink
adding logging around asset uploading.
Browse files Browse the repository at this point in the history
  • Loading branch information
AnalogJ committed Jul 26, 2017
1 parent b227001 commit 6fba217
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
4 changes: 1 addition & 3 deletions pkg/pipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,7 @@ func (p *Pipeline) PostScmInit() { p.RunHook("scm_init_step
func (p *Pipeline) PreScmRetrievePayload() { p.RunHook("scm_retrieve_payload_step.pre") }
func (p *Pipeline) PostScmRetrievePayload() { p.RunHook("scm_retrieve_payload_step.post") }
func (p *Pipeline) PreScmCheckoutPullRequestPayload() { p.RunHook("scm_checkout_pull_request_step.pre") }
func (p *Pipeline) PostScmCheckoutPullRequestPayload() {
p.RunHook("scm_checkout_pull_request_step.post")
}
func (p *Pipeline) PostScmCheckoutPullRequestPayload() { p.RunHook("scm_checkout_pull_request_step.post") }
func (p *Pipeline) PreScmCheckoutPushPayload() { p.RunHook("scm_checkout_push_payload_step.pre") }
func (p *Pipeline) PostScmCheckoutPushPayload() { p.RunHook("scm_checkout_push_payload_step.post") }
func (p *Pipeline) PreScmPublish() { p.RunHook("scm_publish_step.pre") }
Expand Down
10 changes: 8 additions & 2 deletions pkg/scm/scm_github.go
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,11 @@ func (g *scmGithub) Publish() error {
return rerr
}

g.PublishAssets(releaseData.GetID())
if perr := g.PublishAssets(releaseData.GetID()); perr != nil{
log.Print("An error occured while publishing assets:")
log.Print(perr)
log.Print("Continuing...")
}

return nil
}
Expand Down Expand Up @@ -359,10 +363,12 @@ func (g *scmGithub) Notify(ref string, state string, message string) error {

//private

func publishAsset(client *github.Client, ctx context.Context, repoOwner, repoName, assetName, filePath string, releaseID, retries int) error {
func publishAsset(client *github.Client, ctx context.Context, repoOwner string, repoName string, assetName, filePath string, releaseID, retries int) error {

log.Printf("Attempt (%s) to upload release asset %s from %s", retries, assetName, filePath)
f, err := os.Open(filePath)
if err != nil {
log.Print(err)
return err
}

Expand Down

0 comments on commit 6fba217

Please sign in to comment.