full360-sequencer 0.2.8 → 0.3.0

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: '0751439634c3eb90969792aa6e1dfef7360e8061ff28dcdf7ebdcf59cb55de11'
4
- data.tar.gz: 49047f35cb4f59c24e9a33bd83f6e91e4f5121ff5ce41441628d8b17cbea204b
3
+ metadata.gz: 9b5bd0d4c3e623279fd6da75822326d24a0f210984d9a6b0aff31e29d7f88f99
4
+ data.tar.gz: 26ac9248facc2b3d33b3e700895d5cb5fc4ea59c50dc8558cc2087da66d3673d
5
5
  SHA512:
6
- metadata.gz: 6aee44845f06ccaaa7d833ae4055c51cb2b73dbf7b0018cc3a794118395280155797c4903e41e6c96e71d328b92de393315e0f441142b537a67933488498ee52
7
- data.tar.gz: 39e91085902b1123ea0d2311637c092cc50d8e68a951f59d341b3665091b660a4ad66c4dfa7e18c3f0796825f45281cdf8ba60e8c98609e9aed534f5f6db269b
6
+ metadata.gz: b19ad0f701731ef33cb163934c693538b0b5e13642e3656e5dd74f1f282174144bf2418d1297d65dcc5de02e6a8f50299641054d9990244a819f1d2b124dc757
7
+ data.tar.gz: ecd6da502c840fded29e4a9e1170dfe5aeae5f39fbfcc0e6f4ab4ed3f648167518ad176687b01dea6a8e145a5501d183a6166540d6901f693299546c6e75f69f
data/CHANGELOG.md CHANGED
@@ -10,6 +10,15 @@ Versioning](http://semver.org/spec/v2.0.0.html).
10
10
  ### Changed
11
11
  ### Removed
12
12
 
13
+ ## 0.3.0
14
+ ### Added
15
+ - AWS SDK for S3 as a dependency.
16
+ ### Changed
17
+ - Downloading the sequencer file is now done using Ruby.
18
+ - Reading the YAML file is not required anymore by the process.
19
+ ### Removed
20
+ - Remove the aws-cli as a dependency of the Docker image.
21
+
13
22
  ## 0.2.8
14
23
  ### Added
15
24
  ### Changed
data/Dockerfile.jruby CHANGED
@@ -8,7 +8,6 @@ RUN apt-get update \
8
8
  && apt-get install -y --no-install-recommends \
9
9
  unzip \
10
10
  ca-certificates \
11
- awscli \
12
11
  && update-ca-certificates \
13
12
  && rm -rf /var/lib/apt/lists/*
14
13
 
data/Dockerfile.ruby CHANGED
@@ -5,10 +5,7 @@ RUN apk add --no-cache \
5
5
  unzip \
6
6
  ca-certificates \
7
7
  bash \
8
- wget \
9
- curl \
10
- aws-cli \
11
- && update-ca-certificates \
8
+ && update-ca-certificates
12
9
 
13
10
  #set time zone
14
11
  RUN mv /etc/localtime /etc/localtime.bak ; ln -s /usr/share/zoneinfo/UTC /etc/localtime
data/Gemfile.lock CHANGED
@@ -1,8 +1,9 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- full360-sequencer (0.2.8)
4
+ full360-sequencer (0.3.0)
5
5
  aws-sdk-ecs (~> 1.85)
6
+ aws-sdk-s3 (~> 1.103)
6
7
 
7
8
  GEM
8
9
  remote: https://rubygems.org/
@@ -17,6 +18,13 @@ GEM
17
18
  aws-sdk-ecs (1.86.0)
18
19
  aws-sdk-core (~> 3, >= 3.120.0)
19
20
  aws-sigv4 (~> 1.1)
21
+ aws-sdk-kms (1.49.0)
22
+ aws-sdk-core (~> 3, >= 3.120.0)
23
+ aws-sigv4 (~> 1.1)
24
+ aws-sdk-s3 (1.103.0)
25
+ aws-sdk-core (~> 3, >= 3.120.0)
26
+ aws-sdk-kms (~> 1)
27
+ aws-sigv4 (~> 1.4)
20
28
  aws-sigv4 (1.4.0)
21
29
  aws-eventstream (~> 1, >= 1.0.2)
22
30
  coderay (1.1.3)
data/bin/sequencer CHANGED
@@ -19,6 +19,15 @@ def sequencer_version
19
19
  end
20
20
 
21
21
  begin
22
+ region = ENV.fetch("AWS_REGION", "us-east-1")
23
+ s3_str = ENV.fetch("SEQUENCER_YAML_S3_PATH", "s3://dummy/prefix")
24
+
25
+ # Will split the path into two groups one for the bucket and one for the
26
+ # prefix and we will use this later on when we download the file.
27
+ matches = /^s3:\/\/(?<bucket>.*)\/(?<prefix>.*)$/.match(s3_str)
28
+
29
+ s3_client = Aws::S3::Client.new(region: region)
30
+
22
31
  logger.info("sequencer version #{sequencer_version}")
23
32
  logger.level = ENV["SEQUENCER_LOG_DEBUG"] ? Logger::DEBUG : Logger::INFO
24
33
 
@@ -28,8 +37,13 @@ begin
28
37
  else
29
38
  sleep_between_checks = ENV.fetch("SEQUENCER_SLEEP_BETWEEN_CHECKS", 5).to_i
30
39
 
40
+ logger.info("downloading from S3: #{matches["bucket"]}/#{matches["prefix"]}")
41
+ resp = s3_client.get_object(bucket: matches["bucket"], key: matches["prefix"])
42
+
43
+ logger.info("file last modified on: #{resp.last_modified}")
44
+
31
45
  Full360::Sequencer::Runner.new(sleep_between_checks, logger).tap do |runner|
32
- runner.config_from_file(config_file)
46
+ runner.config_from_file(resp.body.read)
33
47
  runner.run
34
48
  end
35
49
  end
data/entrypoint.sh CHANGED
@@ -1,9 +1,3 @@
1
1
  #!/usr/bin/env bash
2
2
 
3
- if [ -n "$AWS_REGION" ]; then
4
- aws s3 cp $SEQUENCER_YAML_S3_PATH sequencer.yml --region $AWS_REGION
5
- else
6
- aws s3 cp $SEQUENCER_YAML_S3_PATH sequencer.yml
7
- fi
8
-
9
- sequencer sequencer.yml
3
+ sequencer $SEQUENCER_YAML_S3_PATH
@@ -26,6 +26,7 @@ Gem::Specification.new do |spec|
26
26
  spec.required_ruby_version = ">= 2.0"
27
27
 
28
28
  spec.add_runtime_dependency "aws-sdk-ecs", "~> 1.85"
29
+ spec.add_runtime_dependency "aws-sdk-s3", "~> 1.103"
29
30
 
30
31
  # development dependencies
31
32
  spec.add_development_dependency "minitest", "~> 5.9"
@@ -72,7 +72,7 @@ module Full360
72
72
  # @params yaml_path [String]
73
73
  # @return [Array]
74
74
  def parse_config_file(yaml_path)
75
- YAML.safe_load(File.read(yaml_path), symbolize_names: true)
75
+ YAML.safe_load(yaml_path, symbolize_names: true)
76
76
  end
77
77
  end
78
78
  end
@@ -1,5 +1,5 @@
1
1
  module Full360
2
2
  module Sequencer
3
- VERSION = "0.2.8".freeze
3
+ VERSION = "0.3.0".freeze
4
4
  end
5
5
  end
@@ -1,4 +1,5 @@
1
1
  require "logger"
2
+ require "aws-sdk-s3"
2
3
 
3
4
  # Autoload all gem classes
4
5
  module Full360
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: full360-sequencer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.8
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Full 360 Group
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.85'
27
+ - !ruby/object:Gem::Dependency
28
+ name: aws-sdk-s3
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.103'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.103'
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: minitest
29
43
  requirement: !ruby/object:Gem::Requirement