Skip to content

Commit

Permalink
support the directed yaml file (#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaomuqiao authored and gaocegege committed Nov 16, 2016
1 parent 19ca183 commit 2f8d26f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 2 additions & 0 deletions api/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ type Service struct {
LastVersionName string `bson:"last_versionname,omitempty" json:"last_versionname,omitempty"`
// Deploy plans
DeployPlans []DeployPlan `bson:"deploy_plans,omitempty" json:"deploy_plans,omitempty"`
// Repository information of the service.
YAMLConfigName string `bson:"yaml_config_name,omitempty" json:"yaml_config_name,omitempty"`
}

// DeployPlan is the type for deployment plan.
Expand Down
1 change: 1 addition & 0 deletions scripts/tools/create-service.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ curl -sS -X POST -H "Content-Type:application/json" -d "{
\"name\": \"test-service\",
\"username\": \"${1}\",
\"description\": \"This is a test-service\",
\"yaml_config_name\": \"caicloud.yml\",
\"repository\": {
\"url\": \"https://github.com/tutumcloud/hello-world\",
\"vcs\": \"git\"
Expand Down
8 changes: 4 additions & 4 deletions worker/ci/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,13 +139,13 @@ func (cm *Manager) Parse(event *api.Event) (*parser.Tree, error) {
contextDir := contextdir.(string)
errYaml = ErrYamlNotExist
// Use the filename of config file if given.
/*if event.Service.YAMLConfigName != "" {
if event.Service.YAMLConfigName != "" {
directFilePath = fmt.Sprintf("%s/%s", contextDir, event.Service.YAMLConfigName)
// Set the err to ErrCustomYamlNotExist.
errYaml = ErrCustomYamlNotExist
} else {*/
directFilePath = fmt.Sprintf("%s/%s", contextDir, yamlName)
//}
} else {
directFilePath = fmt.Sprintf("%s/%s", contextDir, yamlName)
}
if osutil.IsFileExists(directFilePath) != true {
return nil, errYaml
}
Expand Down

0 comments on commit 2f8d26f

Please sign in to comment.