itamae-plugin-recipe-minecraft 0.0.4 → 0.0.5
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9fe29c7f414eaf2863a9d342a181fc40ce79b402
|
4
|
+
data.tar.gz: 833e1bdd7ad907cc80c5b357dd1bf33ea7b96a81
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6176673f2b2ead945143e8008198078624264ad14fd71ee8252e20e980ae35d38bce646fecd94a0289131a716b09d71e693193f6f7ffd530d81f75bac2776eed
|
7
|
+
data.tar.gz: 8b92919760d257b0d2bf52621bfa8e1a64ebf0f11d609415d9764ec42524618fb6ed6c4aad143fb90b0bf6819dba949b660b10a4029ff7576c837fe330722dea
|
@@ -1,3 +1,16 @@
|
|
1
|
+
require 'json'
|
2
|
+
require 'open-uri'
|
3
|
+
|
4
|
+
minecraft_versions_url = 'http://s3.amazonaws.com/Minecraft.Download/versions/versions.json'
|
5
|
+
minecraft_version = node[:minecraft][:version] || JSON.parse(open(minecraft_versions_url).read)['latest']['release']
|
6
|
+
|
7
|
+
minecraft_dir = "/opt/minecraft/.minecraft/versions/#{minecraft_version}"
|
8
|
+
minecraft_client_url = "https://s3.amazonaws.com/Minecraft.Download/versions/#{minecraft_version}/#{minecraft_version}.jar"
|
9
|
+
filename = File.basename(minecraft_client_url)
|
10
|
+
minecraft_path = "#{minecraft_dir}/#{filename}"
|
11
|
+
|
12
|
+
minecraft_user = node[:minecraft][:user] || 'minecraft'
|
13
|
+
|
1
14
|
execute 'add overviewer to apt sources.list' do
|
2
15
|
command 'echo "deb http://overviewer.org/debian ./" >> /etc/apt/sources.list'
|
3
16
|
not_if 'cat /etc/apt/sources.list | grep http://overviewer.org/debian'
|
@@ -13,3 +26,13 @@ execute 'apt-get update' do
|
|
13
26
|
end
|
14
27
|
|
15
28
|
package 'minecraft-overviewer'
|
29
|
+
|
30
|
+
directory "/opt/minecraft/.minecraft/versions/#{node[:minecraft][:version]}" do
|
31
|
+
owner minecraft_user
|
32
|
+
group minecraft_user
|
33
|
+
end
|
34
|
+
|
35
|
+
execute 'download minecraft client' do
|
36
|
+
command "wget #{minecraft_client_url} -O #{minecraft_path}"
|
37
|
+
not_if "test -f #{minecraft_path}"
|
38
|
+
end
|