itamae-plugin-recipe-anyenv 0.3.27 → 0.3.28
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 +4 -4
- data/lib/itamae/plugin/recipe/anyenv.rb +33 -19
- data/lib/itamae/plugin/recipe/anyenv/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 82678f915847ba064e7fdf607d193d815424e158
|
4
|
+
data.tar.gz: 0d530923780d0d958d21fdc2866b8bdda1982a91
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5aba2b08b7af06ed3c6f50b4246a0ebb3dfb32d487b7d22bfd68d005e74b23bac2c3875a05385e379b8f236c8d0549fead4a4765d5b71c9faa70ac7e77216892
|
7
|
+
data.tar.gz: f0771d09f9a35ad5378a51ebbf3598fabaff699a1592904e0244e70d0871fe7427f89cbcfab439e5aaa3cf81e85bce101895d82bbb65ff260530bb4b99560e6a
|
@@ -8,19 +8,19 @@ def run(attributes, username = ENV['USER'])
|
|
8
8
|
p :ANYENV_ROOT
|
9
9
|
p ENV['ANYENV_ROOT']
|
10
10
|
|
11
|
-
clone_anyenv
|
12
|
-
clone_anyenv_update
|
11
|
+
clone_anyenv
|
12
|
+
clone_anyenv_update
|
13
13
|
|
14
14
|
directory "#{@root_path}/envs"
|
15
15
|
|
16
|
-
install('anyenv', 'rbenv')
|
17
|
-
install('rbenv', '2.3.1')
|
18
|
-
install('anyenv', 'exenv')
|
19
|
-
install('exenv', '1.3.2')
|
16
|
+
# install('anyenv', 'rbenv')
|
17
|
+
# install('rbenv', '2.3.1')
|
18
|
+
# install('anyenv', 'exenv')
|
19
|
+
# install('exenv', '1.3.2')
|
20
20
|
|
21
21
|
|
22
22
|
|
23
|
-
|
23
|
+
install_envs(attributes)
|
24
24
|
end
|
25
25
|
|
26
26
|
private
|
@@ -29,6 +29,18 @@ def scheme
|
|
29
29
|
@scheme ||= node[:anyenv][:scheme] || 'git'
|
30
30
|
end
|
31
31
|
|
32
|
+
def install_envs
|
33
|
+
attributes[:install_versions].each do |envs|
|
34
|
+
envs.each do |env, vers|
|
35
|
+
install('anyenv', env)
|
36
|
+
|
37
|
+
vers.each { |ver| install(env, ver) }
|
38
|
+
|
39
|
+
global_version(env, vers.first)
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
32
44
|
def install(from, to)
|
33
45
|
execute <<-"EOS".gsub("\n", ' ')
|
34
46
|
export ANYENV_ROOT=#{@root_path};
|
@@ -85,13 +97,13 @@ def clone_repository(install_path, repo_path)
|
|
85
97
|
end
|
86
98
|
end
|
87
99
|
|
88
|
-
def clone_anyenv
|
100
|
+
def clone_anyenv
|
89
101
|
repo_path = "#{scheme}://github.com/riywo/anyenv.git"
|
90
|
-
clone_repository(root_path, repo_path)
|
102
|
+
clone_repository(@root_path, repo_path)
|
91
103
|
end
|
92
104
|
|
93
|
-
def clone_anyenv_update
|
94
|
-
install_path = "#{root_path}/plugins/anyenv-update"
|
105
|
+
def clone_anyenv_update
|
106
|
+
install_path = "#{@root_path}/plugins/anyenv-update"
|
95
107
|
repo_path = "#{scheme}://github.com/znz/anyenv-update.git"
|
96
108
|
clone_repository(install_path, repo_path)
|
97
109
|
end
|
@@ -127,11 +139,13 @@ end
|
|
127
139
|
# end
|
128
140
|
# end
|
129
141
|
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
#
|
135
|
-
#
|
136
|
-
|
137
|
-
#
|
142
|
+
def global_version(envname, version)
|
143
|
+
execute "#{envname} global #{version}" do
|
144
|
+
user @username if @username
|
145
|
+
command <<-EOS
|
146
|
+
#{envname} global #{version};
|
147
|
+
#{envname} rehash;
|
148
|
+
EOS
|
149
|
+
not_if "#{envname} global | grep #{version}"
|
150
|
+
end
|
151
|
+
end
|