full360-sequencer 0.2.6 → 0.3.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: e39df18990fb5fdf6924e3e4b60b373f1400db68d6125be7a24b56b3401950f5
4
- data.tar.gz: 400f3182c16e5f32dfa88883c0717f7ddecc88c1e8aec993a19abbdb2f5e613d
3
+ metadata.gz: 6b306d37c59d71853d6163ceb7ee5536d760891d403a9306f81ecbfb83cb6400
4
+ data.tar.gz: 93dc22959e26473187909b980c706218807f5ed07ac5e00d28877517155785c0
5
5
  SHA512:
6
- metadata.gz: 75181267e1df232193818cff99384d6ac2262f3b6059afdf71d1f445ab0b09d869ead4aed3882545a30b8242c0c7091661bbc301bc24410efc9a5d3e57e37459
7
- data.tar.gz: a78938906d4c9c7cbf650a32f3932000c57349d00490b3779ba55fea428060f6ef3809f265d40ae81f26e75b4209a5032c75d58910007a6b34cfa5d8446a1271
6
+ metadata.gz: 8829c54bb964f3de9361cb58ea6eb23451f5c2ac8f91a81f180f2a957a7ab576f89273409ec1ac615e56ca1aeec2d2cf9e096657a1b82cb50f37258cfeb64d26
7
+ data.tar.gz: 45d0bf6df5196b24a71af673932187d9908888dd5993682a4481631ca906cadef0bfd8141f28696145f49a3516d78826fc311ba7f172835769b93f4c3d18f7d4
@@ -59,8 +59,8 @@ jobs:
59
59
  pull: true
60
60
  push: true
61
61
  tags: |
62
- full360/sequencer:jruby-latest
63
- full360/sequencer:${{ steps.tag.outputs.VERSION }}-jruby-latest
62
+ full360/sequencer:latest-jruby
63
+ full360/sequencer:${{ steps.tag.outputs.VERSION }}-jruby
64
64
 
65
65
  docker-ruby:
66
66
  runs-on: ubuntu-latest
@@ -90,5 +90,5 @@ jobs:
90
90
  pull: true
91
91
  push: true
92
92
  tags: |
93
- full360/sequencer:ruby-latest
94
- full360/sequencer:${{ steps.tag.outputs.VERSION }}-ruby-latest
93
+ full360/sequencer:latest-ruby
94
+ full360/sequencer:${{ steps.tag.outputs.VERSION }}-ruby
data/CHANGELOG.md CHANGED
@@ -10,6 +10,33 @@ Versioning](http://semver.org/spec/v2.0.0.html).
10
10
  ### Changed
11
11
  ### Removed
12
12
 
13
+ ## 0.3.1
14
+ ### Added
15
+ ### Changed
16
+ - Make the S3 URL matcher work with all types of prefixes.
17
+ ### Removed
18
+
19
+ ## 0.3.0
20
+ ### Added
21
+ - AWS SDK for S3 as a dependency.
22
+ ### Changed
23
+ - Downloading the sequencer file is now done using Ruby.
24
+ - Reading the YAML file is not required anymore by the process.
25
+ ### Removed
26
+ - Remove the aws-cli as a dependency of the Docker image.
27
+
28
+ ## 0.2.8
29
+ ### Added
30
+ ### Changed
31
+ - Rename the sequencer file in entrypoint to `sequencer.yml`
32
+ ### Removed
33
+
34
+ ## 0.2.7
35
+ ### Added
36
+ ### Changed
37
+ - Normalize the Docker image tags to `latest-jruby/ruby` and `vX.X.X-jruby/ruby`
38
+ ### Removed
39
+
13
40
  ## 0.2.6
14
41
  ### Added
15
42
  ### 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,22 +1,30 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- full360-sequencer (0.2.6)
4
+ full360-sequencer (0.3.1)
5
5
  aws-sdk-ecs (~> 1.85)
6
+ aws-sdk-s3 (~> 1.103)
6
7
 
7
8
  GEM
8
9
  remote: https://rubygems.org/
9
10
  specs:
10
11
  aws-eventstream (1.2.0)
11
- aws-partitions (1.510.0)
12
+ aws-partitions (1.516.0)
12
13
  aws-sdk-core (3.121.1)
13
14
  aws-eventstream (~> 1, >= 1.0.2)
14
15
  aws-partitions (~> 1, >= 1.239.0)
15
16
  aws-sigv4 (~> 1.1)
16
17
  jmespath (~> 1.0)
17
- aws-sdk-ecs (1.85.0)
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)
@@ -49,4 +57,4 @@ DEPENDENCIES
49
57
  rake (~> 12)
50
58
 
51
59
  BUNDLED WITH
52
- 2.2.28
60
+ 2.2.29
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 = /\As3:\/\/(?<bucket>.+?)\/(?<prefix>.+)\z/.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,10 +1,3 @@
1
1
  #!/usr/bin/env bash
2
2
 
3
- if [ -n "$AWS_REGION" ]
4
- then
5
- aws s3 cp $SEQUENCER_YAML_S3_PATH /sequencer/file.yml --region $AWS_REGION
6
- else
7
- aws s3 cp $SEQUENCER_YAML_S3_PATH /sequencer/file.yml
8
- fi
9
-
10
- sequencer /sequencer/file.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.6".freeze
3
+ VERSION = "0.3.1".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.6
4
+ version: 0.3.1
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