Class: AWSCDK::CodeBuild::CfnProject::SourceProperty
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::CodeBuild::CfnProject::SourceProperty
- Defined in:
- code_build/cfn_project.rb
Overview
Source is a property of the AWS::CodeBuild::Project resource that specifies the source code settings for the project, such as the source code's repository type and location.
Instance Attribute Summary collapse
-
#auth ⇒ AWSCDK::IResolvable, ...
readonly
Information about the authorization settings for AWS CodeBuild to access the source code to be built.
-
#build_spec ⇒ String?
readonly
The build specification for the project.
-
#build_status_config ⇒ AWSCDK::IResolvable, ...
readonly
Contains information that defines how the build project reports the build status to the source provider.
-
#git_clone_depth ⇒ Numeric?
readonly
The depth of history to download.
-
#git_submodules_config ⇒ AWSCDK::IResolvable, ...
readonly
Information about the Git submodules configuration for the build project.
-
#insecure_ssl ⇒ Boolean, ...
readonly
This is used with GitHub Enterprise only.
-
#location ⇒ String?
readonly
Information about the location of the source code to be built.
-
#report_build_status ⇒ Boolean, ...
readonly
Set to true to report the status of a build's start and finish to your source provider.
-
#source_identifier ⇒ String?
readonly
An identifier for this project source.
-
#type ⇒ String
readonly
The type of repository that contains the source code to be built.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(type:, auth: nil, build_spec: nil, build_status_config: nil, git_clone_depth: nil, git_submodules_config: nil, insecure_ssl: nil, location: nil, report_build_status: nil, source_identifier: nil) ⇒ SourceProperty
constructor
A new instance of SourceProperty.
- #to_jsii ⇒ Object
Constructor Details
#initialize(type:, auth: nil, build_spec: nil, build_status_config: nil, git_clone_depth: nil, git_submodules_config: nil, insecure_ssl: nil, location: nil, report_build_status: nil, source_identifier: nil) ⇒ SourceProperty
Returns a new instance of SourceProperty.
2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 |
# File 'code_build/cfn_project.rb', line 2236 def initialize(type:, auth: nil, build_spec: nil, build_status_config: nil, git_clone_depth: nil, git_submodules_config: nil, insecure_ssl: nil, location: nil, report_build_status: nil, source_identifier: nil) @type = type Jsii::Type.check_type(@type, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "type") @auth = auth.is_a?(Hash) ? ::AWSCDK::CodeBuild::CfnProject::SourceAuthProperty.new(**auth.transform_keys(&:to_sym)) : auth Jsii::Type.check_type(@auth, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19jb2RlYnVpbGQuQ2ZuUHJvamVjdC5Tb3VyY2VBdXRoUHJvcGVydHkifV19fQ==")), "auth") unless @auth.nil? @build_spec = build_spec Jsii::Type.check_type(@build_spec, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "buildSpec") unless @build_spec.nil? @build_status_config = build_status_config.is_a?(Hash) ? ::AWSCDK::CodeBuild::CfnProject::BuildStatusConfigProperty.new(**build_status_config.transform_keys(&:to_sym)) : build_status_config Jsii::Type.check_type(@build_status_config, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19jb2RlYnVpbGQuQ2ZuUHJvamVjdC5CdWlsZFN0YXR1c0NvbmZpZ1Byb3BlcnR5In1dfX0=")), "buildStatusConfig") unless @build_status_config.nil? @git_clone_depth = git_clone_depth Jsii::Type.check_type(@git_clone_depth, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "gitCloneDepth") unless @git_clone_depth.nil? @git_submodules_config = git_submodules_config.is_a?(Hash) ? ::AWSCDK::CodeBuild::CfnProject::GitSubmodulesConfigProperty.new(**git_submodules_config.transform_keys(&:to_sym)) : git_submodules_config Jsii::Type.check_type(@git_submodules_config, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19jb2RlYnVpbGQuQ2ZuUHJvamVjdC5HaXRTdWJtb2R1bGVzQ29uZmlnUHJvcGVydHkifV19fQ==")), "gitSubmodulesConfig") unless @git_submodules_config.nil? @insecure_ssl = insecure_ssl Jsii::Type.check_type(@insecure_ssl, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "insecureSsl") unless @insecure_ssl.nil? @location = location Jsii::Type.check_type(@location, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "location") unless @location.nil? @report_build_status = report_build_status Jsii::Type.check_type(@report_build_status, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "reportBuildStatus") unless @report_build_status.nil? @source_identifier = source_identifier Jsii::Type.check_type(@source_identifier, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "sourceIdentifier") unless @source_identifier.nil? end |
Instance Attribute Details
#auth ⇒ AWSCDK::IResolvable, ... (readonly)
Information about the authorization settings for AWS CodeBuild to access the source code to be built.
2278 2279 2280 |
# File 'code_build/cfn_project.rb', line 2278 def auth @auth end |
#build_spec ⇒ String? (readonly)
The build specification for the project.
If this value is not provided, then the source code must contain a buildspec file named buildspec.yml at the root level. If this value is provided, it can be either a single string containing the entire build specification, or the path to an alternate buildspec file relative to the value of the built-in environment variable CODEBUILD_SRC_DIR . The alternate buildspec file can have a name other than buildspec.yml , for example myspec.yml or build_spec_qa.yml or similar. For more information, see the Build Spec Reference in the AWS CodeBuild User Guide .
2285 2286 2287 |
# File 'code_build/cfn_project.rb', line 2285 def build_spec @build_spec end |
#build_status_config ⇒ AWSCDK::IResolvable, ... (readonly)
Contains information that defines how the build project reports the build status to the source provider.
This option is only used when the source provider is GITHUB , GITHUB_ENTERPRISE , or BITBUCKET .
2292 2293 2294 |
# File 'code_build/cfn_project.rb', line 2292 def build_status_config @build_status_config end |
#git_clone_depth ⇒ Numeric? (readonly)
The depth of history to download.
Minimum value is 0. If this value is 0, greater than 25, or not provided, then the full history is downloaded with each build project. If your source type is Amazon S3, this value is not supported.
2299 2300 2301 |
# File 'code_build/cfn_project.rb', line 2299 def git_clone_depth @git_clone_depth end |
#git_submodules_config ⇒ AWSCDK::IResolvable, ... (readonly)
Information about the Git submodules configuration for the build project.
2304 2305 2306 |
# File 'code_build/cfn_project.rb', line 2304 def git_submodules_config @git_submodules_config end |
#insecure_ssl ⇒ Boolean, ... (readonly)
This is used with GitHub Enterprise only.
Set to true to ignore SSL warnings while connecting to your GitHub Enterprise project repository. The default value is false . InsecureSsl should be used for testing purposes only. It should not be used in a production environment.
2311 2312 2313 |
# File 'code_build/cfn_project.rb', line 2311 def insecure_ssl @insecure_ssl end |
#location ⇒ String? (readonly)
Information about the location of the source code to be built. Valid values include:.
- For source code settings that are specified in the source action of a pipeline in CodePipeline,
locationshould not be specified. If it is specified, CodePipeline ignores it. This is because CodePipeline uses the settings in a pipeline's source action instead of this value. - For source code in an CodeCommit repository, the HTTPS clone URL to the repository that contains the source code and the buildspec file (for example,
https://git-codecommit.<region-ID>.amazonaws.com/v1/repos/<repo-name>). - For source code in an Amazon S3 input bucket, one of the following.
- The path to the ZIP file that contains the source code (for example,
<bucket-name>/<path>/<object-name>.zip). - The path to the folder that contains the source code (for example,
<bucket-name>/<path-to-source-code>/<folder>/). - For source code in a GitHub repository, the HTTPS clone URL to the repository that contains the source and the buildspec file. You must connect your AWS account to your GitHub account. Use the AWS CodeBuild console to start creating a build project. When you use the console to connect (or reconnect) with GitHub, on the GitHub Authorize application page, for Organization access , choose Request access next to each repository you want to allow AWS CodeBuild to have access to, and then choose Authorize application . (After you have connected to your GitHub account, you do not need to finish creating the build project. You can leave the AWS CodeBuild console.) To instruct AWS CodeBuild to use this connection, in the
sourceobject, set theauthobject'stypevalue toOAUTH. - For source code in an GitLab or self-managed GitLab repository, the HTTPS clone URL to the repository that contains the source and the buildspec file. You must connect your AWS account to your GitLab account. Use the AWS CodeBuild console to start creating a build project. When you use the console to connect (or reconnect) with GitLab, on the Connections Authorize application page, choose Authorize . Then on the AWS CodeConnections Create GitLab connection page, choose Connect to GitLab . (After you have connected to your GitLab account, you do not need to finish creating the build project. You can leave the AWS CodeBuild console.) To instruct AWS CodeBuild to override the default connection and use this connection instead, set the
authobject'stypevalue toCODECONNECTIONSin thesourceobject. - For source code in a Bitbucket repository, the HTTPS clone URL to the repository that contains the source and the buildspec file. You must connect your AWS account to your Bitbucket account. Use the AWS CodeBuild console to start creating a build project. When you use the console to connect (or reconnect) with Bitbucket, on the Bitbucket Confirm access to your account page, choose Grant access . (After you have connected to your Bitbucket account, you do not need to finish creating the build project. You can leave the AWS CodeBuild console.) To instruct AWS CodeBuild to use this connection, in the
sourceobject, set theauthobject'stypevalue toOAUTH.
If you specify CODEPIPELINE for the Type property, don't specify this property. For all of the other types, you must specify Location .
2327 2328 2329 |
# File 'code_build/cfn_project.rb', line 2327 def location @location end |
#report_build_status ⇒ Boolean, ... (readonly)
Set to true to report the status of a build's start and finish to your source provider.
This option is valid only when your source provider is GitHub, GitHub Enterprise, GitLab, GitLab Self Managed, or Bitbucket. If this is set and you use a different source provider, an invalid_input_exception is thrown.
2334 2335 2336 |
# File 'code_build/cfn_project.rb', line 2334 def report_build_status @report_build_status end |
#source_identifier ⇒ String? (readonly)
An identifier for this project source.
The identifier can only contain alphanumeric characters and underscores, and must be less than 128 characters in length.
2341 2342 2343 |
# File 'code_build/cfn_project.rb', line 2341 def source_identifier @source_identifier end |
#type ⇒ String (readonly)
The type of repository that contains the source code to be built. Valid values include:.
BITBUCKET: The source code is in a Bitbucket repository.CODECOMMIT: The source code is in an CodeCommit repository.CODEPIPELINE: The source code settings are specified in the source action of a pipeline in CodePipeline.GITHUB: The source code is in a GitHub repository.GITHUB_ENTERPRISE: The source code is in a GitHub Enterprise Server repository.GITLAB: The source code is in a GitLab repository.GITLAB_SELF_MANAGED: The source code is in a self-managed GitLab repository.NO_SOURCE: The project does not have input source code.S3: The source code is in an Amazon S3 bucket.
2273 2274 2275 |
# File 'code_build/cfn_project.rb', line 2273 def type @type end |
Class Method Details
.jsii_properties ⇒ Object
2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 |
# File 'code_build/cfn_project.rb', line 2343 def self.jsii_properties { :type => "type", :auth => "auth", :build_spec => "buildSpec", :build_status_config => "buildStatusConfig", :git_clone_depth => "gitCloneDepth", :git_submodules_config => "gitSubmodulesConfig", :insecure_ssl => "insecureSsl", :location => "location", :report_build_status => "reportBuildStatus", :source_identifier => "sourceIdentifier", } end |
Instance Method Details
#to_jsii ⇒ Object
2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 |
# File 'code_build/cfn_project.rb', line 2358 def to_jsii result = {} result.merge!({ "type" => @type, "auth" => @auth, "buildSpec" => @build_spec, "buildStatusConfig" => @build_status_config, "gitCloneDepth" => @git_clone_depth, "gitSubmodulesConfig" => @git_submodules_config, "insecureSsl" => @insecure_ssl, "location" => @location, "reportBuildStatus" => @report_build_status, "sourceIdentifier" => @source_identifier, }) result.compact end |