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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 46324af703fd974f1dde1ddc31666fb73623ee8143f7d71b4f3dc30ee539c28d
4
- data.tar.gz: d0b865987d6bdb2bc23480e89b7eae791ec2e99a9c54090555b01bc80c750a2e
3
+ metadata.gz: 1c739260d04538643bc1a872b1d04ff441d3f62a8bc8855e990950510b4ca369
4
+ data.tar.gz: 3af3ba1475e2eb98d13fd406d5a4c4871ad286842e55f143464b4e4d7ca5c490
5
5
  SHA512:
6
- metadata.gz: 607b4fbd945f5a33854220fbbffb69b1798cdd6b86edb61833e648fa5d66f14ef2d249b3d1004e664b950d08bef08c1d4d62a9dedba975702c1ce663ebceaa27
7
- data.tar.gz: 3b33b6ae87a5de31f2e90e0281aa3add9d18c55b10edc5ee0e7b2e8ffa67f9738fcd65f33e577f8b45db379428bd4a1bc85614a60df2e110dcde54f8527a5538
6
+ metadata.gz: b4ff3bb12d5a1e3752d2954b89c82eeda582e990540b07f4af647096714caafcc4c32ffcc142356015f79fe5bd080a1b2e9d27ffab7ca4ae60db7e9825ffdbe7
7
+ data.tar.gz: 44cb53b59394977830fa51144ddd69945ead0bc4dd0b95015ac3be3e7807b2f306a8df947f6ff1b3921683e400131e5b868315de34bde821a210008343d5d7c2
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 1.0.0
2
+
3
+ Add asdf:install and asdf:add_plugins tasks
4
+
1
5
  ## 0.0.3
2
6
 
3
7
  Add some configuration options:
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
@@ -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.3'
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.3
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: 2018-12-05 00:00:00.000000000 Z
11
+ date: 2021-04-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capistrano