mirror of
https://github.com/semaphoreui/semaphore.git
synced 2025-01-20 15:29:28 +01:00
fix(ci): capabilities
This commit is contained in:
parent
d0392485eb
commit
ac2132f290
@ -26,7 +26,7 @@ var templateID int64
|
||||
var capabilities = map[string][]string{
|
||||
"user": {},
|
||||
"project": {"user"},
|
||||
"access_key": {"project"},
|
||||
//"access_key": {"project"},
|
||||
"repository": {"access_key"},
|
||||
"inventory": {"repository"},
|
||||
"environment": {"repository"},
|
||||
|
@ -98,7 +98,7 @@ func (p *taskPool) run() {
|
||||
p.queue = append(p.queue[1:], t)
|
||||
continue
|
||||
}
|
||||
log.Info("Set resourse locker with task " + strconv.Itoa(t.task.ID))
|
||||
log.Info("Set resource locker with task " + strconv.Itoa(t.task.ID))
|
||||
resourceLocker <- &resourceLock{lock: true, holder: t}
|
||||
if !t.prepared {
|
||||
go t.prepareRun()
|
||||
|
@ -52,7 +52,7 @@ func (t *task) prepareRun() {
|
||||
|
||||
defer func() {
|
||||
log.Info("Stopped preparing task " + strconv.Itoa(t.task.ID))
|
||||
log.Info("Release resourse locker with task " + strconv.Itoa(t.task.ID))
|
||||
log.Info("Release resource locker with task " + strconv.Itoa(t.task.ID))
|
||||
resourceLocker <- &resourceLock{lock: false, holder: t}
|
||||
|
||||
objType := taskTypeID
|
||||
|
@ -85,23 +85,31 @@ func (d *SqlDb) GetProjectTasks(projectID int, params db.RetrieveQueryParams) ([
|
||||
}
|
||||
|
||||
func (d *SqlDb) DeleteTaskWithOutputs(projectID int, taskID int) (err error) {
|
||||
// check if task exists in the project
|
||||
_, err = d.GetTask(projectID, taskID)
|
||||
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
_, err = d.sql.Exec("delete from task__output where project_id=? AND task_id=?", projectID, taskID)
|
||||
_, err = d.sql.Exec("delete from task__output where task_id=?", taskID)
|
||||
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
_, err = d.sql.Exec("delete from task where id=?", projectID, taskID)
|
||||
_, err = d.sql.Exec("delete from task where id=?", taskID)
|
||||
return
|
||||
}
|
||||
|
||||
func (d *SqlDb) GetTaskOutputs(projectID int, taskID int) (output []db.TaskOutput, err error) {
|
||||
// check if task exists in the project
|
||||
_, err = d.GetTask(projectID, taskID)
|
||||
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
_, err = d.sql.Select(&output,
|
||||
"select task_id, task, time, output from task__output where task_id=? order by time asc",
|
||||
taskID)
|
||||
|
2
go.mod
2
go.mod
@ -39,7 +39,7 @@ require (
|
||||
github.com/radovskyb/watcher v1.0.7 // indirect
|
||||
github.com/russross/blackfriday v1.5.2
|
||||
github.com/sirupsen/logrus v1.4.2 // indirect
|
||||
github.com/snikch/goodman v0.0.0-20171125024755-10e37e294daa // indirect
|
||||
github.com/snikch/goodman v0.0.0-20171125024755-10e37e294daa
|
||||
github.com/spf13/cobra v0.0.5 // indirect
|
||||
github.com/ziutek/mymysql v1.5.4 // indirect
|
||||
golang.org/x/crypto v0.0.0-20200208060501-ecb85df21340
|
||||
|
Loading…
Reference in New Issue
Block a user