forger 2.0.0 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 40903820dcf27929a6a4772f175612f8ef7090cfba6335134c181609397e2d46
4
- data.tar.gz: 7f25db5d64cb8fd19acfe6f420fb4cfb9122395f8628d3bd39de14552e8daa46
3
+ metadata.gz: b57dbd9ed6cebe6d22408d9eedc61c2a4f0398ee4d37f806f293a91344c2caf6
4
+ data.tar.gz: f5a6ac3e67e166cd1a12e4abb10b0080b4912ae51fb41d170de9cd76690d5e0e
5
5
  SHA512:
6
- metadata.gz: 4ca21504ea5bd44e8f290cb857f81bac99c0d2dfb84486f5bff456916c8f9f12b4292052ba2b99afafe134ce57222263f2332733ecfb7970b6e75df4ce590753
7
- data.tar.gz: f3d5fb6bb654c89d50f2ec2510c119f3ae5a1b6b46a4923cf066ed248806236d30200795d8f8013be8b4c56abc2035e097990c2da83794cb14d4e93495e13f3b
6
+ metadata.gz: a8f11584373cedf9d2c8f20c05219d9094c65b081669210b045a55ce4ef87cde4b575e10dce7ef34670ab3fd16b0f8859dd3be8fced63189233c5a22b6a8359f
7
+ data.tar.gz: 3c99722189cf579ff8f2b943bf17f0d5fd543242d6a2e5e9b13ddda807986b5ca47e684dbb0b5481781b7f802de959b03e1d7497575b1b4792d137a7baac3421
data/CHANGELOG.md CHANGED
@@ -3,6 +3,11 @@
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.1]
7
+ - Merge pull request #13 from tongueroo/aws-config-fix
8
+ - configure_aws_cli: always write ~/.aws/config
9
+ - fix s3 folder path when at top level of bucket
10
+
6
11
  ## [2.0.0]
7
12
  - Merge pull request #11 and #12 from tongueroo/new:
8
13
  - forger new: creates a starter project that works right off the bat
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- forger (2.0.0)
4
+ forger (2.0.1)
5
5
  activesupport
6
6
  aws-sdk-ec2
7
7
  aws-sdk-s3
@@ -88,7 +88,8 @@ class Forger::Script
88
88
  # bucket_name: ec2/development/scripts
89
89
  def dest_folder
90
90
  folder = s3_folder.sub('s3://','').split('/')[1..-1].join('/')
91
- "#{folder}/#{Forger.env}/scripts"
91
+ folder = nil if folder == ''
92
+ [folder, "#{Forger.env}/scripts"].compact.join('/')
92
93
  end
93
94
 
94
95
  # s3_folder example:
@@ -12,15 +12,13 @@ function configure_aws_cli() {
12
12
  home_dir=${1:-/root} # default to /root
13
13
  # Configure aws cli in case it is not yet configured
14
14
  mkdir -p "$home_dir/.aws"
15
- if [ ! -f "$home_dir/.aws/config" ]; then
16
- EC2_AVAIL_ZONE=$(curl -s http://169.254.169.254/latest/meta-data/placement/availability-zone)
17
- EC2_REGION=${EC2_AVAIL_ZONE::-1}
18
- cat >"$home_dir/.aws/config" <<CONFIGURE_AWS_CLI
15
+ EC2_AVAIL_ZONE=$(curl -s http://169.254.169.254/latest/meta-data/placement/availability-zone)
16
+ EC2_REGION=${EC2_AVAIL_ZONE::-1}
17
+ cat >"$home_dir/.aws/config" <<CONFIGURE_AWS_CLI
19
18
  [default]
20
19
  region = $EC2_REGION
21
20
  output = json
22
21
  CONFIGURE_AWS_CLI
23
- fi
24
22
  }
25
23
 
26
24
  function setup() {
@@ -5,15 +5,13 @@ function configure_aws_cli() {
5
5
  home_dir=${1:-/root} # default to /root
6
6
  # Configure aws cli in case it is not yet configured
7
7
  mkdir -p "$home_dir/.aws"
8
- if [ ! -f "$home_dir/.aws/config" ]; then
9
- EC2_AVAIL_ZONE=$(curl -s http://169.254.169.254/latest/meta-data/placement/availability-zone)
10
- EC2_REGION=${EC2_AVAIL_ZONE::-1}
11
- cat >"$home_dir/.aws/config" <<CONFIGURE_AWS_CLI
8
+ EC2_AVAIL_ZONE=$(curl -s http://169.254.169.254/latest/meta-data/placement/availability-zone)
9
+ EC2_REGION=${EC2_AVAIL_ZONE::-1}
10
+ cat >"$home_dir/.aws/config" <<CONFIGURE_AWS_CLI
12
11
  [default]
13
12
  region = $EC2_REGION
14
13
  output = json
15
14
  CONFIGURE_AWS_CLI
16
- fi
17
15
  }
18
16
 
19
17
  # Normalize os name so we can delegate out to os specific scripts.
@@ -1,3 +1,3 @@
1
1
  module Forger
2
- VERSION = "2.0.0"
2
+ VERSION = "2.0.1"
3
3
  end
@@ -10,13 +10,11 @@ function configure_aws_cli() {
10
10
  local home_dir=$1
11
11
  # Configure aws cli in case it is not yet configured
12
12
  mkdir -p "$home_dir/.aws"
13
- if [ ! -f "$home_dir/.aws/config" ]; then
14
- EC2_AVAIL_ZONE=$(curl -s http://169.254.169.254/latest/meta-data/placement/availability-zone)
15
- EC2_REGION=${EC2_AVAIL_ZONE::-1}
16
- cat >"$home_dir/.aws/config" <<CONFIGURE_AWS_CLI
13
+ EC2_AVAIL_ZONE=$(curl -s http://169.254.169.254/latest/meta-data/placement/availability-zone)
14
+ EC2_REGION=${EC2_AVAIL_ZONE::-1}
15
+ cat >"$home_dir/.aws/config" <<CONFIGURE_AWS_CLI
17
16
  [default]
18
17
  region = $EC2_REGION
19
18
  output = json
20
19
  CONFIGURE_AWS_CLI
21
- fi
22
20
  }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: forger
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tung Nguyen