full360-sequencer 0.2.5 → 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: 2847dd62aff2e2cd5540fd3abc9fdcf0b1087bb0e38c9adaeb501b04c4bddc8e
4
- data.tar.gz: c0a54bc734e1e3c44aa2c3543e6a171839346c75b9e881028bd28580585f7c06
3
+ metadata.gz: 9b5bd0d4c3e623279fd6da75822326d24a0f210984d9a6b0aff31e29d7f88f99
4
+ data.tar.gz: 26ac9248facc2b3d33b3e700895d5cb5fc4ea59c50dc8558cc2087da66d3673d
5
5
  SHA512:
6
- metadata.gz: f912e6cab2f0bed981e8a11d7fd9add676a1956c40fa6333b628f2ee24ad3e2ddb5e125a78ea0d22520841e39e76fc6c8d0b411e1510b998a04a2f99855a903b
7
- data.tar.gz: e86a6e8eccc6296ddd7d58db583e4f9434c1fd8f82ff5f47011ccaa3412ebc9317b06e887c82ed53324bac4df82d9e33eb033a989a74aca1ccd54c49328d87fb
6
+ metadata.gz: b19ad0f701731ef33cb163934c693538b0b5e13642e3656e5dd74f1f282174144bf2418d1297d65dcc5de02e6a8f50299641054d9990244a819f1d2b124dc757
7
+ data.tar.gz: ecd6da502c840fded29e4a9e1170dfe5aeae5f39fbfcc0e6f4ab4ed3f648167518ad176687b01dea6a8e145a5501d183a6166540d6901f693299546c6e75f69f
@@ -50,9 +50,7 @@ jobs:
50
50
 
51
51
  - name: Extract tag name
52
52
  id: tag
53
- uses: actions/github-script@0.2.0
54
- with:
55
- script: return context.payload.ref.replace(/\/refs\/tags\//, '')
53
+ run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
56
54
 
57
55
  - name: Build JRuby image
58
56
  uses: docker/build-push-action@v2
@@ -61,8 +59,8 @@ jobs:
61
59
  pull: true
62
60
  push: true
63
61
  tags: |
64
- full360/sequencer:jruby-latest
65
- full360/sequencer:${{ steps.tag.outputs.result }}-jruby-latest
62
+ full360/sequencer:latest-jruby
63
+ full360/sequencer:${{ steps.tag.outputs.VERSION }}-jruby
66
64
 
67
65
  docker-ruby:
68
66
  runs-on: ubuntu-latest
@@ -83,9 +81,7 @@ jobs:
83
81
 
84
82
  - name: Extract tag name
85
83
  id: tag
86
- uses: actions/github-script@0.2.0
87
- with:
88
- script: return context.payload.ref.replace(/\/refs\/tags\//, '')
84
+ run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
89
85
 
90
86
  - name: Build Ruby image
91
87
  uses: docker/build-push-action@v2
@@ -94,5 +90,5 @@ jobs:
94
90
  pull: true
95
91
  push: true
96
92
  tags: |
97
- full360/sequencer:ruby-latest
98
- full360/sequencer:${{ steps.tag.outputs.result }}-ruby-latest
93
+ full360/sequencer:latest-jruby
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.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
+
22
+ ## 0.2.8
23
+ ### Added
24
+ ### Changed
25
+ - Rename the sequencer file in entrypoint to `sequencer.yml`
26
+ ### Removed
27
+
28
+ ## 0.2.7
29
+ ### Added
30
+ ### Changed
31
+ - Normalize the Docker image tags to `latest-jruby/ruby` and `vX.X.X-jruby/ruby`
32
+ ### Removed
33
+
34
+ ## 0.2.6
35
+ ### Added
36
+ ### Changed
37
+ ### Removed
38
+ - Remove the `github-script` action.
39
+
13
40
  ## 0.2.5
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.5)
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/
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)
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,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.5".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.5
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