mirror of
https://gitee.com/rainbond/Rainbond.git
synced 2024-12-01 03:07:51 +08:00
Merge pull request #397 from GLYASAI/codebranch
[FIX] no branch for code info
This commit is contained in:
commit
d55c65cb07
@ -40,6 +40,7 @@ type BuildVersion struct {
|
||||
Cmd string `json:"cmd"` //启动命令
|
||||
RepoURL string `json:"repo_url"` // source image name or source code url
|
||||
|
||||
CodeBranch string `json:"code_branch"`
|
||||
CodeVersion string `json:"code_version"`
|
||||
CommitMsg string `json:"code_commit_msg"`
|
||||
Author string `json:"code_commit_author"`
|
||||
|
@ -285,7 +285,7 @@ func (i *SourceCodeBuildItem) UpdateVersionInfo(vi *dbmodel.VersionInfo) error {
|
||||
version.CommitMsg = vi.CommitMsg
|
||||
version.Author = vi.Author
|
||||
version.CodeVersion = vi.CodeVersion
|
||||
logrus.Debugf("update app version %+v", *version)
|
||||
version.CodeBranch = vi.CodeBranch
|
||||
if err := db.GetManager().VersionInfoDao().UpdateModel(version); err != nil {
|
||||
return err
|
||||
}
|
||||
@ -300,10 +300,11 @@ func (i *SourceCodeBuildItem) UpdateBuildVersionInfo(res *build.Response) error
|
||||
EventID: i.EventID,
|
||||
ImageName: builder.RUNNERIMAGENAME,
|
||||
FinalStatus: "success",
|
||||
CodeBranch: i.CodeSouceInfo.Branch,
|
||||
CodeVersion: i.commit.Hash,
|
||||
CommitMsg: i.commit.Message,
|
||||
Author: i.commit.Author,
|
||||
FinishTime: time.Now(), // TODO(huangrh 20190816): do it in dao
|
||||
FinishTime: time.Now(),
|
||||
}
|
||||
if err := i.UpdateVersionInfo(vi); err != nil {
|
||||
logrus.Errorf("update version info error: %s", err.Error())
|
||||
|
@ -299,6 +299,7 @@ func (e *exectorManager) buildFromSourceCode(task *pb.TaskMessage) {
|
||||
vi := &dbmodel.VersionInfo{
|
||||
FinalStatus: "failure",
|
||||
EventID: i.EventID,
|
||||
CodeBranch: i.CodeSouceInfo.Branch,
|
||||
CodeVersion: i.commit.Hash,
|
||||
CommitMsg: i.commit.Message,
|
||||
Author: i.commit.Author,
|
||||
@ -306,7 +307,7 @@ func (e *exectorManager) buildFromSourceCode(task *pb.TaskMessage) {
|
||||
}
|
||||
if err := i.UpdateVersionInfo(vi); err != nil {
|
||||
logrus.Errorf("update version Info error: %s", err.Error())
|
||||
// TODO(huangrh 20190816): use logger
|
||||
i.Logger.Error(fmt.Sprintf("error updating version info: %v", err), event.GetCallbackLoggerOption())
|
||||
}
|
||||
} else {
|
||||
var configs = make(map[string]string, len(i.Configs))
|
||||
|
@ -42,6 +42,7 @@ type VersionInfo struct {
|
||||
Cmd string `gorm:"column:cmd;size:200" json:"cmd"` //启动命令
|
||||
RepoURL string `gorm:"column:repo_url;size:100" json:"repo_url"`
|
||||
CodeVersion string `gorm:"column:code_version;size:40" json:"code_version"`
|
||||
CodeBranch string `gorm:"column:code_branch;size:40" json:"code_branch"`
|
||||
CommitMsg string `gorm:"column:code_commit_msg;size:200" json:"code_commit_msg"`
|
||||
Author string `gorm:"column:code_commit_author;size:40" json:"code_commit_author"`
|
||||
//FinalStatus app version status
|
||||
|
Loading…
Reference in New Issue
Block a user