rexer 0.4.1 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +10 -0
- data/lib/rexer/extension/plugin.rb +6 -2
- data/lib/rexer/version.rb +1 -1
- data/lib/rexer.rb +15 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6bb969edc94e8ed8a471a4de3b393768e471b75f4b200637235cc05d247e15f5
|
4
|
+
data.tar.gz: 93655f0b69f0f02f91920f9f09f56339f71caefe68e8be78eb276e9cbeaaebba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e69305a1d92ba1445eada1931379b590b6186cc09dffa12e3598d4a3b8a94c862f868828e21b7e19910280bef08dd13a5f42c74d28a4134d109fd64a3178c931
|
7
|
+
data.tar.gz: 8508080c6d1a030b8ca1de6d2bb16cf547014dbe9a777b4b838cb6e7d40e8d773977519462f8fb5f547cf354d0d912f8b93cab8571552f3edd5423ad1250a4ce
|
data/README.md
CHANGED
@@ -120,6 +120,16 @@ plugin :redmica_s3, github: { repo: "redmica/redmica_s3" } do
|
|
120
120
|
end
|
121
121
|
```
|
122
122
|
|
123
|
+
### Configuring the command prefix
|
124
|
+
|
125
|
+
You can set a prefix for the commands such as `bundle install` that Rexer executes with the `REXER_COMMAND_PREFIX` environment variable.
|
126
|
+
|
127
|
+
```
|
128
|
+
export REXER_COMMAND_PREFIX="docker compose exec -T app"
|
129
|
+
```
|
130
|
+
|
131
|
+
In the above case, the `bin/rails redmine:plugins:migrate` command is executed as `docker compose exec -T app bin/rails redmine:plugins:migrate`.
|
132
|
+
|
123
133
|
## Developing
|
124
134
|
|
125
135
|
### Running tests
|
@@ -36,7 +36,7 @@ module Rexer
|
|
36
36
|
return unless needs_db_migration?
|
37
37
|
|
38
38
|
envs = {"NAME" => name.to_s}.merge(extra_envs)
|
39
|
-
_, error, status = Open3.capture3(envs, "bin/rails redmine:plugins:migrate")
|
39
|
+
_, error, status = Open3.capture3(envs, cmd_with_prefix("bin/rails redmine:plugins:migrate"))
|
40
40
|
|
41
41
|
raise error unless status.success?
|
42
42
|
end
|
@@ -44,6 +44,10 @@ module Rexer
|
|
44
44
|
def source
|
45
45
|
@source ||= Source.from_definition(definition.source)
|
46
46
|
end
|
47
|
+
|
48
|
+
def cmd_with_prefix(command)
|
49
|
+
[Rexer.config.command_prefix, command].compact.join(" ")
|
50
|
+
end
|
47
51
|
end
|
48
52
|
|
49
53
|
class Installer < Base
|
@@ -65,7 +69,7 @@ module Rexer
|
|
65
69
|
def run_bundle_install
|
66
70
|
return unless plugin_dir.join("Gemfile").exist?
|
67
71
|
|
68
|
-
_, error, status = Open3.capture3("bundle install")
|
72
|
+
_, error, status = Open3.capture3(cmd_with_prefix("bundle install"))
|
69
73
|
raise error unless status.success?
|
70
74
|
end
|
71
75
|
end
|
data/lib/rexer/version.rb
CHANGED
data/lib/rexer.rb
CHANGED
@@ -6,6 +6,21 @@ module Rexer
|
|
6
6
|
def self.definition_lock_file
|
7
7
|
".extensions.lock"
|
8
8
|
end
|
9
|
+
|
10
|
+
Config = Data.define(
|
11
|
+
# The prefix of the command such as bundle install and bin/rails redmine:plugins:migrate.
|
12
|
+
#
|
13
|
+
# For example, if the command_prefix is set "docker compose exec -T app",
|
14
|
+
# then bundle install will be executed as follows:
|
15
|
+
#
|
16
|
+
# docker compose exec -T app bundle install
|
17
|
+
#
|
18
|
+
:command_prefix
|
19
|
+
)
|
20
|
+
|
21
|
+
def self.config
|
22
|
+
@config ||= Config.new(command_prefix: ENV["REXER_COMMAND_PREFIX"])
|
23
|
+
end
|
9
24
|
end
|
10
25
|
|
11
26
|
require "pathname"
|