mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-12-06 08:16:19 +02:00
Fixing build and formatting issues
This commit is contained in:
parent
6b0f24cc11
commit
b7635ec844
@ -5,9 +5,7 @@ import (
|
||||
"encoding/json"
|
||||
"flag"
|
||||
"fmt"
|
||||
"net/url"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
log "github.com/drone/drone/Godeps/_workspace/src/github.com/Sirupsen/logrus"
|
||||
@ -130,13 +128,15 @@ func createClone(c *Context) error {
|
||||
// to the clone object for merge requests from bitbucket, gitlab, et al
|
||||
// if len(c.Commit.PullRequest) != 0 {
|
||||
// }
|
||||
|
||||
url_, err := url.Parse(c.Repo.Link)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
c.Clone.Dir, _ = c.Conf.Clone.Config["path"]
|
||||
pathv, ok := c.Conf.Clone.Config["path"]
|
||||
if ok {
|
||||
path, ok := pathv.(string)
|
||||
if ok {
|
||||
c.Clone.Dir = path
|
||||
return nil
|
||||
}
|
||||
}
|
||||
return fmt.Errorf("Workspace path not found")
|
||||
}
|
||||
|
||||
func parseContext() (*Context, error) {
|
||||
|
@ -1,8 +1,6 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"path/filepath"
|
||||
|
||||
"github.com/drone/drone/Godeps/_workspace/src/github.com/samalba/dockerclient"
|
||||
common "github.com/drone/drone/pkg/types"
|
||||
"github.com/drone/drone/pkg/yaml"
|
||||
|
@ -2,14 +2,14 @@ package builtin
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"crypto/tls"
|
||||
"crypto/x509"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"time"
|
||||
"crypto/tls"
|
||||
"crypto/x509"
|
||||
|
||||
"github.com/drone/drone/Godeps/_workspace/src/github.com/samalba/dockerclient"
|
||||
"github.com/drone/drone/pkg/docker"
|
||||
|
@ -116,7 +116,7 @@ func Test_Linter(t *testing.T) {
|
||||
g.It("Should pass with cache path inside workspace", func() {
|
||||
c := &common.Config{
|
||||
Build: &common.Step{
|
||||
Cache: []string{".git","/.git","/.git/../.git/../.git"},
|
||||
Cache: []string{".git", "/.git", "/.git/../.git/../.git"},
|
||||
},
|
||||
}
|
||||
g.Assert(expectCacheInWorkspace(c) == nil).IsTrue()
|
||||
@ -125,7 +125,7 @@ func Test_Linter(t *testing.T) {
|
||||
g.It("Should fail with cache path outside workspace", func() {
|
||||
c := &common.Config{
|
||||
Build: &common.Step{
|
||||
Cache: []string{".git","/.git","../../.git"},
|
||||
Cache: []string{".git", "/.git", "../../.git"},
|
||||
},
|
||||
}
|
||||
g.Assert(expectCacheInWorkspace(c) != nil).IsTrue()
|
||||
@ -134,7 +134,7 @@ func Test_Linter(t *testing.T) {
|
||||
g.It("Should fail when caching workspace directory", func() {
|
||||
c := &common.Config{
|
||||
Build: &common.Step{
|
||||
Cache: []string{".git",".git/../"},
|
||||
Cache: []string{".git", ".git/../"},
|
||||
},
|
||||
}
|
||||
g.Assert(expectCacheInWorkspace(c) != nil).IsTrue()
|
||||
@ -143,7 +143,7 @@ func Test_Linter(t *testing.T) {
|
||||
g.It("Should fail when : is in the cache path", func() {
|
||||
c := &common.Config{
|
||||
Build: &common.Step{
|
||||
Cache: []string{".git",".git:/../"},
|
||||
Cache: []string{".git", ".git:/../"},
|
||||
},
|
||||
}
|
||||
g.Assert(expectCacheInWorkspace(c) != nil).IsTrue()
|
||||
|
@ -151,7 +151,7 @@ func Test_Transform(t *testing.T) {
|
||||
Config: map[string]interface{}{},
|
||||
},
|
||||
Build: &common.Step{
|
||||
Cache: []string{".git","foo","bar"},
|
||||
Cache: []string{".git", "foo", "bar"},
|
||||
},
|
||||
Notify: map[string]*common.Step{},
|
||||
Deploy: map[string]*common.Step{},
|
||||
|
Loading…
Reference in New Issue
Block a user