Browse Source
Add slug field to pipeline struct
feature/add-pipeline-endpoints
Fabian Vowie
3 years ago
No known key found for this signature in database
GPG Key ID: C27317C33B27C410
3 changed files with
21 additions and
16 deletions
-
pipeline.go
-
pipeline_test.go
-
pipelines/example.json
|
@ -27,6 +27,7 @@ type IPipeline interface { |
|
|
|
|
|
|
|
|
type Pipeline struct { |
|
|
type Pipeline struct { |
|
|
Name string `json:"name"` |
|
|
Name string `json:"name"` |
|
|
|
|
|
Slug string `json:"slug"` |
|
|
Type PipelineType `json:"type"` |
|
|
Type PipelineType `json:"type"` |
|
|
RemoveMetadata bool `json:"remove_metadata"` |
|
|
RemoveMetadata bool `json:"remove_metadata"` |
|
|
Steps []Step `json:"steps"` |
|
|
Steps []Step `json:"steps"` |
|
|
|
@ -1,8 +1,9 @@ |
|
|
package main |
|
|
package main |
|
|
|
|
|
|
|
|
import ( |
|
|
import ( |
|
|
"github.com/stretchr/testify/assert" |
|
|
|
|
|
"testing" |
|
|
"testing" |
|
|
|
|
|
|
|
|
|
|
|
"github.com/stretchr/testify/assert" |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|
func TestImagePipelineDeserialization(t *testing.T) { |
|
|
func TestImagePipelineDeserialization(t *testing.T) { |
|
|
|
@ -1,5 +1,7 @@ |
|
|
{ |
|
|
|
|
|
|
|
|
[ |
|
|
|
|
|
{ |
|
|
"name": "example pipeline", |
|
|
"name": "example pipeline", |
|
|
|
|
|
"slug": "example", |
|
|
"type": 0, |
|
|
"type": 0, |
|
|
"removeMetadata": false, |
|
|
"removeMetadata": false, |
|
|
"steps": [ |
|
|
"steps": [ |
|
@ -12,4 +14,5 @@ |
|
|
"type": 1 |
|
|
"type": 1 |
|
|
} |
|
|
} |
|
|
] |
|
|
] |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
] |