diff --git a/deployers/k8s.go b/deployers/k8s.go index b579492..d66b4a2 100644 --- a/deployers/k8s.go +++ b/deployers/k8s.go @@ -36,7 +36,11 @@ func NewDeployerK8s(cfg utils.DeployerK8sConfig, manifest utils.DeployerK8sManif deployer.Namespace = manifest.Namespace deployer.Environments = cfg.Environments deployer.workPath = cfg.WorkPath - deployer.vcsRegexp = cfg.VcsRegexp + if len(manifest.VcsRegexp) != 0 { + deployer.vcsRegexp = manifest.VcsRegexp + } else { + deployer.vcsRegexp = cfg.VcsRegexp + } return &deployer, nil } @@ -111,7 +115,7 @@ func (d *DeployerK8s) ListVcsVersions(env string) ([]string, error) { vcsVersion := regexp.MustCompile(d.vcsRegexp).FindStringSubmatch(content.String()) if len(vcsVersion) != 2 { - return nil, fmt.Errorf("Could not find vcsVersion") + return nil, fmt.Errorf("Could not match current deployment version with vcsRegexp=%s", d.vcsRegexp) } return []string{vcsVersion[1]}, nil diff --git a/utils/manifest.go b/utils/manifest.go index 6c108f6..c2ca13e 100644 --- a/utils/manifest.go +++ b/utils/manifest.go @@ -32,6 +32,7 @@ type DeployerManifest struct { type DeployerK8sManifest struct { Release string `mapstructure:"release"` Namespace string `mapstructure:"namespace"` + VcsRegexp string `mapstructure:"vcsRegexp"` } type DeployerGgnManifest struct {