Jenkins CI setup

This commit is contained in:
simon987
2019-02-23 18:00:32 -05:00
parent 6bc2483968
commit d17113726e
9 changed files with 298 additions and 424 deletions

View File

@@ -21,9 +21,22 @@ func New() *Database {
d := Database{}
d.workerCache = make(map[int64]*Worker)
d.init()
return &d
}
func (database *Database) init() {
db := database.getDB()
_, err := db.Exec(`SELECT * FROM project`)
if err != nil {
logrus.Info("Database first time setup")
database.Reset()
}
}
func (database *Database) Reset() {
file, err := os.Open("./schema.sql")

View File

@@ -209,7 +209,6 @@ func (database *Database) GetSecret(pid int64, workerId int64) (secret string, e
}
err = row.Scan(&secret)
handleErr(err)
return
}