github.com/drone/go-convert@v0.0.0-20240307072510-6bd371c65e61/convert/circle/yaml/config.go (about) 1 // Copyright 2022 Harness, Inc. 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 package yaml 16 17 type ( 18 Config struct { 19 Commands map[string]*Command `yaml:"commands,omitempty"` 20 Executors map[string]*Executor `yaml:"executors,omitempty"` 21 Jobs map[string]*Job `yaml:"jobs,omitempty"` 22 Orbs map[string]*Orb `yaml:"orbs,omitempty"` 23 Parameters map[string]*Parameter `yaml:"parameters,omitempty"` 24 Setup bool `yaml:"setup,omitempty"` 25 Workflows *Workflows `yaml:"workflows,omitempty"` 26 Version string `yaml:"version,omitempty"` 27 } 28 29 Docker struct { 30 Auth *DockerAuth `yaml:"auth,omitempty"` 31 AuthAWS *DockerAuthAWS `yaml:"aws_auth,omitempty"` 32 Command Stringorslice `yaml:"command,omitempty"` 33 Entrypoint Stringorslice `yaml:"entrypoint,omitempty"` 34 Environment map[string]string `yaml:"environment,omitempty"` 35 Image string `yaml:"image,omitempty"` 36 Name string `yaml:"name,omitempty"` 37 User string `yaml:"user,omitempty"` 38 } 39 40 Command struct { 41 Description string `yaml:"description,omitempty"` 42 Parameters map[string]*Parameter `yaml:"parameters,omitempty"` 43 Steps []*Step `yaml:"steps,omitempty"` 44 } 45 46 DockerAuth struct { 47 Username string `yaml:"username,omitempty"` 48 Password string `yaml:"password,omitempty"` 49 } 50 51 DockerAuthAWS struct { 52 AccessKey string `yaml:"aws_access_key_id,omitempty"` 53 SecretKey string `yaml:"aws_secret_access_key,omitempty"` 54 } 55 56 Executor struct { 57 Docker []*Docker `yaml:"docker,omitempty"` 58 ResourceClass string `yaml:"resource_class,omitempty"` 59 Machine *Machine `yaml:"machine,omitempty"` 60 Macos *Macos `yaml:"macos,omitempty"` 61 Windows interface{} `yaml:"widows,omitempty"` 62 Shell string `yaml:"shell,omitempty"` 63 WorkingDir string `yaml:"working_directory,omitempty"` 64 Environment map[string]string `yaml:"environment,omitempty"` 65 } 66 67 Filters struct { 68 Branches *Filter `yaml:"branches,omitempty"` 69 Tags *Filter `yaml:"tags,omitempty"` 70 } 71 72 Filter struct { 73 Only Stringorslice `yaml:"only,omitempty"` 74 Ignore Stringorslice `yaml:"ignore,omitempty"` 75 } 76 77 Job struct { 78 Branches *Filter `yaml:"branches,omitempty"` 79 Docker []*Docker `yaml:"docker,omitempty"` 80 Environment map[string]string `yaml:"environment,omitempty"` 81 Executor *JobExecutor `yaml:"executor,omitempty"` 82 IPRanges bool `yaml:"circleci_ip_ranges,omitempty"` 83 Machine *Machine `yaml:"machine,omitempty"` 84 Macos *Macos `yaml:"macos,omitempty"` 85 Parallelism int `yaml:"parallelism,omitempty"` 86 Parameters map[string]*Parameter `yaml:"parameters,omitempty"` 87 ResourceClass string `yaml:"resource_class,omitempty"` 88 Shell string `yaml:"shell,omitempty"` 89 Steps []*Step `yaml:"steps,omitempty"` 90 WorkingDir string `yaml:"working_directory,omitempty"` 91 } 92 93 Macos struct { 94 Xcode string `yaml:"xcode,omitempty"` 95 } 96 97 Matrix struct { 98 Alias string `yaml:"alias,omitempty"` 99 Exclude []map[string]interface{} `yaml:"exclude,omitempty"` 100 Parameters map[string][]interface{} `yaml:"parameters,omitempty"` 101 } 102 103 Parameter struct { 104 Description string `yaml:"description,omitempty"` 105 Type string `yaml:"type,omitempty"` // string, boolean, integer, enum, executor, steps 106 Default interface{} `yaml:"default,omitempty"` 107 } 108 109 Schedule struct { 110 Cron string `yaml:"cron,omitempty"` 111 Filters *Filters `yaml:"filters,omitempty"` 112 } 113 114 Trigger struct { 115 Schedule *Schedule `yaml:"schedule,omitempty"` 116 } 117 )