djin 0.11.4 → 0.11.5

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: 20d3e4379f1a66394b34708a76c8c362b4ce996bea8fba4a449856260533c288
4
- data.tar.gz: e6d6713bc9a6a81f7bdc34ae56a75fc962a6c0c76719747c044e9557f8ff6f42
3
+ metadata.gz: 98bdfb8fd785c550c478fc40887e41c1b60cea1c5fa7348661a4d8042053a76c
4
+ data.tar.gz: 375b1702c5056a567495108549bf7c8eb6dbe554a6c175a823b142b30a83739a
5
5
  SHA512:
6
- metadata.gz: 2e809bb84de4f96ad4054e07020460502b6fded297074356d2255b649298986c06881f1719946e7fd3731bccf6d6f23cb2b6c0597a9255a629837028e9866eb1
7
- data.tar.gz: ddb2334bfa660b5114bf8dd5eb83c3aebcedd32087bf880f616e5630e6259c34ad2e9c264cc0c8e2ce04fd9d3b05ad5d89b89c212059cc71ce40007837a47838
6
+ metadata.gz: 25e1ebd2bbba35409ccd291b9c8a3ca0335e6f7a8f923c2a2c4865c957134e1dcc856346be0474ea701976d673970a688d440d7bfc756b1d6370ee1154907fb3
7
+ data.tar.gz: df8de9e96bd1e5bf7f96b3ec63e8df222d6f650f2f8e6a33af5da979ab0d496807f9e52fa68092e6e5726ba65f7725d4115cd2b4106f9bfd0985b9ae6158eee6
data/.rubocop.yml CHANGED
@@ -10,4 +10,8 @@ Style/BlockDelimiters:
10
10
  Metrics/BlockLength:
11
11
  Exclude:
12
12
  - spec/**/*
13
- - djin.gemspec
13
+ - djin.gemspec
14
+
15
+ Style/RescueModifier:
16
+ Exclude:
17
+ - spec/**/*
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 0.11.5 - 23/02/2021
2
+ * [FIX] Aborting when dependent task fail
3
+
1
4
  ## 0.11.4 - 12/02/2021
2
5
  * [PATCH] Include Config Validations
3
6
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- djin (0.11.4)
4
+ djin (0.11.5)
5
5
  dry-cli (~> 0.6.0)
6
6
  dry-equalizer (~> 0.3.0)
7
7
  dry-struct (~> 1.3.0)
@@ -26,7 +26,7 @@ GEM
26
26
  docile (1.3.2)
27
27
  dry-cli (0.6.0)
28
28
  concurrent-ruby (~> 1.0)
29
- dry-configurable (0.12.0)
29
+ dry-configurable (0.12.1)
30
30
  concurrent-ruby (~> 1.0)
31
31
  dry-core (~> 0.5, >= 0.5.0)
32
32
  dry-container (0.7.2)
@@ -52,7 +52,7 @@ GEM
52
52
  dry-equalizer (~> 0.3)
53
53
  dry-types (~> 1.3)
54
54
  ice_nine (~> 0.11)
55
- dry-types (1.5.0)
55
+ dry-types (1.5.1)
56
56
  concurrent-ruby (~> 1.0)
57
57
  dry-container (~> 0.3)
58
58
  dry-core (~> 0.5, >= 0.5)
data/README.md CHANGED
@@ -27,7 +27,7 @@ If you use Rbenv you can install djin only once and create an alias in your .bas
27
27
  To use djin first you need to create a djin.yml file:
28
28
 
29
29
  ```yaml
30
- djin_version: '0.11.4'
30
+ djin_version: '0.11.5'
31
31
 
32
32
  tasks:
33
33
  # With a docker image
@@ -54,7 +54,7 @@ You can also set task dependencies with depends_on option:
54
54
 
55
55
 
56
56
  ```yaml
57
- djin_version: '0.11.4'
57
+ djin_version: '0.11.5'
58
58
 
59
59
  _default_run_options: &default_run_options
60
60
  options: "--rm"
@@ -83,7 +83,7 @@ tasks:
83
83
  Or mix local commands and docker/docker-compose commands:
84
84
 
85
85
  ```yaml
86
- djin_version: '0.11.4'
86
+ djin_version: '0.11.5'
87
87
 
88
88
  _default_run_options: &default_run_options
89
89
  options: "--rm"
@@ -122,7 +122,7 @@ After that you can run `djin {{task_name}}`, like `djin script` or `djin test`
122
122
  You can also use environment variables using the '{{YOUR_ENV_HERE}}' syntax, like so:
123
123
 
124
124
  ```yaml
125
- djin_version: '0.11.4'
125
+ djin_version: '0.11.5'
126
126
 
127
127
  _default_run_options: &default_run_options
128
128
  options: "--rm"
@@ -139,7 +139,7 @@ tasks:
139
139
 
140
140
  Or define some variables to use in multiple locations
