cody 0.9.1 → 0.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/README.md +1 -1
- data/lib/cody/dsl/project.rb +1 -1
- data/lib/cody/init.rb +15 -3
- data/lib/cody/list/project.rb +3 -0
- data/lib/cody/version.rb +1 -1
- data/lib/template/project/buildspec.yml +3 -0
- data/lib/template/project/project.rb.tt +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 613a51a376f19128f7d1ecb1d421eb677a7c55897d9bb160e64295ce9da49698
|
4
|
+
data.tar.gz: dfdbaa2b3a541dcc0c2d1b854e7e3caaa37f8d4acd3319727919755c80594679
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: adcc42d7053cd3627fdcf69fb47d6ac249e1bf8fd913c0b6a7adcfead2664e87e6f4482abc3cc363f3b769b6672256c2c3121fc7954313148deeaa445494b632
|
7
|
+
data.tar.gz: 34bb3767de9f1af046ee1d5f41a03a7269c168490c2a13ae54729c70028977a3a2bef2af83a7a72d9cb5c95fc2d81e855ec316406f984b4d7b70cb7bdad73501
|
data/CHANGELOG.md
CHANGED
@@ -3,6 +3,9 @@
|
|
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.2]
|
7
|
+
- #21 update to amazonlinux2-x86_64-standard:2.0 image
|
8
|
+
|
6
9
|
## [0.9.1]
|
7
10
|
- list command improvement: show status also
|
8
11
|
|
data/README.md
CHANGED
@@ -87,7 +87,7 @@ The tool provides a DSL to create a codebuild project. Here's an example.
|
|
87
87
|
```ruby
|
88
88
|
# name("demo") # recommended to leave unset and use the conventional name that cody sets
|
89
89
|
github_url("https://github.com/tongueroo/demo-ufo")
|
90
|
-
linux_image("aws/codebuild/
|
90
|
+
linux_image("aws/codebuild/amazonlinux2-x86_64-standard:2.0")
|
91
91
|
environment_variables(
|
92
92
|
UFO_ENV: "development",
|
93
93
|
API_KEY: "ssm:/codebuild/demo/api_key" # ssm param example
|
data/lib/cody/dsl/project.rb
CHANGED
@@ -67,7 +67,7 @@ module Cody::Dsl
|
|
67
67
|
end
|
68
68
|
|
69
69
|
def linux_environment(options={})
|
70
|
-
image = options[:image] || "aws/codebuild/
|
70
|
+
image = options[:image] || "aws/codebuild/amazonlinux2-x86_64-standard:2.0"
|
71
71
|
env = {
|
72
72
|
compute_type: options[:compute_type] || "BUILD_GENERAL1_SMALL",
|
73
73
|
image_pull_credentials_type: "CODEBUILD", # https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-environment.html#cfn-codebuild-project-environment-imagepullcredentialstype
|
data/lib/cody/init.rb
CHANGED
@@ -77,7 +77,7 @@ module Cody
|
|
77
77
|
url == '' ? default : url
|
78
78
|
end
|
79
79
|
|
80
|
-
def lookup_managed_image(pattern=/
|
80
|
+
def lookup_managed_image(pattern=/amazonlinux2-x86_64-standard/)
|
81
81
|
resp = codebuild.list_curated_environment_images
|
82
82
|
|
83
83
|
# Helpful for debugging:
|
@@ -92,9 +92,21 @@ module Cody
|
|
92
92
|
end
|
93
93
|
end
|
94
94
|
versions = versions.select { |v| v =~ pattern }
|
95
|
-
# IE: aws/codebuild/
|
95
|
+
# IE: aws/codebuild/amazonlinux2-x86_64-standard:2.0
|
96
96
|
# Falls back to hard-coded image name since the API changed and looks like it's returning no ruby images
|
97
|
-
versions.sort.last
|
97
|
+
latest_version = versions.sort.last
|
98
|
+
if latest_version
|
99
|
+
# Drop the "date part"
|
100
|
+
# aws/codebuild/amazonlinux2-x86_64-standard:2.0-19.11.26 ->
|
101
|
+
# aws/codebuild/amazonlinux2-x86_64-standard:2.0 ->
|
102
|
+
latest_version.split('-')[0..-2].join('-')
|
103
|
+
else
|
104
|
+
fallback_image
|
105
|
+
end
|
106
|
+
end
|
107
|
+
|
108
|
+
def fallback_image
|
109
|
+
"aws/codebuild/amazonlinux2-x86_64-standard:2.0"
|
98
110
|
end
|
99
111
|
end
|
100
112
|
end
|
data/lib/cody/list/project.rb
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
class Cody::List
|
3
3
|
class Project
|
4
4
|
include Cody::AwsServices
|
5
|
+
extend Memoist
|
5
6
|
|
6
7
|
attr_reader :name
|
7
8
|
def initialize(name)
|
@@ -13,10 +14,12 @@ class Cody::List
|
|
13
14
|
build = resp.builds.first
|
14
15
|
build.build_status
|
15
16
|
end
|
17
|
+
memoize :status
|
16
18
|
|
17
19
|
def build_id
|
18
20
|
resp = codebuild.list_builds_for_project(project_name: @name)
|
19
21
|
resp.ids.first # most recent build_id
|
20
22
|
end
|
23
|
+
memoize :build_id
|
21
24
|
end
|
22
25
|
end
|
data/lib/cody/version.rb
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
|
4
4
|
# name("example-project-name") # recommend leaving unset and codebuild will use a conventional name
|
5
5
|
github_url("<%= project_github_url %>")
|
6
|
-
linux_image("<%= lookup_managed_image(/
|
6
|
+
linux_image("<%= lookup_managed_image(/amazonlinux2-x86_64-standard/) %>")
|
7
7
|
environment_variables(
|
8
8
|
JETS_ENV: "test",
|
9
9
|
# API_KEY: "ssm:/codebuild/demo/api_key" # Example of ssm parameter
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
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.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tung Nguyen
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-02-
|
11
|
+
date: 2020-02-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|