OSDN Git Service

add minim server v2.x support.
authorwhitestar <whitestar@users.osdn.me>
Mon, 3 Jan 2022 03:01:51 +0000 (12:01 +0900)
committerwhitestar <whitestar@users.osdn.me>
Mon, 3 Jan 2022 03:01:51 +0000 (12:01 +0900)
cookbooks/minim-server/CHANGELOG.md
cookbooks/minim-server/README.md
cookbooks/minim-server/attributes/default.rb
cookbooks/minim-server/templates/default/opt/docker-compose/app/minim-server/Dockerfile
cookbooks/minim-server/templates/default/opt/docker-compose/app/minim-server/Dockerfile.armhf
cookbooks/minim-server/templates/default/opt/docker-compose/app/minim-server/minimserver2.config [new file with mode: 0644]
cookbooks/minim-server/version
roles/minim-server-on-docker.rb

index 6a30cb8..8a1b4b3 100644 (file)
@@ -1,5 +1,9 @@
 # minim-server CHANGELOG
 
+0.4.0
+-----
+- add v2.x support.
+
 0.3.0
 -----
 - rename image.
index ca7e11d..9f0c76a 100644 (file)
@@ -74,6 +74,17 @@ run_list(
 override_attributes(
   'minim-server' => {
     'docker-compose' => {
+      'dot_env' => {
+        # the official image
+        # https://hub.docker.com/r/minimworld/minimserver
+        'REGISTRY' => 'minimworld',
+        'NAME' => 'minimserver',
+        'MINIM_VER' => 'latest',  # latest-arm, latest-arm64
+        # Local build
+        #'REGISTRY' => 'yourname',
+        #'NAME' => 'minimserver',
+        #'MINIM_VER' => '0.8.5.2',
+      },
       'config' => {
         'services' => {
           'minim-server' => {
@@ -93,7 +104,7 @@ override_attributes(
 - Author:: whitestar at osdn.jp
 
 ```text
-Copyright 2018, whitestar
+Copyright 2018-2022, whitestar
 
 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
index 357917f..e19a0dd 100644 (file)
@@ -2,7 +2,7 @@
 # Cookbook Name:: minim-server
 # Attributes:: default
 #
-# Copyright 2018-2019, whitestar
+# Copyright 2018-2022, whitestar
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -26,11 +26,11 @@ case node['kernel']['machine']
 when 'x86_64'
   image_name = 'minimserver'
   base_image = 'java:8-jre'
-  download_url = "http://jminim.com/cada/MinimServer-#{minim_ver}-linux-intel.tar.gz"
+  download_url = "https://jminim.com/brac/MinimServer-#{minim_ver}-linux-intel.tar.gz"
 when 'armv7l'
   image_name = 'minimserver-armhf'
   base_image = 'arm32v7/openjdk:8-jre'
-  download_url = "http://jminim.com/cada/MinimServer-#{minim_ver}-linux-armhf.tar.gz"
+  download_url = "https://jminim.com/brac/MinimServer-#{minim_ver}-linux-armhf.tar.gz"
 end
 
 default['minim-server']['Dockerfile'] = {
@@ -49,13 +49,13 @@ default['minim-server']['docker-compose']['data_dir'] = "#{node['minim-server'][
 
 default['minim-server']['docker-compose']['dot_env'] = {
   'NAME' => image_name,
-  'MINIM_VER' => minim_ver,
+  'MINIM_VER' => minim_ver,  # 0.8.5.2, 2.1, 2.1-arm, latest, latest-arm
   # archive url
   'url' => download_url,
   # already not found!
   #'url' => 'http://jminim.com/cada/MinimServer-0.8.4-linux-x64.tar.gz',
   # Internal registry context, e.g. gitlab.io.example.com:5050/images
-  'REGISTRY' => 'local',
+  'REGISTRY' => 'local',  # or minimworld (official registry)
 }
 
 force_override['minim-server']['docker-compose']['config_format_version'] = '2'
@@ -64,12 +64,6 @@ version_2_config = {
   'version' => '2',
   'services' => {
     'minim-server' => {
-      'build' => {
-        'context' => './',
-        'args' => {
-          'url' => '${url}',
-        },
-      },
       'image' => '${REGISTRY}/${NAME}:${MINIM_VER}',
       'restart' => 'always',
       'network_mode' => 'host',
@@ -81,4 +75,14 @@ version_2_config = {
   },
 }
 
+node_dot_env = node['minim-server']['docker-compose']['dot_env']
+unless node_dot_env['REGISTRY'] == 'minimworld'  # Official registry
+  version_2_config['services']['minim-server']['build'] = {
+    'context' => './',
+    'args' => {
+      'url' => '${url}',
+    },
+  }
+end
+
 default['minim-server']['docker-compose']['config'] = version_2_config
index fefbeac..8e6a511 100644 (file)
@@ -1,11 +1,11 @@
 FROM <%= node['minim-server']['Dockerfile']['FROM'] %>
 
-ARG url=http://jminim.com/cada/MinimServer-0.8.5.2-linux-intel.tar.gz
+ARG url=https://jminim.com/brac/MinimServer-0.8.5.2-linux-intel.tar.gz
 
 RUN wget -O /opt/MinimServer.tar.gz ${url} && \
-               cd /opt && \
-               tar xf MinimServer.tar.gz && \
-               rm MinimServer.tar.gz
+       cd /opt && \
+       tar xf MinimServer.tar.gz && \
+       rm MinimServer.tar.gz
 
 COPY ./minimserver.config /opt/minimserver/data/minimserver.config
 
index eb6384c..58c0a58 100644 (file)
@@ -1,6 +1,6 @@
 FROM <%= node['minim-server']['Dockerfile']['FROM'] %>
 
-ARG url=http://jminim.com/cada/MinimServer-0.8.5.2-linux-armhf.tar.gz
+ARG url=https://jminim.com/brac/MinimServer-0.8.5.2-linux-armhf.tar.gz
 
 RUN apt-get update -y && \
     apt-get install -y --no-install-recommends wget && \
diff --git a/cookbooks/minim-server/templates/default/opt/docker-compose/app/minim-server/minimserver2.config b/cookbooks/minim-server/templates/default/opt/docker-compose/app/minim-server/minimserver2.config
new file mode 100644 (file)
index 0000000..989ddb5
--- /dev/null
@@ -0,0 +1,9 @@
+.configVersion = 2.0.145
+.licenseType = starter
+minimserver.activeProfile = default
+http.listenerPort = 9790
+minimserver.systemUpdateID = 1
+minimserver.configVersion = 2.0.169
+minimserver.license = 2.0.4
+minimserver.welcomePage = no
+minimserver.contentDir = /media
index 7cd462e..296cfc4 100644 (file)
@@ -28,4 +28,19 @@ default_attributes(
 )
 
 override_attributes(
+  'minim-server' => {
+    'docker-compose' => {
+      'dot_env' => {
+        # the official image
+        # https://hub.docker.com/r/minimworld/minimserver
+        'REGISTRY' => 'minimworld',
+        'NAME' => 'minimserver',
+        'MINIM_VER' => 'latest',  # latest-arm, latest-arm64
+        # Local build
+        #'REGISTRY' => 'yourname',
+        #'NAME' => 'minimserver',
+        #'MINIM_VER' => '0.8.5.2',
+      },
+    },
+  },
 )