codebuild 0.6.1 → 0.6.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.codebuild/project.rb +0 -12
- data/CHANGELOG.md +4 -0
- data/README.md +4 -1
- data/Rakefile +1 -1
- data/docs/_docs/conventions.md +1 -1
- data/docs/_docs/deploy.md +1 -1
- data/docs/_docs/dsl/role.md +6 -0
- data/docs/_docs/start.md +1 -1
- data/docs/_includes/commands.html +5 -2
- data/docs/_includes/js.html +0 -3
- data/docs/_reference/{codebuild-completion.md → cb-completion.md} +2 -2
- data/docs/_reference/{codebuild-completion_script.md → cb-completion_script.md} +2 -2
- data/docs/_reference/{codebuild-delete.md → cb-delete.md} +2 -2
- data/docs/_reference/{codebuild-deploy.md → cb-deploy.md} +2 -2
- data/docs/_reference/{codebuild-init.md → cb-init.md} +3 -2
- data/docs/_reference/{codebuild-start.md → cb-start.md} +2 -2
- data/docs/_reference/{codebuild-version.md → cb-version.md} +2 -2
- data/docs/quick-start.md +1 -1
- data/docs/reference.md +7 -7
- data/lib/codebuild/core.rb +5 -4
- data/lib/codebuild/deploy.rb +1 -0
- data/lib/codebuild/role.rb +10 -1
- data/lib/codebuild/version.rb +1 -1
- data/spec/lib/cli_spec.rb +1 -6
- data/spec/spec_helper.rb +6 -0
- metadata +9 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7cce7e14c55b16c76ad7c5ca3fe53d49c6a0ea53e0a776796d0461ca59a06c79
|
4
|
+
data.tar.gz: c80068ba1f03a19223e75e5a99a89f75b9ecc383673dcb2a49a2e74c696224ce
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 189737112a90fcc408a49b3fbc044062f1b92e8ab89a735108e822bcbeabbd0fa95a67aba1d86e03ee69d95ab8d91dc752e7eb03c7a70160424c60be8820657d
|
7
|
+
data.tar.gz: 951a796d4c4611704b23e5771dc4b0a669ee2858c1fcd22533f5373c71d3f7bfe149bae1a76c2e14b3233fe3af74389df9320f37ce37594c01003ba579ada06e
|
data/.codebuild/project.rb
CHANGED
@@ -1,16 +1,4 @@
|
|
1
|
-
# For methods, refer to the properties of the CloudFormation CodeBuild::Project https://amzn.to/2UTeNlr
|
2
|
-
# For convenience methods, refer to the source https://github.com/tongueroo/codebuild/blob/master/lib/codebuild/dsl/project.rb
|
3
|
-
|
4
|
-
# Note: for the oauth_token, you have to set this parameter in ssm parameter store
|
5
|
-
# One way to create an GitHub oauth token:
|
6
|
-
# Go to GitHub / Settings / Developer Settings / Personal access tokens
|
7
|
-
# If using webhook, the oauth token needs admin:repo_hook
|
8
|
-
|
9
|
-
name("codebuild")
|
10
1
|
github_url("https://github.com/tongueroo/codebuild")
|
11
2
|
linux_image("aws/codebuild/ruby:2.5.3-1.7.0")
|
12
|
-
environment_variables(
|
13
|
-
JETS_ENV: "test",
|
14
|
-
)
|
15
3
|
triggers(webhook: true)
|
16
4
|
local_cache(false)
|
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.6.2]
|
7
|
+
- add s3 read-only access to default role
|
8
|
+
- fix settings
|
9
|
+
|
6
10
|
## [0.6.1]
|
7
11
|
- cb init: no variables by default
|
8
12
|
- fix handle rollback
|
data/README.md
CHANGED
@@ -1,11 +1,14 @@
|
|
1
1
|
# Codebuild
|
2
2
|
|
3
3
|
![Build Status](https://codebuild.us-west-2.amazonaws.com/badges?uuid=eyJlbmNyeXB0ZWREYXRhIjoiSUFzNE9RV3ROWmNKOHh2NG1wTjNmRlV4dnlOTnVrK3U2UFMrOEJRUGE2WS9mcjRWS0o1bjdSZlN5bG1tR1YyYVFlNkErTGdkbThsWExUaVJvWU1PRUY4PSIsIml2UGFyYW1ldGVyU3BlYyI6InppWWxJRGFiWHN1bEtYSzIiLCJtYXRlcmlhbFNldFNlcmlhbCI6MX0%3D&branch=master)
|
4
|
+
[![Gem Version](https://badge.fury.io/rb/codebuild.png)](http://badge.fury.io/rb/codebuild)
|
4
5
|
|
5
6
|
The codebuild tool provides a DSL to create a CodeBuild project with some reasonable defaults.
|
6
7
|
|
7
8
|
The codebuild tool installs `cb` and `codebuild` executables. Both of them do the same thing, `cb` is just shorter to type.
|
8
9
|
|
10
|
+
The documentation site is at: [codebuild.cloud](https://codebuild.cloud/)
|
11
|
+
|
9
12
|
## Quick Start
|
10
13
|
|
11
14
|
cb init
|
@@ -14,7 +17,7 @@ The codebuild tool installs `cb` and `codebuild` executables. Both of them do th
|
|
14
17
|
|
15
18
|
## Private Repo
|
16
19
|
|
17
|
-
IMPORTANT: Before deploying, if you are using a private repo, use [aws codebuild import-source-credentials](https://docs.aws.amazon.com/cli/latest/reference/codebuild/import-source-credentials.html) to add credentials so that codebuild can clone down the repo. Refer to [
|
20
|
+
IMPORTANT: Before deploying, if you are using a private repo, use [aws codebuild import-source-credentials](https://docs.aws.amazon.com/cli/latest/reference/codebuild/import-source-credentials.html) to add credentials so that codebuild can clone down the repo. Refer to the [CodeBuilld Github Oauth/](https://codebuild.cloud/docs/github_oauth/) for more info.
|
18
21
|
|
19
22
|
## Usage
|
20
23
|
|
data/Rakefile
CHANGED
@@ -9,5 +9,5 @@ require_relative "lib/codebuild"
|
|
9
9
|
require "cli_markdown"
|
10
10
|
desc "Generates cli reference docs as markdown"
|
11
11
|
task :docs do
|
12
|
-
CliMarkdown::Creator.create_all(cli_class: Codebuild::CLI, cli_name: "
|
12
|
+
CliMarkdown::Creator.create_all(cli_class: Codebuild::CLI, cli_name: "cb")
|
13
13
|
end
|
data/docs/_docs/conventions.md
CHANGED
@@ -28,7 +28,7 @@ The CodeBuild project is named `my-project-unit`.
|
|
28
28
|
|
29
29
|
## CB_ENV_EXTRA
|
30
30
|
|
31
|
-
The `CB_ENV_EXTRA` also affects the name of the CodeBuild project. It gets
|
31
|
+
The `CB_ENV_EXTRA` also affects the name of the CodeBuild project. It gets appended after the type option.
|
32
32
|
|
33
33
|
CB_ENV_EXTRA=2 cb deploy my-project --type unit
|
34
34
|
|
data/docs/_docs/deploy.md
CHANGED
@@ -64,6 +64,6 @@ Likewise `cb deploy PROJECT_NAME --type unit` would result in:
|
|
64
64
|
.codebuild/unit/project.rb
|
65
65
|
.codebuild/unit/role.rb
|
66
66
|
|
67
|
-
Also, for help info you can check the [cb deploy]({% link _reference/
|
67
|
+
Also, for help info you can check the [cb deploy]({% link _reference/cb-deploy.md %}) CLI reference.
|
68
68
|
|
69
69
|
{% include prev_next.md %}
|
data/docs/_docs/dsl/role.md
CHANGED
@@ -34,6 +34,12 @@ You can also create managed IAM policy.
|
|
34
34
|
managed_iam_policy("AmazonS3ReadOnlyAccess")
|
35
35
|
```
|
36
36
|
|
37
|
+
You can also add multiple managed IAM policies:
|
38
|
+
|
39
|
+
```ruby
|
40
|
+
managed_iam_policy("AmazonS3ReadOnlyAccess", "AmazonEC2ReadOnlyAccess")
|
41
|
+
```
|
42
|
+
|
37
43
|
## Full DSL
|
38
44
|
|
39
45
|
The convenience methods merely wrap properties of the [AWS::IAM::Role
|
data/docs/_docs/start.md
CHANGED
@@ -41,6 +41,6 @@ Remember the environment variables are within the CodeBuild environment instance
|
|
41
41
|
|
42
42
|
## CLI Reference
|
43
43
|
|
44
|
-
Also, for help info you can check the [cb start]({% link _reference/
|
44
|
+
Also, for help info you can check the [cb start]({% link _reference/cb-start.md %}) CLI reference.
|
45
45
|
|
46
46
|
{% include prev_next.md %}
|
@@ -38,11 +38,14 @@ cb delete
|
|
38
38
|
<h3>Usage</h3>
|
39
39
|
<div class="commands">
|
40
40
|
{% highlight sh %}
|
41
|
-
cb deploy # infers the
|
41
|
+
cb deploy # infers the project name from the parent folder
|
42
42
|
cb deploy project-name # explicitly specify project name
|
43
43
|
|
44
|
-
cb start # infers the name from the parent folder
|
44
|
+
cb start # infers the project name from the parent folder
|
45
45
|
cb start demo-project # looks up project via CodeBuild project name
|
46
|
+
|
47
|
+
cb deploy demo --type unit # different codebuild project types
|
48
|
+
cb start demo --type unit
|
46
49
|
{% endhighlight %}
|
47
50
|
</div>
|
48
51
|
</div>
|
data/docs/_includes/js.html
CHANGED
@@ -13,6 +13,3 @@
|
|
13
13
|
{% if site.google_analytics and jekyll.environment == "production" %}
|
14
14
|
{% include google_analytics.html %}
|
15
15
|
{% endif %}
|
16
|
-
|
17
|
-
<div id="codefund"><!-- fallback content --></div>
|
18
|
-
<script src="https://codefund.app/properties/177/funder.js" async="async"></script>
|
@@ -1,11 +1,11 @@
|
|
1
1
|
---
|
2
|
-
title:
|
2
|
+
title: cb init
|
3
3
|
reference: true
|
4
4
|
---
|
5
5
|
|
6
6
|
## Usage
|
7
7
|
|
8
|
-
|
8
|
+
cb init
|
9
9
|
|
10
10
|
## Description
|
11
11
|
|
@@ -81,6 +81,7 @@ If you would like to use a local template that is not on GitHub, then created a
|
|
81
81
|
[--template=TEMPLATE] # Custom template to use
|
82
82
|
[--template-mode=TEMPLATE_MODE] # Template mode: replace or additive
|
83
83
|
[--type=TYPE] # Type option creates a subfolder under .codebuild
|
84
|
+
[--variables], [--no-variables] # Create variables starter files
|
84
85
|
[--verbose], [--no-verbose]
|
85
86
|
[--noop], [--no-noop]
|
86
87
|
```
|
data/docs/quick-start.md
CHANGED
@@ -12,7 +12,7 @@ In a hurry? No problem! Here's a quick start to get going.
|
|
12
12
|
cb init # generates starter .codebuild files
|
13
13
|
# edit .codebuild/buildspec.yml
|
14
14
|
cb deploy # create the CodeBuild project via CloudFormation
|
15
|
-
cb start # start a CodeBuild project. Runs the buildspec.
|
15
|
+
cb start # start a CodeBuild project. Runs the buildspec.yml
|
16
16
|
|
17
17
|
## What Happened?
|
18
18
|
|
data/docs/reference.md
CHANGED
@@ -3,10 +3,10 @@ title: CLI Reference
|
|
3
3
|
---
|
4
4
|
{% include reference.md %}
|
5
5
|
|
6
|
-
* [
|
7
|
-
* [
|
8
|
-
* [
|
9
|
-
* [
|
10
|
-
* [
|
11
|
-
* [
|
12
|
-
* [
|
6
|
+
* [cb completion]({% link _reference/cb-completion.md %})
|
7
|
+
* [cb completion_script]({% link _reference/cb-completion_script.md %})
|
8
|
+
* [cb delete]({% link _reference/cb-delete.md %})
|
9
|
+
* [cb deploy]({% link _reference/cb-deploy.md %})
|
10
|
+
* [cb init]({% link _reference/cb-init.md %})
|
11
|
+
* [cb start]({% link _reference/cb-start.md %})
|
12
|
+
* [cb version]({% link _reference/cb-version.md %})
|
data/lib/codebuild/core.rb
CHANGED
@@ -32,10 +32,11 @@ module Codebuild
|
|
32
32
|
return if ENV['TEST']
|
33
33
|
return unless File.exist?("#{Codebuild.root}/.codebuild/settings.yml") # for rake docs
|
34
34
|
return unless settings # Only load if within Codebuild project and there's a settings.yml
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
35
|
+
|
36
|
+
data = settings || {}
|
37
|
+
if data[:aws_profile]
|
38
|
+
puts "Using AWS_PROFILE=#{data[:aws_profile]} from CB_ENV=#{Codebuild.env} in config/settings.yml"
|
39
|
+
ENV['AWS_PROFILE'] = data[:aws_profile]
|
39
40
|
end
|
40
41
|
end
|
41
42
|
|
data/lib/codebuild/deploy.rb
CHANGED
data/lib/codebuild/role.rb
CHANGED
@@ -24,7 +24,11 @@ module Codebuild
|
|
24
24
|
}
|
25
25
|
}]
|
26
26
|
|
27
|
-
|
27
|
+
if @managed_policy_arns && !@managed_policy_arns.empty?
|
28
|
+
@properties[:managed_policy_arns] = @managed_policy_arns
|
29
|
+
else
|
30
|
+
@properties[:managed_policy_arns] = default_managed_policy_arns
|
31
|
+
end
|
28
32
|
|
29
33
|
resource = {
|
30
34
|
IamRole: {
|
@@ -74,5 +78,10 @@ module Codebuild
|
|
74
78
|
resource: "*"
|
75
79
|
}]
|
76
80
|
end
|
81
|
+
|
82
|
+
def default_managed_policy_arns
|
83
|
+
# Useful when using with CodePipeline
|
84
|
+
["arn:aws:iam::aws:policy/AmazonS3ReadOnlyAccess"]
|
85
|
+
end
|
77
86
|
end
|
78
87
|
end
|
data/lib/codebuild/version.rb
CHANGED
data/spec/lib/cli_spec.rb
CHANGED
@@ -1,12 +1,7 @@
|
|
1
1
|
describe Codebuild::CLI do
|
2
2
|
before(:all) do
|
3
3
|
@args = "--noop"
|
4
|
-
@
|
5
|
-
Dir.chdir("spec/fixtures/app")
|
6
|
-
@codebuild_bin = "../../../exe/codebuild"
|
7
|
-
end
|
8
|
-
after(:all) do
|
9
|
-
Dir.chdir(@old_root)
|
4
|
+
@codebuild_bin = "exe/codebuild"
|
10
5
|
end
|
11
6
|
|
12
7
|
describe "codebuild" do
|
data/spec/spec_helper.rb
CHANGED
@@ -4,6 +4,12 @@ ENV["TEST"] = "1"
|
|
4
4
|
# require 'simplecov'
|
5
5
|
# SimpleCov.start
|
6
6
|
|
7
|
+
# Ensures aws api never called. Fixture home folder does not contain ~/.aws/credentails
|
8
|
+
ENV['HOME'] = File.join(Dir.pwd,'spec/fixtures/home')
|
9
|
+
|
10
|
+
ENV['CB_ROOT'] = "spec/fixtures/app"
|
11
|
+
|
12
|
+
|
7
13
|
require "pp"
|
8
14
|
require "byebug"
|
9
15
|
root = File.expand_path("../", File.dirname(__FILE__))
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: codebuild
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.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: 2019-07-
|
11
|
+
date: 2019-07-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -267,13 +267,13 @@ files:
|
|
267
267
|
- docs/_includes/subnav.html
|
268
268
|
- docs/_includes/tutorials.md
|
269
269
|
- docs/_layouts/default.html
|
270
|
-
- docs/_reference/
|
271
|
-
- docs/_reference/
|
272
|
-
- docs/_reference/
|
273
|
-
- docs/_reference/
|
274
|
-
- docs/_reference/
|
275
|
-
- docs/_reference/
|
276
|
-
- docs/_reference/
|
270
|
+
- docs/_reference/cb-completion.md
|
271
|
+
- docs/_reference/cb-completion_script.md
|
272
|
+
- docs/_reference/cb-delete.md
|
273
|
+
- docs/_reference/cb-deploy.md
|
274
|
+
- docs/_reference/cb-init.md
|
275
|
+
- docs/_reference/cb-start.md
|
276
|
+
- docs/_reference/cb-version.md
|
277
277
|
- docs/_sass/_bootstrap-overrides.scss
|
278
278
|
- docs/_sass/_contact.scss
|
279
279
|
- docs/_sass/_cta.scss
|