mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-11-22 18:01:02 +00:00
ability to get netrc from remote
This commit is contained in:
parent
6006699109
commit
67a4e302c7
3 changed files with 24 additions and 2 deletions
7
Makefile
7
Makefile
|
@ -25,8 +25,11 @@ concat:
|
|||
server/static/scripts/controllers/*.js \
|
||||
server/static/scripts/term.js > server/static/scripts/drone.min.js
|
||||
|
||||
bindata_deps:
|
||||
go get github.com/jteeuwen/go-bindata/...
|
||||
|
||||
bindata_debug:
|
||||
go-bindata --debug server/static/...
|
||||
$$GOPATH/bin/go-bindata --debug server/static/...
|
||||
|
||||
bindata:
|
||||
go-bindata server/static/...
|
||||
$$GOPATH/bin/go-bindata server/static/...
|
||||
|
|
|
@ -4,6 +4,7 @@ import (
|
|||
"encoding/json"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strings"
|
||||
|
||||
"github.com/drone/drone/common"
|
||||
|
@ -149,6 +150,20 @@ func (g *GitHub) Script(u *common.User, r *common.Repo, b *common.Build) ([]byte
|
|||
return GetFile(client, r.Owner, r.Name, ".drone.yml", sha)
|
||||
}
|
||||
|
||||
// Netrc returns a .netrc file that can be used to clone
|
||||
// private repositories from a remote system.
|
||||
func (g *GitHub) Netrc(u *common.User, r *common.Repo) (*common.Netrc, error) {
|
||||
url_, err := url.Parse(g.URL)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
netrc := &common.Netrc{}
|
||||
netrc.Login = u.Token
|
||||
netrc.Password = "x-oauth-basic"
|
||||
netrc.Machine = url_.Host
|
||||
return netrc, nil
|
||||
}
|
||||
|
||||
// Activate activates a repository by creating the post-commit hook and
|
||||
// adding the SSH deploy key, if applicable.
|
||||
func (g *GitHub) Activate(u *common.User, r *common.Repo, k *common.Keypair, link string) error {
|
||||
|
|
|
@ -29,6 +29,10 @@ type Remote interface {
|
|||
// An example would be the GitHub pull request status.
|
||||
Status(u *common.User, r *common.Repo, b *common.Build, link string) error
|
||||
|
||||
// Netrc returns a .netrc file that can be used to clone
|
||||
// private repositories from a remote system.
|
||||
Netrc(u *common.User, r *common.Repo) (*common.Netrc, error)
|
||||
|
||||
// Activate activates a repository by creating the post-commit hook and
|
||||
// adding the SSH deploy key, if applicable.
|
||||
Activate(u *common.User, r *common.Repo, k *common.Keypair, link string) error
|
||||
|
|
Loading…
Reference in a new issue