-
Notifications
You must be signed in to change notification settings - Fork 1
/
mgr_golang_glide.go
47 lines (39 loc) · 1.14 KB
/
mgr_golang_glide.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package mgr
import (
"github.com/analogj/go-util/utils"
"github.com/packagrio/go-common/errors"
"github.com/packagrio/go-common/pipeline"
"github.com/packagrio/publishr/pkg/config"
"net/http"
"os/exec"
"path"
)
func DetectGolangGlide(pipelineData *pipeline.Data, myconfig config.Interface, client *http.Client) bool {
glideyamlPath := path.Join(pipelineData.GitLocalPath, "glide.yaml")
return utils.FileExists(glideyamlPath)
}
type mgrGolangGlide struct {
Config config.Interface
PipelineData *pipeline.Data
Client *http.Client
}
func (m *mgrGolangGlide) Init(pipelineData *pipeline.Data, myconfig config.Interface, client *http.Client) error {
m.PipelineData = pipelineData
m.Config = myconfig
if client != nil {
//primarily used for testing.
m.Client = client
}
return nil
}
func (m *mgrGolangGlide) MgrValidateTools() error {
if _, kerr := exec.LookPath("glide"); kerr != nil {
return errors.EngineValidateToolError("glide binary is missing")
}
return nil
}
func (m *mgrGolangGlide) MgrDistStep(nextMetadata interface{}) error {
// no real packaging for golang.
// libraries are stored in version control.
return nil
}