lex-tasker 0.2.0 → 0.2.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: 8086ae496d1e741099cd0f91cd01cfaa91820518d3a93e00262ae04eeea471a5
4
- data.tar.gz: 219a9d573a6e17923f01b2528fb91c1235dc1e62cf7b2dcdf9624dd99abc8d75
3
+ metadata.gz: 629167fdc22f492d3458b37b1414c66c1f89d61ba843d787126901a36653fc42
4
+ data.tar.gz: 8962a825f8fe27b0abd990b12d94e540fba3103bce7fb73a3dd0190a5701610d
5
5
  SHA512:
6
- metadata.gz: c7c51a2a36129f803d34b2b7aaecc43c06bdd619fabd8dd8ee37b0cf9a38a1ff68b8c0983efd3b742e22332bfc05afdb8507a04c7a62f0500ec22fb621e9ba6e
7
- data.tar.gz: 7a98de6ea1d7b663992457e2c61df4a46c984ac41af4f30218404ea3798ecd0da3b8a880a86128637bb36105f971bc09a5c577934e1a7b2de633edefcb1ad14e
6
+ metadata.gz: 55dbbe3d90fa1e06a04321cc36d9f18d44266112dff7956e0e5a46513d350486a65b4000f210b7822c540efc71b5dd2bc1c737160265f48e0316fb983ab60e6a
7
+ data.tar.gz: e2ddca1cf4926788cecc1d6a6b3953d0bbf718d6aeaa2be442f51d6e7e222c0614e78fbdaa402b5f0d5716af5b5f09759cf5cb9a315d7b539d95c122510549b2
data/Dockerfile ADDED
@@ -0,0 +1,9 @@
1
+ FROM legionio/legion:latest
2
+ LABEL maintainer="Matthew Iverson <matthewdiverson@gmail.com>"
3
+
4
+ RUN mkdir /etc/legionio
5
+ RUN apk update && apk add build-base tzdata postgresql-dev mysql-client mariadb-dev tzdata gcc git
6
+
7
+ COPY . ./
8
+ RUN gem install lex-tasker legion-data --no-document --no-prerelease
9
+ CMD ruby $(which legionio)
@@ -3,67 +3,17 @@ image: ruby:2.7
3
3
  pipelines:
4
4
  tags:
5
5
  "v*":
6
- - step:
7
- name: Rubocop
8
- caches:
9
- - bundler
10
- script:
11
- - gem install rubocop
12
- - gem update rubocop
13
- - rubocop
14
- - step:
15
- name: RSpec
16
- caches:
17
- - bundler
18
- script:
19
- - gem install bundler
20
- - gem update bundler
21
- - bundle update
22
- - bundle exec rspec
23
6
  - step:
24
7
  name: Push to RubyGems
25
8
  deployment: RubyGems
26
9
  script:
27
- - gem install bundler gem-release rspec
28
- - bundle install
10
+ - gem install gem-release
29
11
  - (umask 077 ; echo $gem_creds | base64 --decode > ~/.gem/credentials)
30
12
  - gem release
31
13
  artifacts:
