| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 syntax = "proto3"; | 5 syntax = "proto3"; |
| 6 | 6 |
| 7 package deploy; | 7 package deploy; |
| 8 | 8 |
| 9 import "github.com/luci/luci-go/deploytool/api/deploy/checkout.proto"; | 9 import "github.com/luci/luci-go/deploytool/api/deploy/checkout.proto"; |
| 10 | 10 |
| 11 /** | 11 /** |
| 12 * The deployment configuration is a set of parameters composed from local and | 12 * Layout defines the root directory of a deployment configuration. |
| 13 * source configuration files. Each configuration file is read as a text | |
| 14 * protobuf in two stages: | |
| 15 * | 13 * |
| 16 * Local Stage | 14 * Each layout field has a default value, so an empty layout protobuf file is |
| 17 * ============ | 15 * a valid layout. Each field may be overridden to suit your repository's |
| 18 * First, the source and project layout configurations are loaded. These detail | 16 * structure, if needed. |
| 19 * the projects that are to be deployed and the source definitions for those | |
| 20 * projects. | |
| 21 * | |
| 22 * Local configurations are located in subdirectories relative to a root | |
| 23 * "layout.cfg" file: | |
| 24 * | |
| 25 * /layout.cfg | |
| 26 * /sources/ | |
| 27 * <source-group-name>/ (Defines a source group). | |
| 28 * <source-name>.cfg (Defines a source within the source group). | |
| 29 * | |
| 30 * /applications/ | |
| 31 * <application-name>.cfg (Defines a application). | |
| 32 * | |
| 33 * /deployments/ | |
| 34 * <deployment-name>.cfg (Defines a deployment). | |
| 35 * | |
| 36 * Each "source" defines host repositories to check out with that source's name. | |
| 37 * Sources can be pulled from a variety of places, and will be checked out into | |
| 38 * uniquely-named staging directories. | |
| 39 * | |
| 40 * Each "application" defines a set of source-relative components that the | |
| 41 * application is composed of. The components' definitions are located in the | |
| 42 * deployment configuration area within their source. | |
| 43 * | |
| 44 * A "deployment" binds an "application" to a set of "sources" and | |
| 45 * deployment-specific parameters (e.g., cloud project). A deployment's | |
| 46 * configuration is composed of its application's components loaded from their | |
| 47 * sources. Deployment operations are executed against deployments. | |
| 48 * | |
| 49 * Source Stage | |
| 50 * ============ | |
| 51 * Each source referenced by the named application(s) will be checked out in a | |
| 52 * staging area. Configurations referenced by the applications will then be | |
| 53 * loaded from those sources to complete the deployment configuration. | |
| 54 */ | 17 */ |
| 55 message Layout { | 18 message Layout { |
| 56 /** | 19 /** |
| 57 * If specified, the relative path to the sources configuration directory. If | 20 * If specified, the relative path to the sources configuration directory. If |
| 58 * empty, this will default to "sources". | 21 * empty, this will default to "sources". |
| 59 */ | 22 */ |
| 60 string sources_path = 1; | 23 string sources_path = 1; |
| 61 | 24 |
| 62 /** | 25 /** |
| 63 * If specified, the relative path to the applications configuration | 26 * If specified, the relative path to the applications configuration |
| (...skipping 16 matching lines...) Expand all Loading... |
| 80 /** | 43 /** |
| 81 * Source represents a single source configuration file. | 44 * Source represents a single source configuration file. |
| 82 * | 45 * |
| 83 * It contains definitions for the set of source repositories that make up this | 46 * It contains definitions for the set of source repositories that make up this |
| 84 * Source. | 47 * Source. |
| 85 * | 48 * |
| 86 * Each source is defined within a source group directory, and is named | 49 * Each source is defined within a source group directory, and is named |
| 87 * "<source-name>.cfg". The source can be referenced internally by its full | 50 * "<source-name>.cfg". The source can be referenced internally by its full |
| 88 * source path, "<source-group-name>/<source-name>". | 51 * source path, "<source-group-name>/<source-name>". |
| 89 * | 52 * |
| 90 * If the source root contains a ".luci-deploytool.cfg" file, it will be read | 53 * If the source root contains a "luci-deploy.cfg" file, it will be read |
| 91 * and interepreted as a "SourceLayout" message. | 54 * and interepreted as a "SourceLayout" message. |
| 92 */ | 55 */ |
| 93 message Source { | 56 message Source { |
| 94 /** GitRepo is a named Git repository. */ | 57 /** GitRepo is a named Git repository. */ |
| 95 message GitRepo { | 58 message GitRepo { |
| 96 /** | 59 /** |
| 97 * URL is the base URL of the repository. | 60 * URL is the base URL of the repository. |
| 98 * | 61 * |
| 99 * If this is a "file://" URL, the local file path will be used as the | 62 * If this is a "file://" URL, the local file path will be used as the |
| 100 * repository source. | 63 * repository source. |
| (...skipping 16 matching lines...) Expand all Loading... |
| 117 * Go Paths to add to this repository. | 80 * Go Paths to add to this repository. |
| 118 * | 81 * |
| 119 * This will be prepended to the GOPATH that the repository exports during its | 82 * This will be prepended to the GOPATH that the repository exports during its |
| 120 * configuration/initialization. | 83 * configuration/initialization. |
| 121 */ | 84 */ |
| 122 repeated GoPath go_path = 10; | 85 repeated GoPath go_path = 10; |
| 123 | 86 |
| 124 /** | 87 /** |
| 125 * If true, this repository is allowed to run scripts: | 88 * If true, this repository is allowed to run scripts: |
| 126 * - At source initialization time, the initialization scripts defined in | 89 * - At source initialization time, the initialization scripts defined in |
| 127 * ".luci-deploytool.cfg" will be executed. | 90 * "/luci-deploy.cfg" will be executed. |
| 128 * - At build time, build scripts associated with a Component will | 91 * - At build time, build scripts associated with a Component will |
| 129 * be executed. Note that if the a Component declares a build script and `ru
n_scripts` is not true, | 92 * be executed. Note that if the a Component declares a build script and `ru
n_scripts` is not true, |
| 130 * the build will fail. | 93 * the build will fail. |
| 131 * | 94 * |
| 132 * It is important that this repository is trusted if this is set to true, | 95 * It is important that this repository is trusted if this is set to true, |
| 133 * since this script will be run on the deployment system under the | 96 * since this script will be run on the deployment system under the |
| 134 * deployment user account. | 97 * deployment user account. |
| 135 */ | 98 */ |
| 136 bool run_scripts = 11; | 99 bool run_scripts = 11; |
| 137 /** If true, mark this as a tained source. */ | 100 /** If true, mark this as a tained source. */ |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 254 CloudProject cloud_project = 3; | 217 CloudProject cloud_project = 3; |
| 255 | 218 |
| 256 /** | 219 /** |
| 257 * Map of key/value parameters for this Deployment. | 220 * Map of key/value parameters for this Deployment. |
| 258 * | 221 * |
| 259 * These will be automatically substituted where parameter substitution is | 222 * These will be automatically substituted where parameter substitution is |
| 260 * allowed. | 223 * allowed. |
| 261 */ | 224 */ |
| 262 map<string, string> parameter = 4; | 225 map<string, string> parameter = 4; |
| 263 } | 226 } |
| OLD | NEW |