rvm1-capistrano3 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/lib/rvm1/capistrano3.rb +1 -0
- data/lib/rvm1/capistrano3/version.rb +5 -0
- data/lib/rvm1/tasks/capistrano3.rake +52 -0
- data/script/rvm-auto.sh +63 -0
- data/test/script_rvm-auto_comment_test.sh +28 -0
- metadata +76 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 2da7ddee8d21fd4ef862fa1031a2dad65648b23a
|
4
|
+
data.tar.gz: df1d69d6dac6d4dd1842abead1ef8fffd7f557f8
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: c6089aedcffa9d69b1b03373652d4c5333fcbf31a5e3499c369d40fa2ce3e7813129e0caa5c86f5d4e558afadf3a2cc9cdeedbc07cc0f807ddf152a2354d9831
|
7
|
+
data.tar.gz: 5c56b8e712baab3470c2a3e1d1897c0b7b131e3df6bcb70c06037d2629128a1f7bf23eef7218a59f22ada2cc79dd91bb169a1fb33009d7dd43789c6b0b84e8e9
|
@@ -0,0 +1 @@
|
|
1
|
+
load File.expand_path("../tasks/capistrano3.rake", __FILE__)
|
@@ -0,0 +1,52 @@
|
|
1
|
+
SSHKit.config.command_map = Hash.new do |hash, key|
|
2
|
+
if fetch(:rvm1_map_bins).include?(key.to_s)
|
3
|
+
hash[key] = "#{fetch(:tmp_dir)}/#{fetch(:application)}/rvm-auto.sh #{fetch(:rvm1_ruby_version)} #{key}"
|
4
|
+
elsif key.to_s == "rvm"
|
5
|
+
hash[key] = "#{fetch(:tmp_dir)}/#{fetch(:application)}/rvm-auto.sh #{key}"
|
6
|
+
else
|
7
|
+
hash[key] = key
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
namespace :deploy do
|
12
|
+
after :starting, 'rvm1:hook'
|
13
|
+
end
|
14
|
+
|
15
|
+
namespace :rvm1 do
|
16
|
+
desc "Runs the RVM1 hook - use it before any custom tasks if necessary"
|
17
|
+
task :hook do
|
18
|
+
unless fetch(:rvm1_hooked)
|
19
|
+
invoke :'rvm1:init'
|
20
|
+
set :rvm1_hooked, true
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
desc "Prints the RVM1 and Ruby version on the target host"
|
25
|
+
task :check do
|
26
|
+
on roles(:all) do
|
27
|
+
puts capture(:rvm, "version")
|
28
|
+
puts capture(:rvm, "list")
|
29
|
+
puts capture(:rvm, "current")
|
30
|
+
within fetch(:latest_release_directory) do
|
31
|
+
puts capture(:ruby, "--version || true")
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
before :check, 'rvm1:hook'
|
36
|
+
|
37
|
+
task :init do
|
38
|
+
on roles(:all) do
|
39
|
+
execute :mkdir, "-p", "#{fetch(:tmp_dir)}/#{fetch(:application)}/"
|
40
|
+
upload! File.expand_path("../../../../script/rvm-auto.sh", __FILE__), "#{fetch(:tmp_dir)}/#{fetch(:application)}/rvm-auto.sh"
|
41
|
+
execute :chmod, "+x", "#{fetch(:tmp_dir)}/#{fetch(:application)}/rvm-auto.sh"
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
end
|
46
|
+
|
47
|
+
namespace :load do
|
48
|
+
task :defaults do
|
49
|
+
set :rvm1_ruby_version, "."
|
50
|
+
set :rvm1_map_bins, %w{rake gem bundle ruby}
|
51
|
+
end
|
52
|
+
end
|
data/script/rvm-auto.sh
ADDED
@@ -0,0 +1,63 @@
|
|
1
|
+
#!/usr/bin/env sh
|
2
|
+
|
3
|
+
rvm_fail()
|
4
|
+
{
|
5
|
+
echo "$1" >&2
|
6
|
+
exit "${2:-1}"
|
7
|
+
}
|
8
|
+
|
9
|
+
if test -z "${1:-}"
|
10
|
+
then rvm_fail "No ruby versions given." 101
|
11
|
+
fi
|
12
|
+
|
13
|
+
# the first parameter is usually ruby version to use,
|
14
|
+
# can be "." for reading current directory ruby
|
15
|
+
ruby_string="$1"
|
16
|
+
shift
|
17
|
+
|
18
|
+
# if rvm_path not set autodetect it
|
19
|
+
if test -n "${rvm_path:-}"
|
20
|
+
then true
|
21
|
+
else
|
22
|
+
export rvm_path
|
23
|
+
if test -x "$HOME/.rvm/bin/rvm"
|
24
|
+
then rvm_path="$HOME/.rvm"
|
25
|
+
elif test -x "/usr/local/rvm/bin/rvm"
|
26
|
+
then rvm_path="/usr/local/rvm"
|
27
|
+
else rvm_path="$HOME/.rvm"
|
28
|
+
fi
|
29
|
+
fi
|
30
|
+
|
31
|
+
# make sure rvm is installed
|
32
|
+
if test -x "${rvm_path:-}/bin/rvm"
|
33
|
+
then true
|
34
|
+
else rvm_fail "Can not find rvm in '${rvm_path:-}'." 102
|
35
|
+
fi
|
36
|
+
|
37
|
+
if
|
38
|
+
# just rvm
|
39
|
+
test "$ruby_string" = "rvm"
|
40
|
+
then
|
41
|
+
exec "${rvm_path}/bin/$ruby_string" "$@"
|
42
|
+
|
43
|
+
elif
|
44
|
+
# Gemfile and not bundle and not in bundle exec
|
45
|
+
test -f "${BUNDLE_GEMFILE:-Gemfile}" -a \
|
46
|
+
"$1" != "bundle" -a \
|
47
|
+
-z "${BUNDLE_BIN_PATH:-}" -a -z "${RUBYOPT:-}"
|
48
|
+
then
|
49
|
+
"$0" "$ruby_string" bundle exec "$@"
|
50
|
+
|
51
|
+
else
|
52
|
+
# find and load ruby, execute the command
|
53
|
+
if
|
54
|
+
source_file="`"${rvm_path}/bin/rvm" "$ruby_string" --create do rvm env --path`" &&
|
55
|
+
test -n "${source_file:-}" &&
|
56
|
+
test -r "${source_file:-}"
|
57
|
+
then
|
58
|
+
\. "${source_file:-}" &&
|
59
|
+
exec "$@"
|
60
|
+
else
|
61
|
+
rvm_fail "Can not find ruby for '$ruby_string'." 103
|
62
|
+
fi
|
63
|
+
fi
|
@@ -0,0 +1,28 @@
|
|
1
|
+
#!/usr/bin/env bash
|
2
|
+
|
3
|
+
script=script/rvm-auto.sh
|
4
|
+
|
5
|
+
: errors
|
6
|
+
|
7
|
+
## no ruby version given
|
8
|
+
$script # status=101
|
9
|
+
|
10
|
+
## wrong ruby given
|
11
|
+
$script no_ruby_found # status=103
|
12
|
+
|
13
|
+
## no rvm found
|
14
|
+
rvm_path=random $script no_ruby_found # status=102
|
15
|
+
|
16
|
+
: proper paths
|
17
|
+
|
18
|
+
## use ruby from current dir - Gemfile is set to 1.8.7
|
19
|
+
$script . ruby -v # match=/1.8.7/
|
20
|
+
|
21
|
+
## use rvm to make sure 2.0.0 is installed
|
22
|
+
$script rvm install 2.0.0 # status=0
|
23
|
+
|
24
|
+
## use a ruby
|
25
|
+
$script 2.0.0 ruby -v # match=/2.0.0/
|
26
|
+
|
27
|
+
## retest current dir ruby still works
|
28
|
+
$script . ruby -v # match=/1.8.7/
|
metadata
ADDED
@@ -0,0 +1,76 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: rvm1-capistrano3
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.8.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Michal Papis
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2013-10-27 00:00:00 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: capistrano
|
16
|
+
prerelease: false
|
17
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
18
|
+
requirements:
|
19
|
+
- - ~>
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: "3.0"
|
22
|
+
type: :runtime
|
23
|
+
version_requirements: *id001
|
24
|
+
- !ruby/object:Gem::Dependency
|
25
|
+
name: tf
|
26
|
+
prerelease: false
|
27
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
28
|
+
requirements:
|
29
|
+
- - ~>
|
30
|
+
- !ruby/object:Gem::Version
|
31
|
+
version: 0.4.3
|
32
|
+
type: :development
|
33
|
+
version_requirements: *id002
|
34
|
+
description: RVM 1.x / Capistrano 3.x Integration Gem
|
35
|
+
email:
|
36
|
+
- mpapis@gmail.com
|
37
|
+
executables: []
|
38
|
+
|
39
|
+
extensions: []
|
40
|
+
|
41
|
+
extra_rdoc_files: []
|
42
|
+
|
43
|
+
files:
|
44
|
+
- lib/rvm1/capistrano3.rb
|
45
|
+
- lib/rvm1/capistrano3/version.rb
|
46
|
+
- lib/rvm1/tasks/capistrano3.rake
|
47
|
+
- script/rvm-auto.sh
|
48
|
+
- test/script_rvm-auto_comment_test.sh
|
49
|
+
homepage: https://github.com/rvm/rvm1-capistrano3
|
50
|
+
licenses:
|
51
|
+
- Apache 2
|
52
|
+
metadata: {}
|
53
|
+
|
54
|
+
post_install_message:
|
55
|
+
rdoc_options: []
|
56
|
+
|
57
|
+
require_paths:
|
58
|
+
- lib
|
59
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
60
|
+
requirements:
|
61
|
+
- &id003
|
62
|
+
- ">="
|
63
|
+
- !ruby/object:Gem::Version
|
64
|
+
version: "0"
|
65
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- *id003
|
68
|
+
requirements: []
|
69
|
+
|
70
|
+
rubyforge_project:
|
71
|
+
rubygems_version: 2.0.12
|
72
|
+
signing_key:
|
73
|
+
specification_version: 4
|
74
|
+
summary: RVM 1.x / Capistrano 3.x Integration Gem
|
75
|
+
test_files:
|
76
|
+
- test/script_rvm-auto_comment_test.sh
|