s3_config 0.1.5 → 0.1.6

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
  SHA1:
3
- metadata.gz: d0e4ad90e419d5cf05163b520fc1029e7854b666
4
- data.tar.gz: 9ea7fb4c6f2a7d26340bf190c307849f4bbd2d4c
3
+ metadata.gz: 65f58b167424cf5abb0cfa852427a47f81b0b919
4
+ data.tar.gz: e93ebfd953aa21da62caa1e227a70aaec5603704
5
5
  SHA512:
6
- metadata.gz: c60f43e73455edc25a661ebf6307a94e9a36c943db3dc813ac13e4d4897be475f12e731bc17bc018ff148246c22b9f10e9d76cceba2eda349868117004576d9d
7
- data.tar.gz: 90a9aab9f6dd6c1b9a74fa61582224ef6bdef6847abd33ef1cc89ccedff61a1f3338f4678cad8262590a86f8085f18c48b617999e004e154cbe26fefaae1c68b
6
+ metadata.gz: 169c046c5b0758cfe512c6a4f2da9f9ae95cf122410e6692590964f5287a1772d5e8cb3e85fa89a88f8fd3c4e3e76cca5fe622f133b96606feb61dd53660c508
7
+ data.tar.gz: db7838c94204d2c53e3df4868c1e1da085705d9a6a90a84ab1f49b9d305c98b5dc12772aa21dc7db2688621285b62d0c8c6f34604ea3c64c8b60ca4e6b7fcbce
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.3.1
1
+ 2.3.3
@@ -0,0 +1,39 @@
1
+ #!/bin/bash
2
+
3
+ # Check that the environment variable has been set correctly
4
+ if [ -z "$SECRETS_BUCKET_NAME" ]; then
5
+ echo >&2 'error: missing SECRETS_BUCKET_NAME environment variable'
6
+ exit 1
7
+ fi
8
+ if [ -z "$SECRETS_ENVIRONMENT" ]; then
9
+ echo >&2 'error: missing SECRETS_ENVIRONMENT environment variable'
10
+ exit 1
11
+ fi
12
+ if [ -z "$SECRETS_VERSION" ]; then
13
+ echo >&2 'error: missing SECRETS_VERSION environment variable'
14
+ exit 1
15
+ fi
16
+
17
+ # Load the S3 secrets file contents into the environment variables
18
+ function load_config {
19
+ local prefix=""
20
+ local s='[[:space:]]*' w='[a-zA-Z0-9_]*' fs=$(echo @|tr @ '\034')
21
+ aws s3 cp s3://${SECRETS_BUCKET_NAME}/${SECRETS_ENVIRONMENT}/${SECRETS_VERSION}.yml - |
22
+ sed -ne "s|^\($s\):|\1|" \
23
+ -e "s|^\($s\)\($w\)$s:$s[\"']\(.*\)[\"']$s\$|\1$fs\2$fs\3|p" \
24
+ -e "s|^\($s\)\($w\)$s:$s\(.*\)$s\$|\1$fs\2$fs\3|p" |
25
+ awk -F$fs '{
26
+ indent = length($1)/2;
27
+ vname[indent] = $2;
28
+ for (i in vname) {if (i > indent) {delete vname[i]}}
29
+ if (length($3) > 0) {
30
+ vn=""; for (i=0; i<indent; i++) {vn=(vn)(vname[i])("_")}
31
+ printf("%s%s%s=\"%s\"\n", "'$prefix'",vn, $2, $3);
32
+ }
33
+ }' |
34
+ sed 's/^/export /'
35
+ }
36
+ eval $(load_config)
37
+
38
+ # Run the entrypoint
39
+ eval "$@"
@@ -1,3 +1,3 @@
1
1
  module S3Config
2
- VERSION = "0.1.5"
2
+ VERSION = "0.1.6"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: s3_config
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zane Shannon
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-04-13 00:00:00.000000000 Z
11
+ date: 2017-04-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk
@@ -105,6 +105,7 @@ files:
105
105
  - exe/config
106
106
  - lib/s3_config.rb
107
107
  - lib/s3_config/application.rb
108
+ - lib/s3_config/bash/s3_config_wrapper.sh
108
109
  - lib/s3_config/cli.rb
109
110
  - lib/s3_config/env.rb
110
111
  - lib/s3_config/error.rb
@@ -133,7 +134,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
133
134
  version: '0'
134
135
  requirements: []
135
136
  rubyforge_project:
136
- rubygems_version: 2.5.1
137
+ rubygems_version: 2.6.11
137
138
  signing_key:
138
139
  specification_version: 4
139
140
  summary: S3Config uses AWS S3 to configure a Rails application.