forger 2.0.1 → 2.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/Gemfile.lock +8 -8
- data/README.md +12 -2
- data/lib/forger/cli.rb +1 -1
- data/lib/forger/create/info.rb +3 -3
- data/lib/forger/script/templates/cloudwatch.sh +1 -1
- data/lib/forger/script/templates/extract_forger_scripts.sh +4 -0
- data/lib/forger/scripts/cloudwatch.sh +1 -1
- data/lib/forger/scripts/cloudwatch/service/amzn.sh +2 -0
- data/lib/forger/version.rb +1 -1
- data/lib/templates/default/README.md +2 -2
- 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: 833f4ee033176e828f5a04b0fd2fce2544a335113156304db55d24c3b35f2427
|
4
|
+
data.tar.gz: e75cf80f65bead5108455185132b1a03de4ce5421349a0eb7c5bbd7c572afeba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4114553f5e2cc98fd4d7dae6409652ad03fa16cf49f9c658974b164b8146233a974359f2466cdcb9da05b776580dc8243be87557173acd31f93ba0eedacf07de
|
7
|
+
data.tar.gz: 99905c00a84d3ae79e2155044e40024d98acbd684438f7a4f4597b298810d427b385026d3c326e281a97c63f239b778ea95366c22cc33e8b798a8c5fa376025d
|
data/CHANGELOG.md
CHANGED
@@ -3,6 +3,12 @@
|
|
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
|
+
## [2.0.2]
|
7
|
+
- Merge pull request #14 from tongueroo/fixes
|
8
|
+
- allow cloudwatch support for amzn ami
|
9
|
+
- rename cloudwatch group to forger
|
10
|
+
- stop user data when there are errors
|
11
|
+
|
6
12
|
## [2.0.1]
|
7
13
|
- Merge pull request #13 from tongueroo/aws-config-fix
|
8
14
|
- configure_aws_cli: always write ~/.aws/config
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
forger (2.0.
|
4
|
+
forger (2.0.2)
|
5
5
|
activesupport
|
6
6
|
aws-sdk-ec2
|
7
7
|
aws-sdk-s3
|
@@ -22,19 +22,19 @@ GEM
|
|
22
22
|
minitest (~> 5.1)
|
23
23
|
tzinfo (~> 1.1)
|
24
24
|
aws-eventstream (1.0.1)
|
25
|
-
aws-partitions (1.
|
26
|
-
aws-sdk-core (3.
|
25
|
+
aws-partitions (1.106.0)
|
26
|
+
aws-sdk-core (3.35.0)
|
27
27
|
aws-eventstream (~> 1.0)
|
28
28
|
aws-partitions (~> 1.0)
|
29
29
|
aws-sigv4 (~> 1.0)
|
30
30
|
jmespath (~> 1.0)
|
31
|
-
aws-sdk-ec2 (1.
|
31
|
+
aws-sdk-ec2 (1.54.0)
|
32
32
|
aws-sdk-core (~> 3, >= 3.26.0)
|
33
33
|
aws-sigv4 (~> 1.0)
|
34
|
-
aws-sdk-kms (1.
|
34
|
+
aws-sdk-kms (1.11.0)
|
35
35
|
aws-sdk-core (~> 3, >= 3.26.0)
|
36
36
|
aws-sigv4 (~> 1.0)
|
37
|
-
aws-sdk-s3 (1.
|
37
|
+
aws-sdk-s3 (1.23.0)
|
38
38
|
aws-sdk-core (~> 3, >= 3.26.0)
|
39
39
|
aws-sdk-kms (~> 1)
|
40
40
|
aws-sigv4 (~> 1.0)
|
@@ -67,7 +67,7 @@ GEM
|
|
67
67
|
guard-compat (~> 1.1)
|
68
68
|
rspec (>= 2.99.0, < 4.0)
|
69
69
|
hashie (3.6.0)
|
70
|
-
i18n (1.1.
|
70
|
+
i18n (1.1.1)
|
71
71
|
concurrent-ruby (~> 1.0)
|
72
72
|
jmespath (1.4.0)
|
73
73
|
listen (3.1.5)
|
@@ -99,7 +99,7 @@ GEM
|
|
99
99
|
rspec-mocks (~> 3.8.0)
|
100
100
|
rspec-core (3.8.0)
|
101
101
|
rspec-support (~> 3.8.0)
|
102
|
-
rspec-expectations (3.8.
|
102
|
+
rspec-expectations (3.8.2)
|
103
103
|
diff-lcs (>= 1.2.0, < 2.0)
|
104
104
|
rspec-support (~> 3.8.0)
|
105
105
|
rspec-mocks (3.8.0)
|
data/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
[![CircleCI](https://circleci.com/gh/tongueroo/forger.svg?style=svg)](https://circleci.com/gh/tongueroo/forger)
|
4
4
|
|
5
|
-
Tool to create AWS
|
5
|
+
Tool to create AWS EC2 instances consistently with pre-configured settings. The pre-configured settings are stored in the profiles folder of the current project directory.
|
6
6
|
Example:
|
7
7
|
|
8
8
|
* profiles/default.yml: Default settings. Used when no profile is specified.
|
@@ -42,7 +42,7 @@ You can do a test run with the `--noop` flag. This will print out what settings
|
|
42
42
|
|
43
43
|
## Conventional Profile Name
|
44
44
|
|
45
|
-
If there is a profile name that matches the
|
45
|
+
If there is a profile name that matches the EC2 specified instance name, you can omit the `--profile` flag. Example
|
46
46
|
|
47
47
|
forger create webserver --profile webserver
|
48
48
|
forger create webserver # same as above
|
@@ -232,6 +232,16 @@ Spot instance is natively supported by the AWS `run_instances` command by adding
|
|
232
232
|
|
233
233
|
An example of a spot instance profile is provided in [example/profiles/spot.yml](docs/example/profiles/spot.yml).
|
234
234
|
|
235
|
+
## CloudWatch Support
|
236
|
+
|
237
|
+
The output of the logs like `/var/log/cloud-init-output.log` can get sent to CloudWatch. This gets enabled with the `--cloudwatch` flag. Example:
|
238
|
+
|
239
|
+
forger create myserver --cloudwatch
|
240
|
+
|
241
|
+
CloudWatch support only works for some OSes and is still somewhat experimental. Here's the OS check in the source: [lib/forger/scripts/cloudwatch.sh](https://github.com/tongueroo/forger/blob/master/lib/forger/scripts/cloudwatch.sh#L16).
|
242
|
+
|
243
|
+
Note, CloudWatch logs take a few seconds to send from the EC2 instance to CloudWatch. So when using the `--auto-terminate` option the instance might be terminated before all the logs get sent. So you might not capture all the logs. You can add a sleep 10 at the bottom of your user-data script if you think this is happening.
|
244
|
+
|
235
245
|
## More Help
|
236
246
|
|
237
247
|
forger create help
|
data/lib/forger/cli.rb
CHANGED
data/lib/forger/create/info.rb
CHANGED
@@ -72,14 +72,14 @@ class Forger::Create
|
|
72
72
|
|
73
73
|
region = cloudwatch_log_region
|
74
74
|
stream = "#{instance_id}/var/log/cloud-init-output.log"
|
75
|
-
url = "https://#{region}.console.aws.amazon.com/cloudwatch/home?region=#{region}#logEventViewer:group=
|
76
|
-
cw_init_log = "cw tail -f
|
75
|
+
url = "https://#{region}.console.aws.amazon.com/cloudwatch/home?region=#{region}#logEventViewer:group=forger;stream=#{stream}"
|
76
|
+
cw_init_log = "cw tail -f forger #{stream}"
|
77
77
|
puts "To view instance's cloudwatch logs visit:"
|
78
78
|
puts " #{url}"
|
79
79
|
|
80
80
|
puts " #{cw_init_log}" if show_cw
|
81
81
|
if show_cw && @options[:auto_terminate]
|
82
|
-
cw_terminate_log = "cw tail -f
|
82
|
+
cw_terminate_log = "cw tail -f forger #{instance_id}/var/log/auto-terminate.log"
|
83
83
|
puts " #{cw_terminate_log}"
|
84
84
|
end
|
85
85
|
|
@@ -1,5 +1,9 @@
|
|
1
1
|
#!/bin/bash -eux
|
2
2
|
|
3
|
+
# extract forger happens very early and the top of the user data script.
|
4
|
+
# Set the -e flag here to stop the script if there any errors.
|
5
|
+
set -e
|
6
|
+
|
3
7
|
# Downloads and extract the scripts.
|
4
8
|
# The extracted folder from github looks like this:
|
5
9
|
# branch-name.tar.gz => forger-branch-name
|
@@ -13,7 +13,7 @@ LOG_GROUP_NAME=$1
|
|
13
13
|
# shellcheck disable=SC1091
|
14
14
|
source "/opt/forger/shared/functions.sh"
|
15
15
|
OS=$(os_name)
|
16
|
-
if [ "$OS" != "amazonlinux2" ] && [ "$OS" != "ubuntu" ] ; then
|
16
|
+
if [ "$OS" != "amzn" ] && [ "$OS" != "amazonlinux2" ] && [ "$OS" != "ubuntu" ] ; then
|
17
17
|
echo "Sorry, cloudwatch logging with the forger tool is supported for amazonlinux2 and ubuntu only"
|
18
18
|
exit
|
19
19
|
fi
|
data/lib/forger/version.rb
CHANGED
@@ -41,8 +41,8 @@ It is useful to verify that the instance has launched and completed its bootstra
|
|
41
41
|
EC2 instance box created: i-03f3c96eaec8ea359 🎉
|
42
42
|
Visit https://console.aws.amazon.com/ec2/home to check on the status
|
43
43
|
To view instance's cloudwatch logs visit:
|
44
|
-
https://us-east-1.console.aws.amazon.com/cloudwatch/home?region=us-east-1#logEventViewer:group=
|
45
|
-
cw tail -f
|
44
|
+
https://us-east-1.console.aws.amazon.com/cloudwatch/home?region=us-east-1#logEventViewer:group=forger;stream=i-03f3c96eaec8ea359/var/log/cloud-init-output.log
|
45
|
+
cw tail -f forger i-03f3c96eaec8ea359/var/log/cloud-init-output.log
|
46
46
|
Note: It takes a little time for the instance to launch and report logs.
|
47
47
|
Pro tip: The CloudWatch Console Link has been added to your copy-and-paste clipboard.
|
48
48
|
$
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: forger
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.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: 2018-10-
|
11
|
+
date: 2018-10-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|