minos 0.3.3 → 0.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ed42480e69026ee8407a729c8448ab478dda30a41df536fd33dbf54ab34b14da
4
- data.tar.gz: c28143cbd6fbe7a9b66bcb70b8efd15d0b1e2e14402ce3546a5de2258b3a63df
3
+ metadata.gz: 16d9e1c975cffe66051de530f3c23e82da366fc9e9234d05443247e1b3604a74
4
+ data.tar.gz: cedb8b896002b8d7ff781be86dff32638dd26534b25c89ccc3162a372ab52956
5
5
  SHA512:
6
- metadata.gz: '019fcfb42de45eeb468ffbc16258c65f9ed5cf26f58c74ff7ab6c5d3b25de055b47793eefe417968d68641b1c8976980b835e0cd4eee4a3b501b4c2fcd8b3455'
7
- data.tar.gz: 9d86167b076b6d232e3c3d67e90b4b261cb95be76db440f3ea35f60a31d76cc9bd517b2eaa28b01d3c1bb270ef90642af7d314a4baf45718961a7da8087e34c2
6
+ metadata.gz: d7af5313b2c0ce554531f3c02f880b6c1f131bf8a1fcd45a92e5b371c3652c6db37748ab1339692cb55057c75e0ac336e9dcde38c5be0dfe3dd6d2016b3b2e7e
7
+ data.tar.gz: b96b385c7b9bbdc565de89007b939a68f539a3afaf8b700ab64f306cbbf62b3508c426e8c8aed24a16b12c64ef9fa76ea574ffd0b57742318ff4af7e829dfa35
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- minos (0.3.3)
4
+ minos (0.3.4)
5
5
  activesupport (~> 5.2)
6
6
  dry-matcher (~> 0.7)
7
7
  dry-monads (~> 1.2)
@@ -17,6 +17,7 @@ GEM
17
17
  tzinfo (~> 1.1)
18
18
  coderay (1.1.2)
19
19
  concurrent-ruby (1.1.4)
20
+ diff-lcs (1.3)
20
21
  dry-core (0.4.7)
21
22
  concurrent-ruby (~> 1.0)
22
23
  dry-equalizer (0.2.1)
@@ -33,6 +34,19 @@ GEM
33
34
  coderay (~> 1.1.0)
34
35
  method_source (~> 0.9.0)
35
36
  rake (10.5.0)
37
+ rspec (3.8.0)
38
+ rspec-core (~> 3.8.0)
39
+ rspec-expectations (~> 3.8.0)
40
+ rspec-mocks (~> 3.8.0)
41
+ rspec-core (3.8.0)
42
+ rspec-support (~> 3.8.0)
43
+ rspec-expectations (3.8.2)
44
+ diff-lcs (>= 1.2.0, < 2.0)
45
+ rspec-support (~> 3.8.0)
46
+ rspec-mocks (3.8.0)
47
+ diff-lcs (>= 1.2.0, < 2.0)
48
+ rspec-support (~> 3.8.0)
49
+ rspec-support (3.8.0)
36
50
  thor (0.20.3)
37
51
  thread_safe (0.3.6)
38
52
  tzinfo (1.2.5)
@@ -46,6 +60,7 @@ DEPENDENCIES
46
60
  minos!
47
61
  pry
48
62
  rake (~> 10.0)
63
+ rspec
49
64
 
50
65
  BUNDLED WITH
51
66
  1.17.3
@@ -0,0 +1,27 @@
1
+ ######################
2
+ # Stage: builder
3
+ FROM nginx as builder
4
+
5
+ ENV HOME /home/app
6
+ WORKDIR $HOME
7
+
8
+ RUN touch builder
9
+ RUN exit 1
10
+
11
+ CMD ["ls", "-l"]
12
+
13
+ ###############################
14
+ # Stage release
15
+ FROM nginx as release
16
+
17
+ ENV HOME /home/app
18
+ WORKDIR $HOME
19
+
20
+ RUN touch release
21
+
22
+ CMD ["ls", "-l"]
23
+
24
+ ARG ENV=production
25
+ ARG REVISION
26
+
27
+ ENV REVISION $REVISION
@@ -0,0 +1,32 @@
1
+ build:
2
+ artifacts:
3
+ - name: builder
4
+ image: textmasterapps/nginx
5
+ tags:
6
+ - "$TARGET-$REVISION"
7
+ - "$TARGET-latest"
8
+ docker:
9
+ file: ./examples/Dockerfile.invalid
10
+ tag: "$IMAGE:$TARGET" # $IMAGE and $TARGET are automatically populated as env vars for you
11
+ target: builder
12
+ cacheFrom:
13
+ - textmasterapps/nginx:builder
14
+ - textmasterapps/nginx:builder-$REVISION
15
+ - textmasterapps/nginx:builder-latest
16
+ - name: release
17
+ image: textmasterapps/nginx
18
+ tags:
19
+ - "$REVISION" # you can reference ENV variables from your shell
20
+ - "latest"
21
+ docker:
22
+ file: ./examples/Dockerfile.invalid
23
+ tag: "$IMAGE:$TARGET"
24
+ target: release
25
+ buildArg:
26
+ ENV: "production"
27
+ REVISION: "$REVISION"
28
+ cacheFrom:
29
+ - textmasterapps/nginx:builder
30
+ - textmasterapps/nginx:release
31
+ - textmasterapps/nginx:$REVISION
32
+ - textmasterapps/nginx:latest
@@ -4,6 +4,7 @@ require 'active_support/core_ext/string/inflections'
4
4
 
