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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c33c7d8b82a21bfdaff82551c9351590b9e8f26c009d24120436b85fe69fc13f
4
- data.tar.gz: 64e5b4431823546a8e2a28c2dc2c353afa6dd69d77381fe7ca70c030eca06afe
3
+ metadata.gz: 613a51a376f19128f7d1ecb1d421eb677a7c55897d9bb160e64295ce9da49698
4
+ data.tar.gz: dfdbaa2b3a541dcc0c2d1b854e7e3caaa37f8d4acd3319727919755c80594679
5
5
  SHA512:
6
- metadata.gz: 5d0065a9719bcdf3bc974b396f910fee82abdef353cf4ce429a330ac78fd22f51d1a36bf231bf403260080c1302d7d538fb92f0081377ee9bd8d348aef7cd4d1
7
- data.tar.gz: 7a6a80028e6f4d321045d057951957eb31fb8d7050d7a4c53f9a73d096a5017ec68b24d975b36bc207eeb0564b8b44834d2eb7a19cfae5834ad733d772f69b9f
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/ruby:2.5.3-1.7.0")
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
@@ -67,7 +67,7 @@ module Cody::Dsl
67
67
  end
68
68
 
69
69
  def linux_environment(options={})
70
- image = options[:image] || "aws/codebuild/ruby:2.5.3-1.7.0"
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=/ruby:/)
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/ruby:2.5.3-1.7.0
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 || "aws/codebuild/ruby:2.5.3-1.7.0"
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
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Cody
2
- VERSION = "0.9.1"
2
+ VERSION = "0.9.2"
3
3
  end
@@ -3,6 +3,9 @@
3
3
  version: 0.2
4
4
 
5
5
  phases:
6
+ install:
7
+ runtime-versions:
8
+ ruby: 2.6
6
9
  build:
7
10
  commands:
8
11
  - uptime
@@ -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(/ruby:/) %>")
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.1
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-16 00:00:00.000000000 Z
11
+ date: 2020-02-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport