diff --git a/server/core/build.go b/server/core/build.go index 82862835..514449ca 100644 --- a/server/core/build.go +++ b/server/core/build.go @@ -16,7 +16,7 @@ type ( ID uint `gorm:"primary_key;auto_increment;not null" json:"id"` Branch string `json:"branch"` Commit string `json:"commit"` - CommitMessage string `json:"commitMessage"` + CommitMessage string `json:"commitMessage" sql:"type:text"` Ref string `gorm:"default:'refs/heads/master'" json:"ref"` PR int `json:"pr"` PRTitle string `json:"prTitle"` diff --git a/server/core/env.go b/server/core/env.go index 05d38aae..3805c352 100644 --- a/server/core/env.go +++ b/server/core/env.go @@ -5,7 +5,7 @@ type ( EnvVariable struct { ID uint `gorm:"primary_key;auto_increment;not null" json:"id"` Key string `gorm:"not null" json:"key"` - Value string `gorm:"not null" sql:"type:text" json:"value"` + Value string `gorm:"not null" sql:"type:longtext" json:"value"` Secret bool `gorm:"not null,default:false" json:"secret"` RepositoryID uint `gorm:"not null" json:"repositoryID"` Repository Repository `json:"repository"` diff --git a/server/core/job.go b/server/core/job.go index d6f5c593..f95c1244 100644 --- a/server/core/job.go +++ b/server/core/job.go @@ -8,12 +8,12 @@ type ( ID uint `gorm:"primary_key;auto_increment;not null" json:"id"` Commands string `sql:"type:text" json:"commands"` Image string `json:"image"` - Env string `json:"env"` + Env string `json:"env" sql:"type:longtext"` Mount string `json:"mount"` StartTime *time.Time `json:"startTime"` EndTime *time.Time `json:"endTime"` Status string `gorm:"not null;size:20;default:'queued'" json:"status"` // queued | running | passing | failing - Log string `gorm:"size:16777216" json:"-"` + Log string `gorm:"size:16777216" json:"-" sql:"type:longtext"` Stage string `json:"stage"` Cache string `json:"cache"` Build *Build `gorm:"preload:false" json:"build,omitempty"` diff --git a/server/store/job/job.go b/server/store/job/job.go index d8a8fe73..80de92d7 100644 --- a/server/store/job/job.go +++ b/server/store/job/job.go @@ -52,6 +52,9 @@ func (s jobStore) Create(job *core.Job) error { func (s jobStore) Update(job *core.Job) error { log := []byte(job.Log) + if len(job.Log) > 16777215 { + job.Log = job.Log[0:16777215] + } err := s.db.Model(job).Updates(map[string]interface{}{ "status": job.Status, "start_time": job.StartTime,