| // Copyright 2016 The Chromium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| syntax = "proto3"; |
| |
| package deploy; |
| |
| import "github.com/luci/luci-go/deploytool/api/deploy/checkout.proto"; |
| |
| /** |
| * Layout defines the root directory of a deployment configuration. |
| * |
| * Each layout field has a default value, so an empty layout protobuf file is |
| * a valid layout. Each field may be overridden to suit your repository's |
| * structure, if needed. |
| */ |
| message Layout { |
| /** |
| * If specified, the relative path to the sources configuration directory. If |
| * empty, this will default to "sources". |
| */ |
| string sources_path = 1; |
| |
| /** |
| * If specified, the relative path to the applications configuration |
| * directory. If empty, this will default to "applications". |
| */ |
| string applications_path = 2; |
| |
| /** |
| * If specified, the relative path to the deployments configuration directory. |
| * If empty, this will default to "deployments". |
| */ |
| string deployments_path = 3; |
| |
| /** |
| * If specified, the working directory to use. |
| */ |
| string working_path = 5; |
| } |
| |
| /** |
| * Source represents a single source configuration file. |
| * |
| * It contains definitions for the set of source repositories that make up this |
| * Source. |
| * |
| * Each source is defined within a source group directory, and is named |
| * "<source-name>.cfg". The source can be referenced internally by its full |
| * source path, "<source-group-name>/<source-name>". |
| * |
| * If the source root contains a "luci-deploy.cfg" file, it will be read |
| * and interepreted as a "SourceLayout" message. |
| */ |
| message Source { |
| /** GitRepo is a named Git repository. */ |
| message GitRepo { |
| /** |
| * URL is the base URL of the repository. |
| * |
| * If this is a "file://" URL, the local file path will be used as the |
| * repository source. |
| */ |
| string url = 1; |
| /** |
| * Ref is the name of the Git ref to check out. |
| * |
| * If empty, the unpinned "refs/heads/master" will be used if this is a |
| * remote repository, and the current checkout will be used if this is a |
| * local (file://...) repository. |
| */ |
| string ref = 2; |
| } |
| oneof source { |
| GitRepo git = 1; |
| } |
| |
| /** |
| * Go Paths to add to this repository. |
| * |
| * This will be prepended to the GOPATH that the repository exports during its |
| * configuration/initialization. |
| */ |
| repeated GoPath go_path = 10; |
| |
| /** |
| * If true, this repository is allowed to run scripts: |
| * - At source initialization time, the initialization scripts defined in |
| * "/luci-deploy.cfg" will be executed. |
| * - At build time, build scripts associated with a Component will |
| * be executed. Note that if the a Component declares a build script and `run_scripts` is not true, |
| * the build will fail. |
| * |
| * It is important that this repository is trusted if this is set to true, |
| * since this script will be run on the deployment system under the |
| * deployment user account. |
| */ |
| bool run_scripts = 11; |
| /** If true, mark this as a tained source. */ |
| bool tainted = 12; |
| } |
| |
| /** |
| * Application represents a single application. |
| * |
| * Application configurations are located under the applications directory, and |
| * are named "<application-name>.cfg". The internal name for a given application |
| * is "<application-name>". |
| * |
| * An application is composed of high-level application settings, a set of |
| * component configurations loaded from sources, and application-wide settings |
| * for those components. |
| * |
| * A applications is not bound to any specific source group, so the same |
| * application can be applied (via deployments) to multiple source groups. This |
| * enables canary configurations to be expressed. |
| */ |
| message Application { |
| /** |
| * Each Component entry is a application Component that will be pulled in from |
| * its Source repository. An application is composed of multiple Components. |
| * |
| * A Component is a single, deployable entity. It should be self-contained and |
| * able to co-exist with other Components in the Application. |
| */ |
| message Component { |
| /** |
| * Name is the local name of this Component. |
| * |
| * It can be referenced as <application-name>/<name>. |
| */ |
| string name = 1; |
| /** The "<source-name>" of the source where this component is defined. */ |
| string source = 2; |
| /** The source-relative path to the Component within "<source-name>". */ |
| string path = 3; |
| |
| /** The names of other sources to pull in to build this Component. */ |
| repeated string other_source = 4; |
| } |
| repeated Component component = 1; |
| } |
| |
| /** |
| * A Deployment represents a single cloud project deployment. It binds a |
| * set of Application configurations to a set of Sources and provides |
| * deployment-specific details, variables, and parameters. |
| * |
| * Deployment configurations are located under the deployments directory, and |
| * are named "<deployment-name>.cfg". The internal project name for a given |
| * deployment is "<deployment-name>". |
| * |
| * Each deployment entry roughly corresponds to a single Cloud Platform project. |
| */ |
| message Deployment { |
| /** The name of the source group to use for this deployment. */ |
| string source_group = 1; |
| |
| /** The name of the Application that this Deployment manages. */ |
| string application = 2; |
| |
| /** |
| * CloudProject defines the parameters for the deployent's Google Cloud |
| * Platform project, if applicable. |
| */ |
| message CloudProject { |
| /** The cloud project name. */ |
| string name = 1; |
| |
| /** The AppEngine module version scheme to use. */ |
| enum VersionScheme { |
| /* The DEFAULT version scheme uses the source group hash */ |
| DEFAULT = 0; |
| } |
| VersionScheme version_scheme = 2; |
| |
| message ResourceRef { |
| /** The name of the source that this resource resides in */ |
| string source = 1; |
| /** The source-relative path to the AppEngineResources text protobuf. */ |
| string path = 2; |
| } |
| repeated ResourceRef resource_ref = 4; |
| |
| /** |
| * Defines a Google Container Engine (GKE) cluster within this cloud |
| * project. |
| */ |
| message GKECluster { |
| /** The cluster name. */ |
| string name = 1; |
| /** The cluster zone. */ |
| string zone = 2; |
| /** The number of nodes in this cluster. */ |
| int32 nodes = 3; |
| |
| /** The size of the disk. */ |
| int32 disk_size_gb = 4; |
| /** The name of the GKE machine type for this cluster. */ |
| string machine_type = 5; |
| |
| /** If true, enable GKE's auto-upgrade feature. */ |
| bool enable_auto_upgrade = 6; |
| |
| /** Binds a ContainerEnginePod component to this GKE cluster. */ |
| message PodBinding { |
| /** |
| * The name of the Component to bind to this cluster. This component |
| * must be a ContainerEnginePod Component. |
| */ |
| string name = 1; |
| /** The number of pod replicas to host on this cluster. */ |
| int32 replicas = 2; |
| } |
| repeated PodBinding pod = 10; |
| } |
| repeated GKECluster gke_cluster = 5; |
| } |
| CloudProject cloud_project = 3; |
| |
| /** |
| * Map of key/value parameters for this Deployment. |
| * |
| * These will be automatically substituted where parameter substitution is |
| * allowed. |
| */ |
| map<string, string> parameter = 4; |
| } |