github.com/drone/go-convert@v0.0.0-20240307072510-6bd371c65e61/convert/bitbucket/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  		Clone       *Clone       `yaml:"clone,omitempty"`
    20  		Definitions *Definitions `yaml:"definitions,omitempty"`
    21  		Image       *Image       `yaml:"image,omitempty"`
    22  		Options     *Options     `yaml:"options,omitempty"`
    23  		Pipelines   Pipelines    `yaml:"pipelines,omitempty"`
    24  	}
    25  
    26  	Clone struct {
    27  		Depth      *Depth `yaml:"depth,omitempty"`
    28  		Enabled    *bool  `yaml:"enabled,omitempty"`
    29  		LFS        bool   `yaml:"lfs,omitempty"`
    30  		SkipVerify bool   `yaml:"skip-ssl-verify,omitempty"`
    31  	}
    32  
    33  	Condition struct {
    34  		Changesets *Changesets `yaml:"changesets,omitempty"`
    35  	}
    36  
    37  	Changesets struct {
    38  		IncludePaths []string `yaml:"includePaths,omitempty"`
    39  	}
    40  
    41  	Definitions struct {
    42  		Caches   map[string]*Cache   `yaml:"caches,omitempty"`
    43  		Services map[string]*Service `yaml:"services,omitempty"`
    44  	}
    45  
    46  	Options struct {
    47  		Docker  bool `yaml:"docker,omitempty"`
    48  		MaxTime int  `yaml:"max-time,omitempty"`
    49  		Size    Size `yaml:"size,omitempty"`
    50  	}
    51  
    52  	Parallel struct {
    53  		FailFast bool     `yaml:"fail-fast,omitempty"`
    54  		Steps    []*Steps `yaml:"steps,omitempty"`
    55  	}
    56  
    57  	Pipelines struct {
    58  		Default      []*Steps            `yaml:"default,omitempty"`
    59  		Branches     map[string][]*Steps `yaml:"branches,omitempty"`
    60  		PullRequests map[string][]*Steps `yaml:"pull-requests,omitempty"`
    61  		Tags         map[string][]*Steps `yaml:"tags,omitempty"`
    62  		Custom       []*Steps            `yaml:"custom,omitempty"`
    63  	}
    64  
    65  	Service struct {
    66  		Image     *Image            `yaml:"image,omitempty"`
    67  		Memory    int               `yaml:"memory,omitempty"` // default 1024
    68  		Type      string            `yaml:"type,omitempty"`
    69  		Variables map[string]string `yaml:"variables,omitempty"`
    70  	}
    71  
    72  	Stage struct {
    73  		Condition  *Condition `yaml:"condition,omitempty"`
    74  		Deployment string     `yaml:"deployment,omitempty"` // test, staging, production
    75  		Steps      []*Steps   `yaml:"steps,omitempty"`
    76  		Name       string     `yaml:"name,omitempty"`
    77  		Trigger    string     `yaml:"trigger,omitempty"`
    78  	}
    79  
    80  	Steps struct {
    81  		Step     *Step     `yaml:"step,omitempty"`
    82  		Stage    *Stage    `yaml:"stage,omitempty"`
    83  		Parallel *Parallel `yaml:"parallel,omitempty"`
    84  	}
    85  
    86  	Step struct {
    87  		Artifacts   *Artifacts    `yaml:"artifacts,omitempty"`
    88  		Caches      []string      `yaml:"caches,omitempty"`
    89  		Clone       *Clone        `yaml:"clone,omitempty"`
    90  		Condition   *Condition    `yaml:"condition,omitempty"`
    91  		Deployment  string        `yaml:"deployment,omitempty"` // test, staging, production
    92  		FailFast    bool          `yaml:"fail-fast,omitempty"`
    93  		Image       *Image        `yaml:"image,omitempty"`
    94  		MaxTime     int           `yaml:"max-time,omitempty"`
    95  		Name        string        `yaml:"name,omitempty"`
    96  		Oidc        bool          `yaml:"oidc,omitempty"`
    97  		RunsOn      Stringorslice `yaml:"runs-on,omitempty"`
    98  		Script      []*Script     `yaml:"script"`
    99  		ScriptAfter []*Script     `yaml:"after-script,omitempty"`
   100  		Services    []string      `yaml:"services,omitempty"`
   101  		Size        Size          `yaml:"size,omitempty"`
   102  		Trigger     string        `yaml:"trigger,omitempty"` // automatic, manual
   103  	}
   104  
   105  	Variable struct {
   106  		AllowedValues []string `yaml:"allowed-values,omitempty"`
   107  		Default       string   `yaml:"default,omitempty"`
   108  		Name          string   `yaml:"name,omitempty"`
   109  	}
   110  
   111  	AWS struct {
   112  		AccessKey string `yaml:"access-key,omitempty"`
   113  		SecretKey string `yaml:"secret-key,omitempty"`
   114  		OIDCRole  string `yaml:"oidc-role,omitempty"`
   115  	}
   116  )