capistrano-asdf 0.0.3 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +9 -0
- data/capistrano-asdf.gemspec +1 -1
- data/lib/capistrano/tasks/asdf.rake +25 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1c739260d04538643bc1a872b1d04ff441d3f62a8bc8855e990950510b4ca369
|
4
|
+
data.tar.gz: 3af3ba1475e2eb98d13fd406d5a4c4871ad286842e55f143464b4e4d7ca5c490
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b4ff3bb12d5a1e3752d2954b89c82eeda582e990540b07f4af647096714caafcc4c32ffcc142356015f79fe5bd080a1b2e9d27ffab7ca4ae60db7e9825ffdbe7
|
7
|
+
data.tar.gz: 44cb53b59394977830fa51144ddd69945ead0bc4dd0b95015ac3be3e7807b2f306a8df947f6ff1b3921683e400131e5b868315de34bde821a210008343d5d7c2
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -84,6 +84,15 @@ This gem adds new tasks `asdf:map_*` before `deploy` task.
|
|
84
84
|
It loads the ASDF tools environment for capistrano when it wants to run
|
85
85
|
some tools related programs like `rake`, `gem`, `bundle`, `node`, `npm` ...
|
86
86
|
|
87
|
+
## Install required tools
|
88
|
+
|
89
|
+
If you want your tools (ruby, nodejs) to be installed, you can use the `asdf:install` task to
|
90
|
+
preform plugins add and then install of required versions from your `.tool-versions`.
|
91
|
+
`asdf:install` will automaticaly add necessary plugins running `asdf:add_plugins`.
|
92
|
+
If you want to change the plugins to install you my set `:asdf_tools` accordingly.
|
93
|
+
|
94
|
+
$ cap production asdf:install
|
95
|
+
|
87
96
|
## Check your configuration
|
88
97
|
|
89
98
|
If you want to check your configuration you can use the `asdf:check` task to
|
data/capistrano-asdf.gemspec
CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |gem|
|
6
6
|
gem.name = "capistrano-asdf"
|
7
|
-
gem.version = '0.0
|
7
|
+
gem.version = '1.0.0'
|
8
8
|
gem.licenses = ['MIT']
|
9
9
|
gem.authors = ["Jean-Baptiste Poix"]
|
10
10
|
gem.email = ["jbpoix@inosophia.com"]
|
@@ -12,7 +12,28 @@ namespace :asdf do
|
|
12
12
|
execute("source #{fetch(:asdf_path)}/asdf.sh; asdf current")
|
13
13
|
end
|
14
14
|
end
|
15
|
-
|
15
|
+
|
16
|
+
desc "Install ASDF tools versions based on the .tool-versions of your project"
|
17
|
+
task :install do
|
18
|
+
on roles(fetch(:asdf_roles, :all)) do
|
19
|
+
execute("source #{fetch(:asdf_path)}/asdf.sh; asdf install")
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
desc "Add ASDF plugins specified in :asdf_tools"
|
24
|
+
task :add_plugins do
|
25
|
+
on roles(fetch(:asdf_roles, :all)) do
|
26
|
+
already_installed_plugins = capture("source #{fetch(:asdf_path)}/asdf.sh; asdf plugin list")&.split
|
27
|
+
fetch(:asdf_tools)&.each do |asdf_tool|
|
28
|
+
if already_installed_plugins.include?(asdf_tool)
|
29
|
+
info "#{asdf_tool} Already installed"
|
30
|
+
else
|
31
|
+
execute("source #{fetch(:asdf_path)}/asdf.sh; asdf plugin add #{asdf_tool}")
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
16
37
|
task :map_ruby_bins do
|
17
38
|
if fetch(:asdf_tools).include?('ruby')
|
18
39
|
fetch(:asdf_map_ruby_bins).each do |mapped_command|
|
@@ -31,6 +52,9 @@ namespace :asdf do
|
|
31
52
|
|
32
53
|
end
|
33
54
|
|
55
|
+
before 'asdf:install', 'asdf:add_plugins'
|
56
|
+
after 'deploy:check', 'asdf:check'
|
57
|
+
|
34
58
|
Capistrano::DSL.stages.each do |stage|
|
35
59
|
after stage, 'asdf:map_ruby_bins'
|
36
60
|
after stage, 'asdf:map_nodejs_bins'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capistrano-asdf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jean-Baptiste Poix
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-04-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capistrano
|