Skip to content
This repository has been archived by the owner on Feb 7, 2024. It is now read-only.

Commit

Permalink
Merge pull request #91 from blablacar/fix/vcsregexp
Browse files Browse the repository at this point in the history
Fix VcsRegexp in manifests
  • Loading branch information
obiesmans authored Dec 10, 2018
2 parents 31c16d2 + e207699 commit 4905791
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
8 changes: 6 additions & 2 deletions deployers/k8s.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions utils/manifest.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 4905791

Please sign in to comment.