cody 0.9.5 → 0.9.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/cody/dsl/base.rb +11 -0
- data/lib/cody/list/no_builds_project.rb +9 -0
- data/lib/cody/list/project.rb +2 -1
- data/lib/cody/project.rb +3 -6
- data/lib/cody/role.rb +2 -3
- data/lib/cody/schedule.rb +2 -3
- data/lib/cody/version.rb +1 -1
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3ced92e5c3ceacd71102a3f6501a0436ff14f4af9fbcaaa13bd29980a107e47e
|
4
|
+
data.tar.gz: e2a1d2624728f7d57f5fd825e2c6c7b91489119b072a5c4e7b3e439044c058e8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7b586e1cca3f2d5a84982ce3db857037d6cbafdfad5389be350e4aeab31e07ca8aab13dbc78977dd75bcf604da18fffa9a410dde6922f65df42c20c77b1567af
|
7
|
+
data.tar.gz: cea281d6d71645ba05ca0de2c410b75205d2434362b813b0ca2dc82b97c28f70817e0f4088751b72d2a01f9427153e4f5f687f721d0d148fd7d5ec2464f99fc3
|
data/CHANGELOG.md
CHANGED
@@ -3,6 +3,10 @@
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
This project *tries* to adhere to [Semantic Versioning](http://semver.org/), even before v1.0.
|
5
5
|
|
6
|
+
## [0.9.6]
|
7
|
+
- #24 refactor: add dsl base class so `project_name` method is available to all dsl classes
|
8
|
+
- cody list: fix for projects with no builds yet
|
9
|
+
|
6
10
|
## [0.9.5]
|
7
11
|
- write info messsage to stderr so we can pipe to jq
|
8
12
|
|
@@ -0,0 +1,11 @@
|
|
1
|
+
module Cody::Dsl
|
2
|
+
class Base
|
3
|
+
attr_reader :project_name, :full_project_name
|
4
|
+
def initialize(options={})
|
5
|
+
@options = options
|
6
|
+
@project_name = options[:project_name]
|
7
|
+
@full_project_name = options[:full_project_name] # includes -development at the end
|
8
|
+
@properties = default_properties # defaults make project.rb simpler
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,9 @@
|
|
1
|
+
# Represents a project with no builds yet. In this case we just return an info message for the columns.
|
2
|
+
# This allows `cody list` to work without breaking for Fresh projects with zero builds.
|
3
|
+
class Cody::List
|
4
|
+
class NoBuildsProject
|
5
|
+
def method_missing(meth, *args, &block)
|
6
|
+
"no builds"
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
data/lib/cody/list/project.rb
CHANGED
@@ -12,8 +12,9 @@ class Cody::List
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def build
|
15
|
+
return NoBuildsProject.new unless build_id # most recent build
|
15
16
|
resp = codebuild.batch_get_builds(ids: [build_id])
|
16
|
-
resp.builds.first
|
17
|
+
resp.builds.first
|
17
18
|
end
|
18
19
|
memoize :build
|
19
20
|
alias_method :load, :build # interface to eager load
|
data/lib/cody/project.rb
CHANGED
@@ -1,18 +1,15 @@
|
|
1
1
|
require "yaml"
|
2
2
|
|
3
3
|
module Cody
|
4
|
-
class Project
|
4
|
+
class Project < Dsl::Base
|
5
5
|
include Dsl::Project
|
6
6
|
include Evaluate
|
7
7
|
include Variables
|
8
8
|
|
9
|
-
attr_reader :
|
9
|
+
attr_reader :project_path
|
10
10
|
def initialize(options={})
|
11
|
-
|
12
|
-
@project_name = options[:project_name]
|
13
|
-
@full_project_name = options[:full_project_name] # includes -development at the end
|
11
|
+
super
|
14
12
|
@project_path = options[:project_path] || get_project_path
|
15
|
-
@properties = default_properties # defaults make project.rb simpler
|
16
13
|
end
|
17
14
|
|
18
15
|
def exist?
|
data/lib/cody/role.rb
CHANGED
@@ -1,15 +1,14 @@
|
|
1
1
|
require "yaml"
|
2
2
|
|
3
3
|
module Cody
|
4
|
-
class Role
|
4
|
+
class Role < Dsl::Base
|
5
5
|
include Cody::Dsl::Role
|
6
6
|
include Evaluate
|
7
7
|
include Variables
|
8
8
|
|
9
9
|
def initialize(options={})
|
10
|
-
|
10
|
+
super
|
11
11
|
@role_path = options[:role_path] || get_role_path
|
12
|
-
@properties = default_properties
|
13
12
|
@iam_policy = {}
|
14
13
|
end
|
15
14
|
|
data/lib/cody/schedule.rb
CHANGED
@@ -1,13 +1,12 @@
|
|
1
1
|
module Cody
|
2
|
-
class Schedule
|
2
|
+
class Schedule < Dsl::Base
|
3
3
|
include Cody::Dsl::Schedule
|
4
4
|
include Evaluate
|
5
5
|
include Variables
|
6
6
|
|
7
7
|
def initialize(options={})
|
8
|
-
|
8
|
+
super
|
9
9
|
@schedule_path = options[:schedule_path] || get_schedule_path
|
10
|
-
@properties = default_properties
|
11
10
|
@iam_policy = {}
|
12
11
|
end
|
13
12
|
|
data/lib/cody/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cody
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tung Nguyen
|
@@ -288,6 +288,7 @@ files:
|
|
288
288
|
- lib/cody/default/settings.yml
|
289
289
|
- lib/cody/delete.rb
|
290
290
|
- lib/cody/deploy.rb
|
291
|
+
- lib/cody/dsl/base.rb
|
291
292
|
- lib/cody/dsl/project.rb
|
292
293
|
- lib/cody/dsl/project/ssm.rb
|
293
294
|
- lib/cody/dsl/role.rb
|
@@ -304,6 +305,7 @@ files:
|
|
304
305
|
- lib/cody/help/stop.md
|
305
306
|
- lib/cody/init.rb
|
306
307
|
- lib/cody/list.rb
|
308
|
+
- lib/cody/list/no_builds_project.rb
|
307
309
|
- lib/cody/list/project.rb
|
308
310
|
- lib/cody/logs.rb
|
309
311
|
- lib/cody/project.rb
|