141
141
  ```yaml
142
- djin_version: '0.11.4'
142
+ djin_version: '0.11.5'
143
143
 
144
144
  _default_run_options: &default_run_options
145
145
  options: "--rm"
@@ -163,7 +163,7 @@ tasks:
163
163
  It's also possible to pass custom arguments to the command, which means is possible to make a djin task act like the command itself:
164
164
 
165
165
  ```yaml
166
- djin_version: '0.11.4'
166
+ djin_version: '0.11.5'
167
167
 
168
168
  _default_run_options: &default_run_options
169
169
  options: "--rm"
@@ -189,7 +189,7 @@ Under the hood djin uses [Mustache](https://mustache.github.io/), so you can use
189
189
  If you have multiple tasks with similar behavior and with small differences you can use the `include` keyword, so this:
190
190
 
191
191
  ```yaml
192
- djin_version: '0.11.4'
192
+ djin_version: '0.11.5'
193
193
 
194
194
  tasks:
195
195
  "host1:ssh":
@@ -228,7 +228,7 @@ can become this:
228
228
 
229
229
  ```yaml
230
230
  # djin.yml
231
- djin_version: '0.11.4'
231
+ djin_version: '0.11.5'
232
232
 
233
233
  include:
234
234
  - file: '.djin/server_tasks.yml'
@@ -250,7 +250,7 @@ include:
250
250
 
251
251
  ```yaml
252
252
  # .djin/server_tasks.yml
253
- djin_version: '0.11.4'
253
+ djin_version: '0.11.5'
254
254
 
255
255
  tasks:
256
256
  "{{namespace}}:ssh":
@@ -272,7 +272,7 @@ tasks:
272
272
  You can also reuse tasks in some git repository, to do that you need to declare a git source and optionally a version:
273
273
 
274
274
  ```yaml
275
- djin_version: '0.11.4'
275
+ djin_version: '0.11.5'
276
276
 
277
277
  include:
278
278
  - git: 'https://github.com/catks/djin.git'
data/djin.yml CHANGED
@@ -1,4 +1,4 @@
1
- djin_version: '0.11.4'
1
+ djin_version: '0.11.5'
2
2
 
3
3
  _default_run_options: &default_run_options
4
4
  options: "--rm --entrypoint=''"
data/examples/djin.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  ---
2
- djin_version: '0.11.4'
2
+ djin_version: '0.11.5'
3
3
 
4
4
  include:
5
5
  - file: 'djin_lib/test.yml'
@@ -1,4 +1,4 @@
1
- djin_version: '0.11.4'
1
+ djin_version: '0.11.5'
2
2
 
3
3
  _default_run_options: &default_run_options
4
4
  options: "--rm --entrypoint=''"
@@ -1,4 +1,4 @@
1
- djin_version: '0.11.4'
1
+ djin_version: '0.11.5'
2
2
 
3
3
  include:
4
4
  - file: '.djin/server_tasks.yml'
@@ -1,4 +1,4 @@
1
- djin_version: '0.11.4'
1
+ djin_version: '0.11.5'
2
2
 
3
3
  include:
4
4
  - git: 'https://gitserver/myrepo.git'
data/lib/djin/cli.rb CHANGED
@@ -13,6 +13,10 @@ module Djin
13
13
 
14
14
  def call(**)
15
15
  Executor.new.call(task)
16
+ # TODO: Extract error handling output (the same logic is used in djin.rb)
17
+ rescue Djin::TaskError => e
18
+ error_name = e.class.name.split('::').last
19
+ abort("[#{error_name}] #{e.message}")
16
20
  end
17
21
  end
18
22
 
data/lib/djin/errors.rb CHANGED
@@ -7,4 +7,6 @@ module Djin
7
7
  VersionNotSupportedError = Class.new(InvalidConfigurationError)
8
8
  InvalidSyntaxError = Class.new(InvalidConfigurationError)
9
9
  FileNotFoundError = Class.new(InvalidConfigurationError)
10
+
11
+ TaskError = Class.new(StandardError)
10
12
  end
data/lib/djin/executor.rb CHANGED
@@ -19,12 +19,12 @@ module Djin
19
19
  run_task dependent_task
20
20
  end
21
21
 
22
- run task.build_command if task.build_command
23
- run task.command if task.command
22
+ run(task.build_command, task_name: task.name) if task.build_command
23
+ run(task.command, task_name: task.name) if task.command
24
24
  end
25
25
 
26
- def run(command)
27
- system command
26
+ def run(command, task_name:)
27
+ raise TaskError, "Task `#{task_name}` failed" unless system(command)
28
28
  end
29
29
  end
30
30
  end
data/lib/djin/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Djin
4
- VERSION = '0.11.4'
4
+ VERSION = '0.11.5'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: djin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.4
4
+ version: 0.11.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carlos Atkinson
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-02-13 00:00:00.000000000 Z
11
+ date: 2021-02-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-cli