5
5
  module Minos
6
6
  class Artifact
7
+ include Dry::Monads::Result::Mixin
7
8
  include Dry::Monads::Task::Mixin
8
9
  include Dry::Monads::List::Mixin
9
10
  include Dry::Monads::Do.for(:build, :push)
@@ -45,9 +46,9 @@ module Minos
45
46
  print "Pulling #{cache}...", color: color
46
47
  if run "docker inspect #{cache} -f '{{json .ID}}' > /dev/null 2>&1 || docker pull #{cache} 2> /dev/null", color: color
47
48
  print "Using #{cache}", color: color
48
- else
49
- # noop
50
49
  end
50
+
51
+ return Success()
51
52
  }]
52
53
  end
53
54
 
@@ -57,9 +58,10 @@ module Minos
57
58
  print "Building #{target}...", color: color
58
59
  if run "docker build --rm #{Minos::Utils.to_args(docker)} .", color: color
59
60
  print "Successfully built #{target}", color: color
61
+ return Success()
60
62
  else
61
- print "Failed building #{target}", :red
62
- raise StandardError.new($?)
63
+ print "Failed building #{target}", color: :red
64
+ return Failure($?)
63
65
  end
64
66
  }]
65
67
  end
@@ -70,9 +72,10 @@ module Minos
70
72
  print "Pushing #{image}:#{tag}...", color: color
71
73
  if run "docker tag #{image}:#{target} #{image}:#{tag} && docker push #{image}:#{tag}", color: color
72
74
  print "Successfully pushed #{image}:#{tag}", color: color
75
+ return Success()
73
76
  else
74
- print "Failed pushing #{image}:#{tag}", :red
75
- raise StandardError.new($?)
77
+ print "Failed pushing #{image}:#{tag}", color: :red
78
+ return Failure($?)
76
79
  end
77
80
  }]
78
81
  end
data/lib/minos/cli.rb CHANGED
@@ -7,7 +7,7 @@ module Minos
7
7
  option :only, type: :array, default: [], desc: "Process only given artifacts"
8
8
  option :except, type: :array, default: [], desc: "Process all but given artifacts"
9
9
  def build
10
- artifacts.each do |a|
10
+ artifacts.map do |a|
11
11
  artifact = Artifact.new(a, options: options)
12
12
  artifact.build
13
13
  end
@@ -18,7 +18,7 @@ module Minos
18
18
  option :only, type: :array, default: [], desc: "Process only given artifacts"
19
19
  option :except, type: :array, default: [], desc: "Process all but given artifacts"
20
20
  def push
21
- artifacts.each do |a|
21
+ artifacts.map do |a|
22
22
  artifact = Artifact.new(a, options: options)
23
23
  artifact.push
24
24
  end
data/lib/minos/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Minos
2
- VERSION = '0.3.3'
2
+ VERSION = '0.3.4'
3
3
  end
data/minos.gemspec CHANGED
@@ -31,4 +31,5 @@ Gem::Specification.new do |spec|
31
31
  spec.add_development_dependency "bundler", "~> 1.17"
32
32
  spec.add_development_dependency "rake", "~> 10.0"
33
33
  spec.add_development_dependency "pry"
34
+ spec.add_development_dependency "rspec"
34
35
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: minos
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pierre-Louis Gottfrois
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-03-01 00:00:00.000000000 Z
11
+ date: 2019-03-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -108,6 +108,20 @@ dependencies:
108
108
  - - ">="
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: rspec
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
111
125
  description: Easy and repeatable Kubernetes deployment based on Docker images
112
126
  email:
113
127
  - pierre-louis@textmaster.com
@@ -127,6 +141,8 @@ files:
127
141
  - bin/console
128
142
  - bin/setup
129
143
  - examples/Dockerfile
144
+ - examples/Dockerfile.invalid
145
+ - examples/minos.invalid.yaml
130
146
  - examples/minos.yaml
131
147
  - exe/minos
132
148
  - lib/minos.rb