()
| 44 | } |
| 45 | |
| 46 | func (j Job) ToJenkinsJob() *JenkinsJob { |
| 47 | if j.FullName == "" { |
| 48 | if j.Name != "" || j.Path != "" { |
| 49 | beforeNames := strings.Split(j.Path, "/") |
| 50 | befornName := "" |
| 51 | for i, part := range beforeNames { |
| 52 | if i%2 == 0 && part == "job" { |
| 53 | continue |
| 54 | } |
| 55 | if part == "" { |
| 56 | continue |
| 57 | } |
| 58 | befornName += part + "/" |
| 59 | } |
| 60 | j.FullName = befornName + j.Name |
| 61 | } |
| 62 | } |
| 63 | |
| 64 | return &JenkinsJob{ |
| 65 | FullName: j.FullName, |
| 66 | Name: j.Name, |
| 67 | Path: j.Path, |
| 68 | Class: j.Class, |
| 69 | Color: j.Color, |
| 70 | Base: j.Base, |
| 71 | Url: j.URL, |
| 72 | Description: j.Description, |
| 73 | PrimaryView: j.URL + j.Path + j.Class, |
| 74 | } |
| 75 | } |
| 76 | |
| 77 | type Project struct { |
| 78 | Class string `json:"_class"` |
no outgoing calls
no test coverage detected