Documentation
¶
Index ¶
- func NewCiConfiguration_Override(c CiConfiguration, project projen.Project, name *string, ...)
- func NewGitlabConfiguration_Override(g GitlabConfiguration, project projen.Project, options *CiConfigurationOptions)
- func NewNestedConfiguration_Override(n NestedConfiguration, project projen.Project, parent GitlabConfiguration, ...)
- type Action
- type AllowFailure
- type Artifacts
- type Assets
- type Cache
- type CacheKeyFiles
- type CachePolicy
- type CacheWhen
- type CiConfiguration
- type CiConfigurationOptions
- type Default
- type DefaultElement
- type DeploymentTier
- type Engine
- type Environment
- type Filter
- type GitlabConfiguration
- type Image
- type Include
- type IncludeRule
- type Inherit
- type Job
- type JobWhen
- type KubernetesConfig
- type KubernetesEnum
- type Link
- type LinkType
- type Need
- type NestedConfiguration
- type Parallel
- type Release
- type Reports
- type Retry
- type Secret
- type Service
- type Strategy
- type Trigger
- type TriggerInclude
- type VariableConfig
- type VaultConfig
- type Workflow
- type WorkflowRule
- type WorkflowWhen
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCiConfiguration_Override ¶
func NewCiConfiguration_Override(c CiConfiguration, project projen.Project, name *string, options *CiConfigurationOptions)
Experimental.
func NewGitlabConfiguration_Override ¶
func NewGitlabConfiguration_Override(g GitlabConfiguration, project projen.Project, options *CiConfigurationOptions)
Experimental.
func NewNestedConfiguration_Override ¶
func NewNestedConfiguration_Override(n NestedConfiguration, project projen.Project, parent GitlabConfiguration, name *string, options *CiConfigurationOptions)
Experimental.
Types ¶
type Action ¶
type Action string
Specifies what this job will do.
'start' (default) indicates the job will start the deployment. 'prepare' indicates this will not affect the deployment. 'stop' indicates this will stop the deployment. Experimental.
type AllowFailure ¶
type AllowFailure struct {
// Experimental.
ExitCodes interface{} `field:"required" json:"exitCodes" yaml:"exitCodes"`
}
Exit code that are not considered failure.
The job fails for any other exit code. You can list which exit codes are not considered failures. The job fails for any other exit code. See: https://docs.gitlab.com/ee/ci/yaml/#allow_failure
Experimental.
type Artifacts ¶
type Artifacts struct {
// A list of paths to files/folders that should be excluded in the artifact.
// Experimental.
Exclude *[]*string `field:"optional" json:"exclude" yaml:"exclude"`
// How long artifacts should be kept.
//
// They are saved 30 days by default. Artifacts that have expired are removed periodically via cron job. Supports a wide variety of formats, e.g. '1 week', '3 mins 4 sec', '2 hrs 20 min', '2h20min', '6 mos 1 day', '47 yrs 6 mos and 4d', '3 weeks and 2 days'.
// Experimental.
ExpireIn *string `field:"optional" json:"expireIn" yaml:"expireIn"`
// Can be used to expose job artifacts in the merge request UI.
//
// GitLab will add a link <expose_as> to the relevant merge request that points to the artifact.
// Experimental.
ExposeAs *string `field:"optional" json:"exposeAs" yaml:"exposeAs"`
// Name for the archive created on job success.
//
// Can use variables in the name, e.g. '$CI_JOB_NAME'
// Experimental.
Name *string `field:"optional" json:"name" yaml:"name"`
// A list of paths to files/folders that should be included in the artifact.
// Experimental.
Paths *[]*string `field:"optional" json:"paths" yaml:"paths"`
// Reports will be uploaded as artifacts, and often displayed in the Gitlab UI, such as in Merge Requests.
// Experimental.
Reports *Reports `field:"optional" json:"reports" yaml:"reports"`
// Whether to add all untracked files (along with 'artifacts.paths') to the artifact.
// Experimental.
Untracked *bool `field:"optional" json:"untracked" yaml:"untracked"`
// Configure when artifacts are uploaded depended on job status.
// Experimental.
When CacheWhen `field:"optional" json:"when" yaml:"when"`
}
Used to specify a list of files and directories that should be attached to the job if it succeeds.
Artifacts are sent to Gitlab where they can be downloaded. See: https://docs.gitlab.com/ee/ci/yaml/#artifacts
Experimental.
type Assets ¶
type Assets struct {
// Include asset links in the release.
// Experimental.
Links *[]*Link `field:"required" json:"links" yaml:"links"`
}
Asset configuration for a release. Experimental.
type Cache ¶
type Cache struct {
// Used the to give each cache a unique identifying key.
//
// All jobs that use the same cache key use the same cache.
// Experimental.
Key interface{} `field:"optional" json:"key" yaml:"key"`
// Defines which files or directories to cache.
// Experimental.
Paths *[]*string `field:"optional" json:"paths" yaml:"paths"`
// Defines the upload and download behaviour of the cache.
// Experimental.
Policy CachePolicy `field:"optional" json:"policy" yaml:"policy"`
// If set to true all files that are untracked in your Git repository will be cached.
// Experimental.
Untracked *bool `field:"optional" json:"untracked" yaml:"untracked"`
// Defines when to save the cache, based on the status of the job (Default: Job Success).
// Experimental.
When CacheWhen `field:"optional" json:"when" yaml:"when"`
}
Cache Definition. See: https://docs.gitlab.com/ee/ci/yaml/#cache
Experimental.
type CacheKeyFiles ¶
type CacheKeyFiles struct {
// The files that are checked against.
//
// If the SHA checksum changes, the cache becomes invalid.
// Experimental.
Files *[]*string `field:"required" json:"files" yaml:"files"`
// Adds a custom prefix to the checksums computed.
// Experimental.
Prefix *string `field:"optional" json:"prefix" yaml:"prefix"`
}
Use this construct to generate a new key when one or two specific files change. See: https://docs.gitlab.com/ee/ci/yaml/#cachekeyfiles
Experimental.
type CachePolicy ¶
type CachePolicy string
Configure the upload and download behaviour of a cache. See: https://docs.gitlab.com/ee/ci/yaml/#cachepolicy
Experimental.
const ( // Only download the cache when the job starts, but never upload changes when the job finishes. // Experimental. CachePolicy_PULL CachePolicy = "PULL" // Only upload a cache when the job finishes, but never download the cache when the job starts. // Experimental. CachePolicy_PUSH CachePolicy = "PUSH" // The job downloads the cache when the job starts, and uploads changes to the cache when the job ends. // Experimental. CachePolicy_PULL_PUSH CachePolicy = "PULL_PUSH" )
type CacheWhen ¶
type CacheWhen string
Configure when artifacts are uploaded depended on job status. See: https://docs.gitlab.com/ee/ci/yaml/#cachewhen
Experimental.
const ( // Upload artifacts regardless of job status. // Experimental. CacheWhen_ALWAYS CacheWhen = "ALWAYS" // Upload artifacts only when the job fails. // Experimental. CacheWhen_ON_FAILURE CacheWhen = "ON_FAILURE" // Upload artifacts only when the job succeeds (this is the default). // Experimental. CacheWhen_ON_SUCCESS CacheWhen = "ON_SUCCESS" )
type CiConfiguration ¶
type CiConfiguration interface {
projen.Component
// Defines default scripts that should run *after* all jobs.
//
// Can be overriden by the job level `afterScript`.
// Experimental.
DefaultAfterScript() *[]*string
// Default list of files and directories that should be attached to the job if it succeeds.
//
// Artifacts are sent to Gitlab where they can be downloaded.
// Experimental.
DefaultArtifacts() *Artifacts
// Defines default scripts that should run *before* all jobs.
//
// Can be overriden by the job level `afterScript`.
// Experimental.
DefaultBeforeScript() *[]*string
// A default list of files and directories to cache between jobs.
//
// You can only use paths that are in the local working copy.
// Experimental.
DefaultCache() *Cache
// Specifies the default docker image to use globally for all jobs.
// Experimental.
DefaultImage() *Image
// The default behavior for whether a job should be canceled when a newer pipeline starts before the job completes (Default: false).
// Experimental.
DefaultInterruptible() *bool
// How many times a job is retried if it fails.
//
// If not defined, defaults to 0 and jobs do not retry.
// Experimental.
DefaultRetry() *Retry
// Used to select a specific runner from the list of all runners that are available for the project.
// Experimental.
DefaultTags() *[]*string
// A default timeout job written in natural language (Ex.
//
// one hour, 3600 seconds, 60 minutes).
// Experimental.
DefaultTimeout() *string
// The workflow YAML file.
// Experimental.
File() projen.YamlFile
// The jobs in the CI configuration.
// Experimental.
Jobs() *map[string]*Job
// The name of the configuration.
// Experimental.
Name() *string
// A special job used to upload static sites to Gitlab pages.
//
// Requires a `public/` directory
// with `artifacts.path` pointing to it.
// Experimental.
Pages() *Job
// Path to CI file generated by the configuration.
// Experimental.
Path() *string
// The project the configuration belongs to.
// Experimental.
Project() projen.Project
// Groups jobs into stages.
//
// All jobs in one stage must complete before next stage is
// executed. Defaults to ['build', 'test', 'deploy'].
// Experimental.
Stages() *[]*string
// Global variables that are passed to jobs.
//
// If the job already has that variable defined, the job-level variable takes precedence.
// Experimental.
Variables() *map[string]interface{}
// Used to control pipeline behavior.
// Experimental.
Workflow() *Workflow
// Add a globally defined variable to the CI configuration.
// Experimental.
AddGlobalVariables(variables *map[string]interface{})
// Add additional yml/yaml files to the CI includes.
// Experimental.
AddIncludes(includes ...*Include)
// Add jobs and their stages to the CI configuration.
// Experimental.
AddJobs(jobs *map[string]*Job)
// Add additional services.
// Experimental.
AddServices(services ...*Service)
// Add stages to the CI configuration if not already present.
// Experimental.
AddStages(stages ...*string)
// Called after synthesis.
//
// Order is *not* guaranteed.
// Experimental.
PostSynthesize()
// Called before synthesis.
// Experimental.
PreSynthesize()
// Synthesizes files to the project output directory.
// Experimental.
Synthesize()
}
CI for GitLab.
A CI is a configurable automated process made up of one or more stages/jobs. See: https://docs.gitlab.com/ee/ci/yaml/
Experimental.
func NewCiConfiguration ¶
func NewCiConfiguration(project projen.Project, name *string, options *CiConfigurationOptions) CiConfiguration
Experimental.
type CiConfigurationOptions ¶
type CiConfigurationOptions struct {
// Default settings for the CI Configuration.
//
// Jobs that do not define one or more of the listed keywords use the value defined in the default section.
// Experimental.
Default *Default `field:"optional" json:"default" yaml:"default"`
// An initial set of jobs to add to the configuration.
// Experimental.
Jobs *map[string]*Job `field:"optional" json:"jobs" yaml:"jobs"`
// A special job used to upload static sites to Gitlab pages.
//
// Requires a `public/` directory
// with `artifacts.path` pointing to it.
// Experimental.
Pages *Job `field:"optional" json:"pages" yaml:"pages"`
// Groups jobs into stages.
//
// All jobs in one stage must complete before next stage is
// executed. If no stages are specified. Defaults to ['build', 'test', 'deploy'].
// Experimental.
Stages *[]*string `field:"optional" json:"stages" yaml:"stages"`
// Global variables that are passed to jobs.
//
// If the job already has that variable defined, the job-level variable takes precedence.
// Experimental.
Variables *map[string]interface{} `field:"optional" json:"variables" yaml:"variables"`
// Used to control pipeline behavior.
// Experimental.
Workflow *Workflow `field:"optional" json:"workflow" yaml:"workflow"`
}
Options for `CiConfiguration`. Experimental.
type Default ¶
type Default struct {
// Experimental.
AfterScript *[]*string `field:"optional" json:"afterScript" yaml:"afterScript"`
// Experimental.
Artifacts *Artifacts `field:"optional" json:"artifacts" yaml:"artifacts"`
// Experimental.
BeforeScript *[]*string `field:"optional" json:"beforeScript" yaml:"beforeScript"`
// Experimental.
Cache *Cache `field:"optional" json:"cache" yaml:"cache"`
// Experimental.
Image *Image `field:"optional" json:"image" yaml:"image"`
// Experimental.
Interruptible *bool `field:"optional" json:"interruptible" yaml:"interruptible"`
// Experimental.
Retry *Retry `field:"optional" json:"retry" yaml:"retry"`
// Experimental.
Services *[]*Service `field:"optional" json:"services" yaml:"services"`
// Experimental.
Tags *[]*string `field:"optional" json:"tags" yaml:"tags"`
// Experimental.
Timeout *string `field:"optional" json:"timeout" yaml:"timeout"`
}
Default settings for the CI Configuration.
Jobs that do not define one or more of the listed keywords use the value defined in the default section. See: https://docs.gitlab.com/ee/ci/yaml/#default
Experimental.
type DefaultElement ¶
type DefaultElement string
Experimental.
const ( // Experimental. DefaultElement_AFTER_SCRIPT DefaultElement = "AFTER_SCRIPT" // Experimental. DefaultElement_ARTIFACTS DefaultElement = "ARTIFACTS" // Experimental. DefaultElement_BEFORE_SCRIPT DefaultElement = "BEFORE_SCRIPT" // Experimental. DefaultElement_CACHE DefaultElement = "CACHE" // Experimental. DefaultElement_IMAGE DefaultElement = "IMAGE" // Experimental. DefaultElement_INTERRUPTIBLE DefaultElement = "INTERRUPTIBLE" // Experimental. DefaultElement_RETRY DefaultElement = "RETRY" // Experimental. DefaultElement_SERVICES DefaultElement = "SERVICES" // Experimental. DefaultElement_TAGS DefaultElement = "TAGS" // Experimental. DefaultElement_TIMEOUT DefaultElement = "TIMEOUT" )
type DeploymentTier ¶
type DeploymentTier string
Explicitly specifies the tier of the deployment environment if non-standard environment name is used. Experimental.
const ( // Experimental. DeploymentTier_DEVELOPMENT DeploymentTier = "DEVELOPMENT" // Experimental. DeploymentTier_OTHER DeploymentTier = "OTHER" // Experimental. DeploymentTier_PRODUCTION DeploymentTier = "PRODUCTION" // Experimental. DeploymentTier_STAGING DeploymentTier = "STAGING" // Experimental. DeploymentTier_TESTING DeploymentTier = "TESTING" )
type Engine ¶
type Engine struct {
// Name of the secrets engine.
// Experimental.
Name *string `field:"required" json:"name" yaml:"name"`
// Path to the secrets engine.
// Experimental.
Path *string `field:"required" json:"path" yaml:"path"`
}
The engine configuration for a secret. Experimental.
type Environment ¶
type Environment struct {
// The name of the environment, e.g. 'qa', 'staging', 'production'.
// Experimental.
Name *string `field:"required" json:"name" yaml:"name"`
// Specifies what this job will do.
//
// 'start' (default) indicates the job will start the deployment. 'prepare' indicates this will not affect the deployment. 'stop' indicates this will stop the deployment.
// Experimental.
Action Action `field:"optional" json:"action" yaml:"action"`
// The amount of time it should take before Gitlab will automatically stop the environment.
//
// Supports a wide variety of formats, e.g. '1 week', '3 mins 4 sec', '2 hrs 20 min', '2h20min', '6 mos 1 day', '47 yrs 6 mos and 4d', '3 weeks and 2 days'.
// Experimental.
AutoStopIn *string `field:"optional" json:"autoStopIn" yaml:"autoStopIn"`
// Explicitly specifies the tier of the deployment environment if non-standard environment name is used.
// Experimental.
DeploymentTier DeploymentTier `field:"optional" json:"deploymentTier" yaml:"deploymentTier"`
// Used to configure the kubernetes deployment for this environment.
//
// This is currently not supported for kubernetes clusters that are managed by Gitlab.
// Experimental.
Kubernetes *KubernetesConfig `field:"optional" json:"kubernetes" yaml:"kubernetes"`
// The name of a job to execute when the environment is about to be stopped.
// Experimental.
OnStop *string `field:"optional" json:"onStop" yaml:"onStop"`
// When set, this will expose buttons in various places for the current environment in Gitlab, that will take you to the defined URL.
// Experimental.
Url *string `field:"optional" json:"url" yaml:"url"`
}
The environment that a job deploys to. Experimental.
type Filter ¶
type Filter struct {
// Filter job creation based on files that were modified in a git push.
// Experimental.
Changes *[]*string `field:"optional" json:"changes" yaml:"changes"`
// Filter job based on if Kubernetes integration is active.
// Experimental.
Kubernetes KubernetesEnum `field:"optional" json:"kubernetes" yaml:"kubernetes"`
// Control when to add jobs to a pipeline based on branch names or pipeline types.
// Experimental.
Refs *[]*string `field:"optional" json:"refs" yaml:"refs"`
// Filter job by checking comparing values of environment variables.
//
// Read more about variable expressions: https://docs.gitlab.com/ee/ci/variables/README.html#variables-expressions
// Experimental.
Variables *[]*string `field:"optional" json:"variables" yaml:"variables"`
}
Filtering options for when a job will run. Experimental.
type GitlabConfiguration ¶
type GitlabConfiguration interface {
CiConfiguration
// Defines default scripts that should run *after* all jobs.
//
// Can be overriden by the job level `afterScript`.
// Experimental.
DefaultAfterScript() *[]*string
// Default list of files and directories that should be attached to the job if it succeeds.
//
// Artifacts are sent to Gitlab where they can be downloaded.
// Experimental.
DefaultArtifacts() *Artifacts
// Defines default scripts that should run *before* all jobs.
//
// Can be overriden by the job level `afterScript`.
// Experimental.
DefaultBeforeScript() *[]*string
// A default list of files and directories to cache between jobs.
//
// You can only use paths that are in the local working copy.
// Experimental.
DefaultCache() *Cache
// Specifies the default docker image to use globally for all jobs.
// Experimental.
DefaultImage() *Image
// The default behavior for whether a job should be canceled when a newer pipeline starts before the job completes (Default: false).
// Experimental.
DefaultInterruptible() *bool
// How many times a job is retried if it fails.
//
// If not defined, defaults to 0 and jobs do not retry.
// Experimental.
DefaultRetry() *Retry
// Used to select a specific runner from the list of all runners that are available for the project.
// Experimental.
DefaultTags() *[]*string
// A default timeout job written in natural language (Ex.
//
// one hour, 3600 seconds, 60 minutes).
// Experimental.
DefaultTimeout() *string
// The workflow YAML file.
// Experimental.
File() projen.YamlFile
// The jobs in the CI configuration.
// Experimental.
Jobs() *map[string]*Job
// The name of the configuration.
// Experimental.
Name() *string
// Experimental.
NestedTemplates() *map[string]NestedConfiguration
// A special job used to upload static sites to Gitlab pages.
//
// Requires a `public/` directory
// with `artifacts.path` pointing to it.
// Experimental.
Pages() *Job
// Path to CI file generated by the configuration.
// Experimental.
Path() *string
// The project the configuration belongs to.
// Experimental.
Project() projen.Project
// Groups jobs into stages.
//
// All jobs in one stage must complete before next stage is
// executed. Defaults to ['build', 'test', 'deploy'].
// Experimental.
Stages() *[]*string
// Global variables that are passed to jobs.
//
// If the job already has that variable defined, the job-level variable takes precedence.
// Experimental.
Variables() *map[string]interface{}
// Used to control pipeline behavior.
// Experimental.
Workflow() *Workflow
// Add a globally defined variable to the CI configuration.
// Experimental.
AddGlobalVariables(variables *map[string]interface{})
// Add additional yml/yaml files to the CI includes.
// Experimental.
AddIncludes(includes ...*Include)
// Add jobs and their stages to the CI configuration.
// Experimental.
AddJobs(jobs *map[string]*Job)
// Add additional services.
// Experimental.
AddServices(services ...*Service)
// Add stages to the CI configuration if not already present.
// Experimental.
AddStages(stages ...*string)
// Creates and adds nested templates to the includes of the main CI.
//
// Additionally adds their stages to the main CI if they are not already present.
// You can futher customize nested templates through the `nestedTemplates` property.
// E.g. gitlabConfig.nestedTemplates['templateName']?.addStages('stageName')
// Experimental.
CreateNestedTemplates(config *map[string]*CiConfigurationOptions)
// Called after synthesis.
//
// Order is *not* guaranteed.
// Experimental.
PostSynthesize()
// Called before synthesis.
// Experimental.
PreSynthesize()
// Synthesizes files to the project output directory.
// Experimental.
Synthesize()
}
A GitLab CI for the main `.gitlab-ci.yml` file. Experimental.
func NewGitlabConfiguration ¶
func NewGitlabConfiguration(project projen.Project, options *CiConfigurationOptions) GitlabConfiguration
Experimental.
type Image ¶
type Image struct {
// Full name of the image that should be used.
//
// It should contain the Registry part if needed.
// Experimental.
Name *string `field:"required" json:"name" yaml:"name"`
// Command or script that should be executed as the container's entrypoint.
//
// It will be translated to Docker's --entrypoint option while creating the container. The syntax is similar to Dockerfile's ENTRYPOINT directive, where each shell token is a separate string in the array.
// Experimental.
Entrypoint *[]interface{} `field:"optional" json:"entrypoint" yaml:"entrypoint"`
}
Specifies the docker image to use for the job or globally for all jobs.
Job configuration takes precedence over global setting. Requires a certain kind of Gitlab runner executor. See: https://docs.gitlab.com/ee/ci/yaml/#image
Experimental.
type Include ¶
type Include struct {
// Files from another private project on the same GitLab instance.
//
// You can use `file` in combination with `project` only.
// Experimental.
File *[]*string `field:"optional" json:"file" yaml:"file"`
// Relative path from local repository root (`/`) to the `yaml`/`yml` file template.
//
// The file must be on the same branch, and does not work across git submodules.
// Experimental.
Local *string `field:"optional" json:"local" yaml:"local"`
// Path to the project, e.g. `group/project`, or `group/sub-group/project`.
// Experimental.
Project *string `field:"optional" json:"project" yaml:"project"`
// Branch/Tag/Commit-hash for the target project.
// Experimental.
Ref *string `field:"optional" json:"ref" yaml:"ref"`
// URL to a `yaml`/`yml` template file using HTTP/HTTPS.
// Experimental.
Remote *string `field:"optional" json:"remote" yaml:"remote"`
// Rules allows for an array of individual rule objects to be evaluated in order, until one matches and dynamically provides attributes to the job.
// Experimental.
Rules *[]*IncludeRule `field:"optional" json:"rules" yaml:"rules"`
// Use a `.gitlab-ci.yml` template as a base, e.g. `Nodejs.gitlab-ci.yml`.
// Experimental.
Template *string `field:"optional" json:"template" yaml:"template"`
}
An included YAML file. See: https://docs.gitlab.com/ee/ci/yaml/#include
Experimental.
type IncludeRule ¶
type IncludeRule struct {
// Experimental.
AllowFailure interface{} `field:"optional" json:"allowFailure" yaml:"allowFailure"`
// Experimental.
Changes *[]*string `field:"optional" json:"changes" yaml:"changes"`
// Experimental.
Exists *[]*string `field:"optional" json:"exists" yaml:"exists"`
// Experimental.
If *string `field:"optional" json:"if" yaml:"if"`
// Experimental.
StartIn *string `field:"optional" json:"startIn" yaml:"startIn"`
// Experimental.
Variables *map[string]interface{} `field:"optional" json:"variables" yaml:"variables"`
// Experimental.
When JobWhen `field:"optional" json:"when" yaml:"when"`
}
Rules allows for an array of individual rule objects to be evaluated in order, until one matches and dynamically provides attributes to the job. See: https://docs.gitlab.com/ee/ci/yaml/includes.html#use-rules-with-include
Experimental.
type Inherit ¶
type Inherit struct {
// Whether to inherit all globally-defined defaults or not.
//
// Or subset of inherited defaults.
// Experimental.
Default interface{} `field:"optional" json:"default" yaml:"default"`
// Whether to inherit all globally-defined variables or not.
//
// Or subset of inherited variables.
// Experimental.
Variables interface{} `field:"optional" json:"variables" yaml:"variables"`
}
Controls inheritance of globally-defined defaults and variables.
Boolean values control inheritance of all default: or variables: keywords. To inherit only a subset of default: or variables: keywords, specify what you wish to inherit. Anything not listed is not inherited. Experimental.
type Job ¶
type Job struct {
// Experimental.
AfterScript *[]*string `field:"optional" json:"afterScript" yaml:"afterScript"`
// Whether to allow the pipeline to continue running on job failure (Default: false).
// Experimental.
AllowFailure interface{} `field:"optional" json:"allowFailure" yaml:"allowFailure"`
// Experimental.
Artifacts *Artifacts `field:"optional" json:"artifacts" yaml:"artifacts"`
// Experimental.
BeforeScript *[]*string `field:"optional" json:"beforeScript" yaml:"beforeScript"`
// Experimental.
Cache *Cache `field:"optional" json:"cache" yaml:"cache"`
// Must be a regular expression, optionally but recommended to be quoted, and must be surrounded with '/'.
//
// Example: '/Code coverage: \d+\.\d+/'
// Experimental.
Coverage *string `field:"optional" json:"coverage" yaml:"coverage"`
// Specify a list of job names from earlier stages from which artifacts should be loaded.
//
// By default, all previous artifacts are passed. Use an empty array to skip downloading artifacts.
// Experimental.
Dependencies *[]*string `field:"optional" json:"dependencies" yaml:"dependencies"`
// Used to associate environment metadata with a deploy.
//
// Environment can have a name and URL attached to it, and will be displayed under /environments under the project.
// Experimental.
Environment interface{} `field:"optional" json:"environment" yaml:"environment"`
// Job will run *except* for when these filtering options match.
// Experimental.
Except interface{} `field:"optional" json:"except" yaml:"except"`
// The name of one or more jobs to inherit configuration from.
// Experimental.
Extends *[]*string `field:"optional" json:"extends" yaml:"extends"`
// Experimental.
Image *Image `field:"optional" json:"image" yaml:"image"`
// Controls inheritance of globally-defined defaults and variables.
//
// Boolean values control inheritance of all default: or variables: keywords. To inherit only a subset of default: or variables: keywords, specify what you wish to inherit. Anything not listed is not inherited.
// Experimental.
Inherit *Inherit `field:"optional" json:"inherit" yaml:"inherit"`
// Experimental.
Interruptible *bool `field:"optional" json:"interruptible" yaml:"interruptible"`
// The list of jobs in previous stages whose sole completion is needed to start the current job.
// Experimental.
Needs *[]interface{} `field:"optional" json:"needs" yaml:"needs"`
// Job will run *only* when these filtering options match.
// Experimental.
Only interface{} `field:"optional" json:"only" yaml:"only"`
// Parallel will split up a single job into several, and provide `CI_NODE_INDEX` and `CI_NODE_TOTAL` environment variables for the running jobs.
// Experimental.
Parallel interface{} `field:"optional" json:"parallel" yaml:"parallel"`
// Indicates that the job creates a Release.
// Experimental.
Release *Release `field:"optional" json:"release" yaml:"release"`
// Limit job concurrency.
//
// Can be used to ensure that the Runner will not run certain jobs simultaneously.
// Experimental.
ResourceGroup *string `field:"optional" json:"resourceGroup" yaml:"resourceGroup"`
// Experimental.
Retry *Retry `field:"optional" json:"retry" yaml:"retry"`
// Rules allows for an array of individual rule objects to be evaluated in order, until one matches and dynamically provides attributes to the job.
// Experimental.
Rules *[]*IncludeRule `field:"optional" json:"rules" yaml:"rules"`
// Shell scripts executed by the Runner.
//
// The only required property of jobs. Be careful with special characters (e.g. `:`, `{`, `}`, `&`) and use single or double quotes to avoid issues.
// Experimental.
Script *[]*string `field:"optional" json:"script" yaml:"script"`
// CI/CD secrets.
// Experimental.
Secrets *map[string]*map[string]*Secret `field:"optional" json:"secrets" yaml:"secrets"`
// Experimental.
Services *[]*Service `field:"optional" json:"services" yaml:"services"`
// Define what stage the job will run in.
// Experimental.
Stage *string `field:"optional" json:"stage" yaml:"stage"`
// Experimental.
StartIn *string `field:"optional" json:"startIn" yaml:"startIn"`
// Experimental.
Tags *[]*string `field:"optional" json:"tags" yaml:"tags"`
// Experimental.
Timeout *string `field:"optional" json:"timeout" yaml:"timeout"`
// Trigger allows you to define downstream pipeline trigger.
//
// When a job created from trigger definition is started by GitLab, a downstream pipeline gets created. Read more: https://docs.gitlab.com/ee/ci/yaml/README.html#trigger
// Experimental.
Trigger interface{} `field:"optional" json:"trigger" yaml:"trigger"`
// Configurable values that are passed to the Job.
// Experimental.
Variables *map[string]interface{} `field:"optional" json:"variables" yaml:"variables"`
// Describes the conditions for when to run the job.
//
// Defaults to 'on_success'.
// Experimental.
When JobWhen `field:"optional" json:"when" yaml:"when"`
}
Jobs are the most fundamental element of a .gitlab-ci.yml file. See: https://docs.gitlab.com/ee/ci/jobs/
Experimental.
type JobWhen ¶
type JobWhen string
Describes the conditions for when to run the job.
Defaults to 'on_success'. See: https://docs.gitlab.com/ee/ci/yaml/#when
Experimental.
const ( // Experimental. JobWhen_ALWAYS JobWhen = "ALWAYS" // Experimental. JobWhen_DELAYED JobWhen = "DELAYED" // Experimental. JobWhen_MANUAL JobWhen = "MANUAL" // Experimental. JobWhen_NEVER JobWhen = "NEVER" // Experimental. JobWhen_ON_FAILURE JobWhen = "ON_FAILURE" // Experimental. JobWhen_ON_SUCCESS JobWhen = "ON_SUCCESS" )
type KubernetesConfig ¶
type KubernetesConfig struct {
// The kubernetes namespace where this environment should be deployed to.
// Experimental.
Namespace *string `field:"optional" json:"namespace" yaml:"namespace"`
}
Used to configure the kubernetes deployment for this environment.
This is currently not supported for kubernetes clusters that are managed by Gitlab. Experimental.
type KubernetesEnum ¶
type KubernetesEnum string
Filter job based on if Kubernetes integration is active. Experimental.
const ( // Experimental. KubernetesEnum_ACTIVE KubernetesEnum = "ACTIVE" )
type Link ¶
type Link struct {
// The name of the link.
// Experimental.
Name *string `field:"required" json:"name" yaml:"name"`
// The URL to download a file.
// Experimental.
Url *string `field:"required" json:"url" yaml:"url"`
// The redirect link to the url.
// Experimental.
Filepath *string `field:"optional" json:"filepath" yaml:"filepath"`
// The content kind of what users can download via url.
// Experimental.
LinkType LinkType `field:"optional" json:"linkType" yaml:"linkType"`
}
Link configuration for an asset. Experimental.
type LinkType ¶
type LinkType string
The content kind of what users can download via url. Experimental.
type Need ¶
type Need struct {
// Experimental.
Job *string `field:"required" json:"job" yaml:"job"`
// Experimental.
Artifacts *bool `field:"optional" json:"artifacts" yaml:"artifacts"`
// Experimental.
Optional *bool `field:"optional" json:"optional" yaml:"optional"`
// Experimental.
Pipeline *string `field:"optional" json:"pipeline" yaml:"pipeline"`
// Experimental.
Project *string `field:"optional" json:"project" yaml:"project"`
// Experimental.
Ref *string `field:"optional" json:"ref" yaml:"ref"`
}
A jobs in a previous stage whose sole completion is needed to start the current job. Experimental.
type NestedConfiguration ¶
type NestedConfiguration interface {
CiConfiguration
// Defines default scripts that should run *after* all jobs.
//
// Can be overriden by the job level `afterScript`.
// Experimental.
DefaultAfterScript() *[]*string
// Default list of files and directories that should be attached to the job if it succeeds.
//
// Artifacts are sent to Gitlab where they can be downloaded.
// Experimental.
DefaultArtifacts() *Artifacts
// Defines default scripts that should run *before* all jobs.
//
// Can be overriden by the job level `afterScript`.
// Experimental.
DefaultBeforeScript() *[]*string
// A default list of files and directories to cache between jobs.
//
// You can only use paths that are in the local working copy.
// Experimental.
DefaultCache() *Cache
// Specifies the default docker image to use globally for all jobs.
// Experimental.
DefaultImage() *Image
// The default behavior for whether a job should be canceled when a newer pipeline starts before the job completes (Default: false).
// Experimental.
DefaultInterruptible() *bool
// How many times a job is retried if it fails.
//
// If not defined, defaults to 0 and jobs do not retry.
// Experimental.
DefaultRetry() *Retry
// Used to select a specific runner from the list of all runners that are available for the project.
// Experimental.
DefaultTags() *[]*string
// A default timeout job written in natural language (Ex.
//
// one hour, 3600 seconds, 60 minutes).
// Experimental.
DefaultTimeout() *string
// The workflow YAML file.
// Experimental.
File() projen.YamlFile
// The jobs in the CI configuration.
// Experimental.
Jobs() *map[string]*Job
// The name of the configuration.
// Experimental.
Name() *string
// A special job used to upload static sites to Gitlab pages.
//
// Requires a `public/` directory
// with `artifacts.path` pointing to it.
// Experimental.
Pages() *Job
// Experimental.
Parent() GitlabConfiguration
// Path to CI file generated by the configuration.
// Experimental.
Path() *string
// The project the configuration belongs to.
// Experimental.
Project() projen.Project
// Groups jobs into stages.
//
// All jobs in one stage must complete before next stage is
// executed. Defaults to ['build', 'test', 'deploy'].
// Experimental.
Stages() *[]*string
// Global variables that are passed to jobs.
//
// If the job already has that variable defined, the job-level variable takes precedence.
// Experimental.
Variables() *map[string]interface{}
// Used to control pipeline behavior.
// Experimental.
Workflow() *Workflow
// Add a globally defined variable to the CI configuration.
// Experimental.
AddGlobalVariables(variables *map[string]interface{})
// Add additional yml/yaml files to the CI includes.
// Experimental.
AddIncludes(includes ...*Include)
// Add jobs and their stages to the CI configuration.
// Experimental.
AddJobs(jobs *map[string]*Job)
// Add additional services.
// Experimental.
AddServices(services ...*Service)
// Add stages to the CI configuration if not already present.
// Experimental.
AddStages(stages ...*string)
// Called after synthesis.
//
// Order is *not* guaranteed.
// Experimental.
PostSynthesize()
// Called before synthesis.
// Experimental.
PreSynthesize()
// Synthesizes files to the project output directory.
// Experimental.
Synthesize()
}
A GitLab CI for templates that are created and included in the `.gitlab-ci.yml` file. Experimental.
func NewNestedConfiguration ¶
func NewNestedConfiguration(project projen.Project, parent GitlabConfiguration, name *string, options *CiConfigurationOptions) NestedConfiguration
Experimental.
type Parallel ¶
type Parallel struct {
// Defines different variables for jobs that are running in parallel.
// Experimental.
Matrix *[]*map[string]*[]interface{} `field:"required" json:"matrix" yaml:"matrix"`
}
Used to run a job multiple times in parallel in a single pipeline. Experimental.
type Release ¶
type Release struct {
// Specifies the longer description of the Release.
// Experimental.
Description *string `field:"required" json:"description" yaml:"description"`
// The tag_name must be specified.
//
// It can refer to an existing Git tag or can be specified by the user.
// Experimental.
TagName *string `field:"required" json:"tagName" yaml:"tagName"`
// Experimental.
Assets *Assets `field:"optional" json:"assets" yaml:"assets"`
// The title of each milestone the release is associated with.
// Experimental.
Milestones *[]*string `field:"optional" json:"milestones" yaml:"milestones"`
// The Release name.
//
// If omitted, it is populated with the value of release: tag_name.
// Experimental.
Name *string `field:"optional" json:"name" yaml:"name"`
// If the release: tag_name doesn’t exist yet, the release is created from ref.
//
// ref can be a commit SHA, another tag name, or a branch name.
// Experimental.
Ref *string `field:"optional" json:"ref" yaml:"ref"`
// The date and time when the release is ready.
//
// Defaults to the current date and time if not defined. Should be enclosed in quotes and expressed in ISO 8601 format.
// Experimental.
ReleasedAt *string `field:"optional" json:"releasedAt" yaml:"releasedAt"`
}
Indicates that the job creates a Release. Experimental.
type Reports ¶
type Reports struct {
// Path for file(s) that should be parsed as Cobertura XML coverage report.
// Experimental.
Cobertura *[]*string `field:"optional" json:"cobertura" yaml:"cobertura"`
// Path to file or list of files with code quality report(s) (such as Code Climate).
// Experimental.
Codequality *[]*string `field:"optional" json:"codequality" yaml:"codequality"`
// Path to file or list of files with Container scanning vulnerabilities report(s).
// Experimental.
ContainerScanning *[]*string `field:"optional" json:"containerScanning" yaml:"containerScanning"`
// Path to file or list of files with DAST vulnerabilities report(s).
// Experimental.
Dast *[]*string `field:"optional" json:"dast" yaml:"dast"`
// Path to file or list of files with Dependency scanning vulnerabilities report(s).
// Experimental.
DependencyScanning *[]*string `field:"optional" json:"dependencyScanning" yaml:"dependencyScanning"`
// Path to file or list of files containing runtime-created variables for this job.
// Experimental.
Dotenv *[]*string `field:"optional" json:"dotenv" yaml:"dotenv"`
// Path for file(s) that should be parsed as JUnit XML result.
// Experimental.
Junit *[]*string `field:"optional" json:"junit" yaml:"junit"`
// Deprecated in 12.8: Path to file or list of files with license report(s).
// Experimental.
LicenseManagement *[]*string `field:"optional" json:"licenseManagement" yaml:"licenseManagement"`
// Path to file or list of files with license report(s).
// Experimental.
LicenseScanning *[]*string `field:"optional" json:"licenseScanning" yaml:"licenseScanning"`
// Path to file or list of files containing code intelligence (Language Server Index Format).
// Experimental.
Lsif *[]*string `field:"optional" json:"lsif" yaml:"lsif"`
// Path to file or list of files with custom metrics report(s).
// Experimental.
Metrics *[]*string `field:"optional" json:"metrics" yaml:"metrics"`
// Path to file or list of files with performance metrics report(s).
// Experimental.
Performance *[]*string `field:"optional" json:"performance" yaml:"performance"`
// Path to file or list of files with requirements report(s).
// Experimental.
Requirements *[]*string `field:"optional" json:"requirements" yaml:"requirements"`
// Path to file or list of files with SAST vulnerabilities report(s).
// Experimental.
Sast *[]*string `field:"optional" json:"sast" yaml:"sast"`
// Path to file or list of files with secret detection report(s).
// Experimental.
SecretDetection *[]*string `field:"optional" json:"secretDetection" yaml:"secretDetection"`
// Path to file or list of files with terraform plan(s).
// Experimental.
Terraform *[]*string `field:"optional" json:"terraform" yaml:"terraform"`
}
Reports will be uploaded as artifacts, and often displayed in the Gitlab UI, such as in Merge Requests. See: https://docs.gitlab.com/ee/ci/yaml/#artifactsreports
Experimental.
type Retry ¶
type Retry struct {
// 0 (default), 1, or 2.
// Experimental.
Max *float64 `field:"optional" json:"max" yaml:"max"`
// Either a single or array of error types to trigger job retry.
// Experimental.
When interface{} `field:"optional" json:"when" yaml:"when"`
}
How many times a job is retried if it fails.
If not defined, defaults to 0 and jobs do not retry. See: https://docs.gitlab.com/ee/ci/yaml/#retry
Experimental.
type Secret ¶
type Secret struct {
// Experimental.
Vault *VaultConfig `field:"required" json:"vault" yaml:"vault"`
}
A CI/CD secret. Experimental.
type Service ¶
type Service struct {
// Full name of the image that should be used.
//
// It should contain the Registry part if needed.
// Experimental.
Name *string `field:"required" json:"name" yaml:"name"`
// Additional alias that can be used to access the service from the job's container.
//
// Read Accessing the services for more information.
// Experimental.
Alias *string `field:"optional" json:"alias" yaml:"alias"`
// Command or script that should be used as the container's command.
//
// It will be translated to arguments passed to Docker after the image's name. The syntax is similar to Dockerfile's CMD directive, where each shell token is a separate string in the array.
// Experimental.
Command *[]*string `field:"optional" json:"command" yaml:"command"`
// Command or script that should be executed as the container's entrypoint.
//
// It will be translated to Docker's --entrypoint option while creating the container. The syntax is similar to Dockerfile's ENTRYPOINT directive, where each shell token is a separate string in the array.
// Experimental.
Entrypoint *[]*string `field:"optional" json:"entrypoint" yaml:"entrypoint"`
}
Used to specify an additional Docker image to run scripts in.
The service image is linked to the image specified in the @Default image keyword. See: https://docs.gitlab.com/ee/ci/yaml/#services
Experimental.
type Strategy ¶
type Strategy string
You can mirror the pipeline status from the triggered pipeline to the source bridge job by using strategy: depend. See: https://docs.gitlab.com/ee/ci/yaml/#triggerstrategy
Experimental.
const ( // Experimental. Strategy_DEPEND Strategy = "DEPEND" )
type Trigger ¶
type Trigger struct {
// The branch name that a downstream pipeline will use.
// Experimental.
Branch *string `field:"optional" json:"branch" yaml:"branch"`
// A list of local files or artifacts from other jobs to define the pipeline.
// Experimental.
Include *[]*TriggerInclude `field:"optional" json:"include" yaml:"include"`
// Path to the project, e.g. `group/project`, or `group/sub-group/project`.
// Experimental.
Project *string `field:"optional" json:"project" yaml:"project"`
// You can mirror the pipeline status from the triggered pipeline to the source bridge job by using strategy: depend.
// Experimental.
Strategy Strategy `field:"optional" json:"strategy" yaml:"strategy"`
}
Trigger a multi-project or a child pipeline.
Read more:. See: https://docs.gitlab.com/ee/ci/yaml/README.html#trigger-syntax-for-child-pipeline
Experimental.
type TriggerInclude ¶
type TriggerInclude struct {
// Relative path to the generated YAML file which is extracted from the artifacts and used as the configuration for triggering the child pipeline.
// Experimental.
Artifact *string `field:"optional" json:"artifact" yaml:"artifact"`
// Relative path from repository root (`/`) to the pipeline configuration YAML file.
// Experimental.
File *string `field:"optional" json:"file" yaml:"file"`
// Job name which generates the artifact.
// Experimental.
Job *string `field:"optional" json:"job" yaml:"job"`
// Relative path from local repository root (`/`) to the local YAML file to define the pipeline configuration.
// Experimental.
Local *string `field:"optional" json:"local" yaml:"local"`
// Path to another private project under the same GitLab instance, like `group/project` or `group/sub-group/project`.
// Experimental.
Project *string `field:"optional" json:"project" yaml:"project"`
// Branch/Tag/Commit hash for the target project.
// Experimental.
Ref *string `field:"optional" json:"ref" yaml:"ref"`
// Name of the template YAML file to use in the pipeline configuration.
// Experimental.
Template *string `field:"optional" json:"template" yaml:"template"`
}
References a local file or an artifact from another job to define the pipeline configuration. See: https://docs.gitlab.com/ee/ci/yaml/#triggerinclude
Experimental.
type VariableConfig ¶
type VariableConfig struct {
// Define a global variable that is prefilled when running a pipeline manually.
//
// Must be used with value.
// Experimental.
Description *string `field:"optional" json:"description" yaml:"description"`
// The variable value.
// Experimental.
Value *string `field:"optional" json:"value" yaml:"value"`
}
Explains what the global variable is used for, what the acceptable values are. See: https://docs.gitlab.com/ee/ci/yaml/#variables
Experimental.
type VaultConfig ¶
type VaultConfig struct {
// Experimental.
Engine *Engine `field:"required" json:"engine" yaml:"engine"`
// Experimental.
Field *string `field:"required" json:"field" yaml:"field"`
// Path to the secret.
// Experimental.
Path *string `field:"required" json:"path" yaml:"path"`
}
Specification for a secret provided by a HashiCorp Vault. See: https://www.vaultproject.io/
Experimental.
type Workflow ¶
type Workflow struct {
// Used to control whether or not a whole pipeline is created.
// Experimental.
Rules *[]*WorkflowRule `field:"optional" json:"rules" yaml:"rules"`
}
Used to control pipeline behavior. See: https://docs.gitlab.com/ee/ci/yaml/#workflow
Experimental.
type WorkflowRule ¶
type WorkflowRule struct {
// Experimental.
Changes *[]*string `field:"optional" json:"changes" yaml:"changes"`
// Experimental.
Exists *[]*string `field:"optional" json:"exists" yaml:"exists"`
// Experimental.
If *string `field:"optional" json:"if" yaml:"if"`
// Experimental.
Variables *map[string]interface{} `field:"optional" json:"variables" yaml:"variables"`
// Experimental.
When JobWhen `field:"optional" json:"when" yaml:"when"`
}
Used to control whether or not a whole pipeline is created. See: https://docs.gitlab.com/ee/ci/yaml/#workflowrules
Experimental.
type WorkflowWhen ¶
type WorkflowWhen string
Describes the conditions for when to run the job.
Defaults to 'on_success'. The value can only be 'always' or 'never' when used with workflow. See: https://docs.gitlab.com/ee/ci/yaml/#workflowrules
Experimental.
const ( // Experimental. WorkflowWhen_ALWAYS WorkflowWhen = "ALWAYS" // Experimental. WorkflowWhen_NEVER WorkflowWhen = "NEVER" )
Source Files
¶
- Action.go
- AllowFailure.go
- Artifacts.go
- Assets.go
- Cache.go
- CacheKeyFiles.go
- CachePolicy.go
- CacheWhen.go
- CiConfiguration.go
- CiConfigurationOptions.go
- CiConfiguration__checks.go
- Default.go
- DefaultElement.go
- DeploymentTier.go
- Engine.go
- Environment.go
- Filter.go
- GitlabConfiguration.go
- GitlabConfiguration__checks.go
- Image.go
- Include.go
- IncludeRule.go
- Inherit.go
- Job.go
- JobWhen.go
- KubernetesConfig.go
- KubernetesEnum.go
- Link.go
- LinkType.go
- Need.go
- NestedConfiguration.go
- NestedConfiguration__checks.go
- Parallel.go
- Release.go
- Reports.go
- Retry.go
- Secret.go
- Service.go
- Strategy.go
- Trigger.go
- TriggerInclude.go
- VariableConfig.go
- VaultConfig.go
- Workflow.go
- WorkflowRule.go
- WorkflowWhen.go
- main.go