32
14
  - pkg/**
33
- branches:
34
- master:
35
- - step:
36
- caches:
37
- - bundler
38
- script:
39
- - gem install rubocop
40
- - gem update rubocop
41
- - rubocop
42
15
  - step:
43
- caches:
44
- - bundler
16
+ name: Push to Docker
17
+ deployment: Docker
45
18
  script:
46
- - gem install bundler
47
- - gem update bundler
48
- - bundle update
49
- - bundle exec rspec
50
- develop:
51
- - step:
52
- caches:
53
- - bundler
54
- script:
55
- - gem install rubocop
56
- - gem update rubocop
57
- - rubocop
58
- - step:
59
- caches:
60
- - bundler
61
- script:
62
- - gem install bundler
63
- - gem update bundler
64
- - bundle update
65
- - bundle exec rspec
66
-
67
- definitions:
68
- caches:
69
- bundler: /usr/local/bundle
19
+ - './docker_deploy.rb'
data/docker_deploy.rb ADDED
@@ -0,0 +1,13 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ name = 'tasker'
4
+ require "./lib/legion/extensions/#{name}/version"
5
+ version = Legion::Extensions::Tasker::VERSION
6
+
7
+ puts "Building docker image for Legion v#{version}"
8
+ system("docker build --tag legionio/lex-#{name}:v#{version} .")
9
+ puts 'Pushing to hub.docker.com'
10
+ system("docker push legionio/lex-#{name}:v#{version}")
11
+ system("docker tag legionio/lex-#{name}:v#{version} legionio/lex-#{name}:latest")
12
+ system("docker push legionio/lex-#{name}:latest")
13
+ puts 'completed'
@@ -32,7 +32,7 @@ module Legion
32
32
  LEFT JOIN legion.relationships ON (relationships.id = tasks.relationship_id)
33
33
  WHERE status = \'task.delayed\';'
34
34
 
35
- Legion::Data::Connection.sequel.fetch(sql)
35
+ Legion::Data::Connection.sequel.fetch(sql).all
36
36
  end
37
37
 
38
38
  def find_subtasks(trigger_id:, **)
@@ -55,8 +55,8 @@ module Legion
55
55
  cache = Legion::Cache.get(sql)
56
56
  return cache unless cache.nil?
57
57
 
58
- results = Legion::Data::Connection.sequel.fetch(sql)
59
- Legion::Cache.set(sql, results, ttl: 5) if results.is_a?(Hash) && results.count.positive?
58
+ results = Legion::Data::Connection.sequel.fetch(sql).all
59
+ Legion::Cache.set(sql, results, 5) if results.is_a?(Array) && results.count.positive?
60
60
  results
61
61
  end
62
62
  end
@@ -38,8 +38,8 @@ module Legion
38
38
  cache = Legion::Cache.get(sql)
39
39
  return cache unless cache.nil?
40
40
 
41
- results = Legion::Data::Connection.sequel.fetch(sql)
42
- Legion::Cache.set(sql, results, ttl: 5) if results.is_a?(Hash) && results.count.positive?
41
+ results = Legion::Data::Connection.sequel.fetch(sql).all
42
+ Legion::Cache.set(sql, results, 5) if results.is_a?(Array) && results.count.positive?
43
43
  results
44
44
  end
45
45
  end
@@ -1,7 +1,7 @@
1
1
  module Legion
2
2
  module Extensions
3
3
  module Tasker
4
- VERSION = '0.2.0'.freeze
4
+ VERSION = '0.2.1'.freeze
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lex-tasker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Esity
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-11-02 00:00:00.000000000 Z
11
+ date: 2021-03-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -105,14 +105,14 @@ files:
105
105
  - ".gitignore"
106
106
  - ".rspec"
107
107
  - ".rubocop.yml"
108
+ - Dockerfile
108
109
  - Gemfile
109
110
  - Gemfile.lock
110
111
  - LICENSE.txt
111
112
  - README.md
112
113
  - Rakefile
113
- - bin/console
114
- - bin/setup
115
114
  - bitbucket-pipelines.yml
115
+ - docker_deploy.rb
116
116
  - lex-tasker.gemspec
117
117
  - lib/legion/extensions/tasker.rb
118
118
  - lib/legion/extensions/tasker/actors/check_subtask.rb
data/bin/console DELETED
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require 'bundler/setup'
4
- require 'legion/extensions/tasker'
5
-
6
- # You can add fixtures and/or initialization code here to make experimenting
7
- # with your gem easier. You can also use a different console, if you like.
8
-
9
- # (If you use this, don't forget to add pry to your Gemfile!)
10
- # require "pry"
11
- # Pry.start
12
-
13
- require 'irb'
14
- IRB.start(__FILE__)
data/bin/setup DELETED
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
- set -vx
5
-
6
- bundle install
7
-
8
- # Do any other automated setup that you need to do here