mimas 0.7.0 → 0.8.1

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: 32d18ae6eabecfaf693befa2c2850b1b5603aa013078280ffc44898e23dd1706
4
- data.tar.gz: 86f9b0644f120adf2ea0bb9e4e5cacda8ab89d216588c43491bebafb258c05b6
3
+ metadata.gz: b303719186a684e3ad914c7d9cf34ee3c817fdd3d5ff4c49c315765638f5ba03
4
+ data.tar.gz: bb29a9c878814cdeb632502459a62e82d9c3e411f23af19003764bfb8b8d6f23
5
5
  SHA512:
6
- metadata.gz: 448b7d3a1fb29e51b73068ceac56ed44fad6982e0e1c2eae5d29919601df144e3141d29bde0ec8ba1e2bce037a2cc363053505c8ec4c043edefde766ee75ae7e
7
- data.tar.gz: 138a243453b2fc62b52fb2625331ee0af5939fd7704ffe2986d030be6af97c5b55e7902166fff7591502a103788adf627644e9d06c79b1d603608971b2e542ff
6
+ metadata.gz: d37069c4a1f38956934774f038a657433e550c93fe4d2f34449fc188a0185e745130b415962c4ee8666957fb82e9289b6cdc88932c581fe0ed3468b956428fdd
7
+ data.tar.gz: d322f3c2bcfd29f9665fa202d231f9d947c6722e9b25866af9ec068abbd2e1bcd05a86591e59685005273a73cffe02a8977e0b12ff74c2ee75ea6e37edbb79b3
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2026-present Ayush Newatia
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -33,11 +33,11 @@ module Mimas
33
33
  end
34
34
  end
35
35
 
36
- @hooks[:before_push].each { it.call }
36
+ Hooks.run(@hooks[:before_push], args: [site])
37
37
 
38
38
  Deployment.new(site: site, server: server).deploy
39
39
 
40
- @hooks[:after_push].each { it.call }
40
+ Hooks.run(@hooks[:after_push], args: [site])
41
41
  end
42
42
  end
43
43
  end
data/lib/mimas/config.rb CHANGED
@@ -105,6 +105,10 @@ module Mimas
105
105
  end
106
106
 
107
107
  class Site < Options
108
+ def files(&block)
109
+ @options[:files] = block
110
+ end
111
+
108
112
  def services(&block)
109
113
  @options[:services] = Services.parse(&block)
110
114
  end
@@ -33,7 +33,7 @@ module Mimas
33
33
 
34
34
  say "Running deploy script"
35
35
  session.upload StringIO.new(site.deploy), deploy_script_path
36
- session.run "cd #{remote_destination} && ~/.cargo/bin/rv run sh #{deploy_script}"
36
+ session.run "cd #{remote_destination} && /usr/bin/env bash -lc 'set -a; source #{site_root.join(".env")}; source #{mimas_path.join("mimas.env")}; rv run sh #{deploy_script}; set +a;'"
37
37
  session.run "rm #{deploy_script_path}"
38
38
 
39
39
  say "Setting current symlink"
@@ -66,7 +66,6 @@ module Mimas
66
66
  exit 1
67
67
  end
68
68
 
69
-
70
69
  cleanup_successful_deployment(session, remote_current_version: remote_current_version)
71
70
  say "\n"
72
71
  say "Deployment complete! #{version} is now live.".bold.white
data/lib/mimas/hooks.rb CHANGED
@@ -16,6 +16,16 @@ module Mimas
16
16
  end
17
17
  end
18
18
 
19
+ def self.run(hooks, args: [])
20
+ hooks.each do |hook|
21
+ if hook.arity == args.count
22
+ hook.call(*args)
23
+ else
24
+ hook.call
25
+ end
26
+ end
27
+ end
28
+
19
29
  POINTS.each do |point|
20
30
  define_method(point) do |&block|
21
31
  @hooks[point] << block
@@ -3,7 +3,7 @@ module Mimas
3
3
  module Archive
4
4
  def archive(filename: "#{name}.tar.gz")
5
5
  if self.ruby_app?
6
- Archiver.new(output_file: filename, files: files).package
6
+ Archiver.new(output_file: filename, files: files.call).package
7
7
  else
8
8
  Archiver.new(root: root_dir, output_file: filename, archive_root: "root", glob: glob, files: files).package
9
9
  end
data/lib/mimas/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Mimas
2
- VERSION = "0.7.0"
2
+ VERSION = "0.8.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mimas
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ayush Newatia
@@ -99,6 +99,7 @@ executables:
99
99
  extensions: []
100
100
  extra_rdoc_files: []
101
101
  files:
102
+ - LICENSE.txt
102
103
  - bin/mimas
103
104
  - lib/mimas.rb
104
105
  - lib/mimas/archiver.rb
@@ -173,7 +174,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
173
174
  - !ruby/object:Gem::Version
174
175
  version: '0'
175
176
  requirements: []
176
- rubygems_version: 4.0.18
177
+ rubygems_version: 4.0.16
177
178
  specification_version: 4
178
179
  summary: Deploy Ruby apps to a single server using an omakase setup
179
180
  test_files: []