Class: Cody::Project
- Includes:
- Dsl::Project, Evaluate, Variables
- Defined in:
- lib/cody/project.rb
Constant Summary
Constants included from Dsl::Project
Instance Attribute Summary collapse
-
#project_path ⇒ Object
readonly
Returns the value of attribute project_path.
Attributes inherited from Dsl::Base
#full_project_name, #options, #project_name, #type
Instance Method Summary collapse
- #build_spec ⇒ Object
- #default_properties ⇒ Object
- #exist? ⇒ Boolean
- #get_project_path ⇒ Object
-
#initialize(options = {}) ⇒ Project
constructor
A new instance of Project.
- #run ⇒ Object
Methods included from Variables
#load_variables, #load_variables_file
Methods included from Evaluate
Methods included from Evaluate::Interface
#full_project_name, #project_name
Methods included from Dsl::Project
#buildspec, #environment_variables, #git_branch, #git_provider, #github_source, #github_token, #github_url, #linux_environment, #linux_image, #local_cache, #type
Methods included from Dsl::Project::Ssm
Methods inherited from Dsl::Base
Constructor Details
#initialize(options = {}) ⇒ Project
Returns a new instance of Project.
10 11 12 13 |
# File 'lib/cody/project.rb', line 10 def initialize(={}) super @project_path = [:project_path] || get_project_path end |
Instance Attribute Details
#project_path ⇒ Object (readonly)
Returns the value of attribute project_path.
9 10 11 |
# File 'lib/cody/project.rb', line 9 def project_path @project_path end |
Instance Method Details
#build_spec ⇒ Object
64 65 66 |
# File 'lib/cody/project.rb', line 64 def build_spec lookup_cody_file("buildspec.yml") end |
#default_properties ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/cody/project.rb', line 31 def default_properties { Name: @full_project_name, Description: @full_project_name, Artifacts: { Type: "NO_ARTIFACTS" }, ServiceRole: { Ref: "IamRole" }, BadgeEnabled: true, TimeoutInMinutes: 20, LogsConfig: { CloudWatchLogs: { Status: "ENABLED", # the default log group name is thankfully the project name } }, Source: { Type: "GITHUB", # location: "", # required # GitCloneDepth: 1, GitSubmodulesConfig: { FetchSubmodules: true }, BuildSpec: build_spec, # auth doesnt seem to work, refer to https://github.com/tongueroo/cody/blob/master/readme/GithubOauth.md # Auth: { # Type: "OAUTH", # # Resource: "", # required # }, } } end |
#exist? ⇒ Boolean
15 16 17 |
# File 'lib/cody/project.rb', line 15 def exist? File.exist?(@project_path) end |
#get_project_path ⇒ Object
60 61 62 |
# File 'lib/cody/project.rb', line 60 def get_project_path lookup_cody_file("project.rb") end |
#run ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/cody/project.rb', line 19 def run load_variables evaluate_file(@project_path) resource = { CodeBuild: { Type: "AWS::CodeBuild::Project", Properties: @properties } } auto_camelize(resource) end |