feat: params

This commit is contained in:
Denis Gukov 2024-11-24 15:05:07 +05:00
parent 4f9f3a78c3
commit 3161fa9ae2
3 changed files with 20 additions and 0 deletions

View File

@ -75,6 +75,7 @@ func GetMigrations() []Migration {
{Version: "2.10.26"}, {Version: "2.10.26"},
{Version: "2.10.28"}, {Version: "2.10.28"},
{Version: "2.10.33"}, {Version: "2.10.33"},
{Version: "2.10.46"},
} }
} }

View File

@ -9,6 +9,17 @@ import (
"github.com/semaphoreui/semaphore/util" "github.com/semaphoreui/semaphore/util"
) )
type TerraformTaskParams struct {
Plan bool `json:"plan"`
AutoApprove bool `json:"auto_approve"`
}
type AnsibleTaskParams struct {
Debug bool `json:"debug"`
DryRun bool `json:"dry_run"`
Diff bool `json:"diff"`
}
// Task is a model of a task which will be executed by the runner // Task is a model of a task which will be executed by the runner
type Task struct { type Task struct {
ID int `db:"id" json:"id"` ID int `db:"id" json:"id"`
@ -51,6 +62,12 @@ type Task struct {
Version *string `db:"version" json:"version"` Version *string `db:"version" json:"version"`
InventoryID *int `db:"inventory_id" json:"inventory_id"` InventoryID *int `db:"inventory_id" json:"inventory_id"`
TaskParams MapStringAnyField `db:"params" json:"params"`
}
func (task *Task) GetParams(target interface{}) error {
return nil
} }
func (task *Task) PreInsert(gorp.SqlExecutor) error { func (task *Task) PreInsert(gorp.SqlExecutor) error {

View File

@ -0,0 +1,2 @@
alter table `project__template` add `task_params` text;
alter table `task` add `params` text;