capistrano-asdf 0.0.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 +7 -0
- data/.gitignore +3 -0
- data/CHANGELOG.md +3 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README.md +62 -0
- data/Rakefile +1 -0
- data/capistrano-asdf.gemspec +21 -0
- data/lib/capistrano-asdf.rb +0 -0
- data/lib/capistrano/asdf.rb +1 -0
- data/lib/capistrano/tasks/asdf.rake +42 -0
- metadata +81 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: d43a2d782cc8ea242690a5a35615394b27e72093f209193e33851de9d09824c5
|
4
|
+
data.tar.gz: 44ed650daf5b4a0c41b4caccc0c0ec02e9a153d978ceb39b43c582e468ec1459
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: e459b9792f3f9cebf1ff229ab5830c59f913b7a882bb96bc09b640d1c31aeed6e18bf662e64aa0c86d7fffa6b482e95ad5dcedc8c64c6cdefedaf4a3c6ead1ab
|
7
|
+
data.tar.gz: 8e8c3eef03a773a0777a17d3e82514ecd94ca06594e882afc715262127f9309949e56fa9bfda0af247a1d37991b38b9c96f84a082633363e08cee6a9fed78dfa
|
data/.gitignore
ADDED
data/CHANGELOG.md
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
|
2
|
+
The MIT License (MIT)
|
3
|
+
|
4
|
+
Copyright (c) 2018 Caramel Beurre Salé
|
5
|
+
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
7
|
+
this software and associated documentation files (the "Software"), to deal in
|
8
|
+
the Software without restriction, including without limitation the rights to
|
9
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
10
|
+
the Software, and to permit persons to whom the Software is furnished to do so,
|
11
|
+
subject to the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be included in all
|
14
|
+
copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
18
|
+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
19
|
+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
20
|
+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
21
|
+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,62 @@
|
|
1
|
+
# Capistrano::ASDF
|
2
|
+
|
3
|
+
ASDF support for Capistrano v3:
|
4
|
+
|
5
|
+
## Notes
|
6
|
+
|
7
|
+
**If you use this integration with capistrano-rails, please ensure that you have `capistrano-bundler >= 1.1.0`.**
|
8
|
+
|
9
|
+
## Installation
|
10
|
+
|
11
|
+
Add this line to your application's Gemfile:
|
12
|
+
|
13
|
+
# Gemfile
|
14
|
+
gem 'capistrano', '~> 3.0'
|
15
|
+
gem 'capistrano-asdf'
|
16
|
+
|
17
|
+
And then execute:
|
18
|
+
|
19
|
+
$ bundle install
|
20
|
+
|
21
|
+
## Usage
|
22
|
+
|
23
|
+
Require in Capfile to use the default task:
|
24
|
+
|
25
|
+
# Capfile
|
26
|
+
require 'capistrano/asdf'
|
27
|
+
|
28
|
+
And you should be good to go!
|
29
|
+
|
30
|
+
## Configuration
|
31
|
+
|
32
|
+
There is no configuration yet.
|
33
|
+
Everything *should work* for a basic ASDF setup *out of the box*.
|
34
|
+
However we strongly encourage you to use the `.tool-versions` for proper tool version selection.
|
35
|
+
|
36
|
+
## Restrictions
|
37
|
+
|
38
|
+
Capistrano can't use ASDF to install rubies, nodes or other tools yet.
|
39
|
+
So on the servers you are deploying to, you will have to manually use ASDF to install the
|
40
|
+
proper rubies, nodes or other tools.
|
41
|
+
|
42
|
+
## How it works
|
43
|
+
|
44
|
+
This gem adds new tasks `asdf:map_*` before `deploy` task.
|
45
|
+
It loads the ASDF tools environment for capistrano when it wants to run
|
46
|
+
some tools related programs like `rake`, `gem`, `bundle`, `node`, `npm` ...
|
47
|
+
|
48
|
+
## Check your configuration
|
49
|
+
|
50
|
+
If you want to check your configuration you can use the `asdf:check` task to
|
51
|
+
get information about the ASDF version and ruby/nodejs tools which would be used for
|
52
|
+
deployment.
|
53
|
+
|
54
|
+
$ cap production asdf:check
|
55
|
+
|
56
|
+
## Contributing
|
57
|
+
|
58
|
+
1. Fork it
|
59
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
60
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
61
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
62
|
+
5. Create new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
|
5
|
+
Gem::Specification.new do |gem|
|
6
|
+
gem.name = "capistrano-asdf"
|
7
|
+
gem.version = '0.0.1'
|
8
|
+
gem.authors = ["Jean-Baptiste Poix"]
|
9
|
+
gem.email = ["jbpoix@inosophia.com"]
|
10
|
+
gem.description = %q{ASDF integration for Capistrano}
|
11
|
+
gem.summary = %q{ASDF integration for Capistrano}
|
12
|
+
gem.homepage = "https://github.com/cabesa-collective/capistrano-asdf"
|
13
|
+
|
14
|
+
gem.files = `git ls-files`.split($/)
|
15
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
16
|
+
gem.require_paths = ["lib"]
|
17
|
+
|
18
|
+
gem.add_dependency 'capistrano', '~> 3.0'
|
19
|
+
gem.add_dependency 'sshkit', '~> 1.2'
|
20
|
+
|
21
|
+
end
|
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
load File.expand_path("../tasks/asdf.rake", __FILE__)
|
@@ -0,0 +1,42 @@
|
|
1
|
+
ASDF_USER_PATH = "~/.asdf"
|
2
|
+
|
3
|
+
namespace :asdf do
|
4
|
+
desc "Prints the ASDF tools versions on the target host"
|
5
|
+
task :check do
|
6
|
+
puts capture("source $#{fetch(:asdf_path)}/asdf.sh; asdf current")
|
7
|
+
end
|
8
|
+
|
9
|
+
task :map_ruby_bins do
|
10
|
+
fetch(:asdf_map_ruby_bins).each do |mapped_command|
|
11
|
+
SSHKit.config.command_map.prefix[mapped_command.to_sym].unshift("source $#{fetch(:asdf_path)}/asdf.sh;")
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
task :map_nodejs_bins do
|
16
|
+
fetch(:asdf_map_nodejs_bins).each do |mapped_command|
|
17
|
+
SSHKit.config.command_map.prefix[mapped_command.to_sym].unshift("source $#{fetch(:asdf_path)}/asdf.sh;")
|
18
|
+
end
|
19
|
+
fetch(:asdf_map_nodejs_npm_bins).each do |mapped_command|
|
20
|
+
SSHKit.config.command_map.prefix[mapped_command.to_sym].unshift("source $#{fetch(:asdf_path)}/asdf.sh;")
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
25
|
+
|
26
|
+
Capistrano::DSL.stages.each do |stage|
|
27
|
+
after stage, 'asdf:map_ruby_bins'
|
28
|
+
after stage, 'asdf:map_nodejs_bins'
|
29
|
+
end
|
30
|
+
|
31
|
+
namespace :load do
|
32
|
+
task :defaults do
|
33
|
+
set :asdf_path, -> {
|
34
|
+
asdf_path = fetch(:asdf_custom_path)
|
35
|
+
asdf_path ||= ASDF_USER_PATH
|
36
|
+
}
|
37
|
+
|
38
|
+
set :asdf_map_ruby_bins, %w{rake gem bundle ruby rails}
|
39
|
+
set :asdf_map_nodejs_bins, %w{node npm}
|
40
|
+
set :asdf_map_nodejs_npm_bins, %w{yarn}
|
41
|
+
end
|
42
|
+
end
|
metadata
ADDED
@@ -0,0 +1,81 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: capistrano-asdf
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Jean-Baptiste Poix
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2018-12-03 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: capistrano
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '3.0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '3.0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: sshkit
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.2'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.2'
|
41
|
+
description: ASDF integration for Capistrano
|
42
|
+
email:
|
43
|
+
- jbpoix@inosophia.com
|
44
|
+
executables: []
|
45
|
+
extensions: []
|
46
|
+
extra_rdoc_files: []
|
47
|
+
files:
|
48
|
+
- ".gitignore"
|
49
|
+
- CHANGELOG.md
|
50
|
+
- Gemfile
|
51
|
+
- LICENSE.txt
|
52
|
+
- README.md
|
53
|
+
- Rakefile
|
54
|
+
- capistrano-asdf.gemspec
|
55
|
+
- lib/capistrano-asdf.rb
|
56
|
+
- lib/capistrano/asdf.rb
|
57
|
+
- lib/capistrano/tasks/asdf.rake
|
58
|
+
homepage: https://github.com/cabesa-collective/capistrano-asdf
|
59
|
+
licenses: []
|
60
|
+
metadata: {}
|
61
|
+
post_install_message:
|
62
|
+
rdoc_options: []
|
63
|
+
require_paths:
|
64
|
+
- lib
|
65
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - ">="
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
70
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - ">="
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '0'
|
75
|
+
requirements: []
|
76
|
+
rubyforge_project:
|
77
|
+
rubygems_version: 2.7.3
|
78
|
+
signing_key:
|
79
|
+
specification_version: 4
|
80
|
+
summary: ASDF integration for Capistrano
|
81
|
+
test_files: []
|