From 65f9dc8779012e18a918a57e48a112174f49c4e1 Mon Sep 17 00:00:00 2001 From: georgecao Date: Sun, 26 Apr 2020 19:23:22 +0800 Subject: [PATCH] delete _meta file --- pkg/cibot/config/config.go | 2 -- pkg/cibot/pullrequest.go | 26 -------------------------- 2 files changed, 28 deletions(-) diff --git a/pkg/cibot/config/config.go b/pkg/cibot/config/config.go index b99af98..b2ee112 100644 --- a/pkg/cibot/config/config.go +++ b/pkg/cibot/config/config.go @@ -27,8 +27,6 @@ type Config struct { NewFileBranch string `yaml:"newfilebranch"` ServiceFile string `yaml:"tmpservicefile"` ServicePath string `yaml:"tmpservicepath"` - MetaFile string `yaml:"tmpmetafile"` - MetaPath string `yaml:"tmpmetapath"` } type WatchProjectFile struct { diff --git a/pkg/cibot/pullrequest.go b/pkg/cibot/pullrequest.go index d9091f1..5c1fd7b 100644 --- a/pkg/cibot/pullrequest.go +++ b/pkg/cibot/pullrequest.go @@ -90,8 +90,6 @@ func (s *Server) HandlePullRequestEvent(event *gitee.PullRequestEvent) { glog.Infof("Begin to create new project file, project name:%v.", prjn) _servicepath, _servicecontent := s.FillServicePathAndContentWithProjectName(prjn) s.NewFileWithPathAndContentInPullRequest(event, _servicepath, _servicecontent, newfilebranch, newfilerepo, newowner) - _metapath, _metacontent := s.FillMetaPathAndContentWithProjectName(prjn) - s.NewFileWithPathAndContentInPullRequest(event, _metapath, _metacontent, newfilebranch, newfilerepo, newowner) } } } @@ -203,30 +201,6 @@ func (s *Server) FillServicePathAndContentWithProjectName(prjname string) (_serv return } -// Fill file _meta path and content -func (s *Server) FillMetaPathAndContentWithProjectName(prjname string) (_metapath string, _meta string) { - _metapath = strings.Replace(s.Config.MetaPath, "#projectname#", prjname, 1) - glog.Infof("meta path:%v", _metapath) - - // read template file info - filebuf, err := ioutil.ReadFile(s.Config.MetaFile) - if err != nil { - glog.Errorf("Read template meta file failed: %v.", err) - return - } - str := string(filebuf) - _meta = strings.Replace(str, "#projectname#", prjname, 1) - glog.Infof("meta file:%v", _meta) - /* - _metapath = "obs/team_usage/obs_meta/projects/openEuler:Mainline/" + prjname + "/.osc/_meta" - _meta = "\n" + - " \n" + - " <description/>\n" + - "</package>\n" - */ - return -} - // New project with name in pull func (s *Server) NewFileWithPathAndContentInPullRequest(event *gitee.PullRequestEvent, path string, content string, branch string, repo string, owner string) { if event == nil { -- Gitee