increase size of stage name column

This commit is contained in:
Brad Rydzewski 2019-09-23 16:46:20 -07:00
parent a8d99ce609
commit d60054c459
9 changed files with 21 additions and 16 deletions

View file

@ -203,7 +203,7 @@ type (
}
Agent struct {
Enabled bool `envconfig:"DRONE_AGENTS_ENABLED"`
Disabled bool `envconfig:"DRONE_AGENTS_DISABLED"`
}
// Runner provides the runner configuration.

View file

@ -40,7 +40,7 @@ func provideRunner(
) *runner.Runner {
// the local runner is only created when the nomad scheduler,
// kubernetes scheduler, and remote agents are disabled
if config.Nomad.Enabled || config.Kube.Enabled || config.Agent.Enabled {
if config.Nomad.Enabled || config.Kube.Enabled || (config.Agent.Disabled == false) {
return nil
}
engine, err := docker.NewEnv()

View file

@ -34,8 +34,6 @@ var schedulerSet = wire.NewSet(
// scheduler based on the environment configuration.
func provideScheduler(store core.StageStore, config config.Config) core.Scheduler {
switch {
case config.Agent.Enabled:
return provideQueueScheduler(store, config)
case config.Kube.Enabled:
return provideKubernetesScheduler(config)
case config.Nomad.Enabled:

View file

@ -188,7 +188,7 @@ func provideDatadog(
EnableStash: config.IsStash(),
EnableGogs: config.IsGogs(),
EnableGitea: config.IsGitea(),
EnableAgents: config.Agent.Enabled,
EnableAgents: !config.Agent.Disabled,
EnableNomad: config.Nomad.Enabled,
EnableKubernetes: config.Kube.Enabled,
},

View file

@ -16,6 +16,7 @@ package db
import (
"database/sql"
"runtime/debug"
"github.com/jmoiron/sqlx"
)
@ -98,7 +99,7 @@ func (db *DB) Lock(fn func(Execer, Binder) error) error {
// transaction is committed. If an error is returned then the entire
// transaction is rolled back. Any error that is returned from the function
// or returned from the commit is returned from the Update() method.
func (db *DB) Update(fn func(Execer, Binder) error) error {
func (db *DB) Update(fn func(Execer, Binder) error) (err error) {
db.lock.Lock()
defer db.lock.Unlock()
@ -107,13 +108,19 @@ func (db *DB) Update(fn func(Execer, Binder) error) error {
return err
}
err = fn(tx, db.conn)
if err != nil {
tx.Rollback()
return err
}
defer func() {
if p := recover(); p != nil {
err = tx.Rollback()
debug.PrintStack()
} else if err != nil {
tx.Rollback()
} else {
err = tx.Commit()
}
}()
return tx.Commit()
err = fn(tx, db.conn)
return err
}
// Driver returns the name of the SQL driver.

View file

@ -368,7 +368,7 @@ CREATE TABLE IF NOT EXISTS stages (
,stage_repo_id INTEGER
,stage_build_id INTEGER
,stage_number INTEGER
,stage_name VARCHAR(50)
,stage_name VARCHAR(100)
,stage_kind VARCHAR(50)
,stage_type VARCHAR(50)
,stage_status VARCHAR(50)

View file

@ -5,7 +5,7 @@ CREATE TABLE IF NOT EXISTS stages (
,stage_repo_id INTEGER
,stage_build_id INTEGER
,stage_number INTEGER
,stage_name VARCHAR(50)
,stage_name VARCHAR(100)
,stage_kind VARCHAR(50)
,stage_type VARCHAR(50)
,stage_status VARCHAR(50)

View file

@ -369,7 +369,7 @@ CREATE TABLE IF NOT EXISTS stages (
,stage_repo_id INTEGER
,stage_build_id INTEGER
,stage_number INTEGER
,stage_name VARCHAR(50)
,stage_name VARCHAR(100)
,stage_kind VARCHAR(50)
,stage_type VARCHAR(50)
,stage_status VARCHAR(50)

View file

@ -5,7 +5,7 @@ CREATE TABLE IF NOT EXISTS stages (
,stage_repo_id INTEGER
,stage_build_id INTEGER
,stage_number INTEGER
,stage_name VARCHAR(50)
,stage_name VARCHAR(100)
,stage_kind VARCHAR(50)
,stage_type VARCHAR(50)
,stage_status VARCHAR(50)