s3_config 0.1.5 → 0.1.6
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 +4 -4
- data/.ruby-version +1 -1
- data/lib/s3_config/bash/s3_config_wrapper.sh +39 -0
- data/lib/s3_config/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 65f58b167424cf5abb0cfa852427a47f81b0b919
|
4
|
+
data.tar.gz: e93ebfd953aa21da62caa1e227a70aaec5603704
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 169c046c5b0758cfe512c6a4f2da9f9ae95cf122410e6692590964f5287a1772d5e8cb3e85fa89a88f8fd3c4e3e76cca5fe622f133b96606feb61dd53660c508
|
7
|
+
data.tar.gz: db7838c94204d2c53e3df4868c1e1da085705d9a6a90a84ab1f49b9d305c98b5dc12772aa21dc7db2688621285b62d0c8c6f34604ea3c64c8b60ca4e6b7fcbce
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.3.
|
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 "$@"
|
data/lib/s3_config/version.rb
CHANGED
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.
|
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-
|
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.
|
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.
|