Skip to content

Commit

Permalink
feat(build): Add ability to use a getter URL other than github
Browse files Browse the repository at this point in the history
  • Loading branch information
olls committed Feb 10, 2016
1 parent 67495cc commit 4c3173d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
3 changes: 2 additions & 1 deletion build.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@ Build.prototype.getter = function (repo, branch, cb) {
repo_dir: self.build_manager.config.repo_dir,
output: self.build_manager.config.processing,
repo: repo,
branch: branch
branch: branch,
url: self.ui.get_url ? self.ui.get_url : ''
});

self.run_command(command, cb);
Expand Down
14 changes: 10 additions & 4 deletions parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ var GitHub = (function () {
gh_parser.prototype.extract = function () {
if (!(this.payload.repository &&
this.payload.repository.full_name &&
this.payload.repository.url &&
this.payload.head_commit &&
this.payload.head_commit.message &&
this.payload.sender &&
this.payload.sender.avatar_url &&
this.payload.ref)) {

This comment has been minimized.

Copy link
@geraintwhite

geraintwhite Feb 12, 2016

Member

Why did you make these fields mandatory?

This comment has been minimized.

Copy link
@olls

olls Feb 12, 2016

Author Member

Because the parser would error without them?

This comment has been minimized.

Copy link
@geraintwhite

geraintwhite Feb 12, 2016

Member

Would it? The fields would just be undefined.

return undefined;
}
Expand Down Expand Up @@ -76,10 +81,11 @@ var GitLab = (function () {
}

return (this.data = {
slug: slug,
branch: this.payload.ref.replace(/^refs\/heads\//, ''),
url: this.payload.repository.homepage,
commit: this.payload.total_commits_count > 0 ? this.payload.commits.slice(-1).message : undefined
slug: slug,
branch: this.payload.ref.replace(/^refs\/heads\//, ''),
url: this.payload.repository.homepage,
get_url: this.payload.repository.git_ssh_url,
commit: this.payload.total_commits_count > 0 ? this.payload.commits.slice(-1).message : undefined
});
};

Expand Down

0 comments on commit 4c3173d

Please sign in to comment.