mirror of
https://github.com/semaphoreui/semaphore.git
synced 2024-12-04 07:11:05 +01:00
feat: params
This commit is contained in:
parent
4f9f3a78c3
commit
3161fa9ae2
@ -75,6 +75,7 @@ func GetMigrations() []Migration {
|
||||
{Version: "2.10.26"},
|
||||
{Version: "2.10.28"},
|
||||
{Version: "2.10.33"},
|
||||
{Version: "2.10.46"},
|
||||
}
|
||||
}
|
||||
|
||||
|
17
db/Task.go
17
db/Task.go
@ -9,6 +9,17 @@ import (
|
||||
"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
|
||||
type Task struct {
|
||||
ID int `db:"id" json:"id"`
|
||||
@ -51,6 +62,12 @@ type Task struct {
|
||||
Version *string `db:"version" json:"version"`
|
||||
|
||||
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 {
|
||||
|
2
db/sql/migrations/v2.10.46.sql
Normal file
2
db/sql/migrations/v2.10.46.sql
Normal file
@ -0,0 +1,2 @@
|
||||
alter table `project__template` add `task_params` text;
|
||||
alter table `task` add `params` text;
|
Loading…
Reference in New Issue
Block a user