• R/O
  • HTTP
  • SSH
  • HTTPS

grid-chef-repo: コミット

Grid環境構築用のChefリポジトリです。


コミットメタ情報

リビジョン74fe333e4009ddcf18ad748a5152cac116ed95f2 (tree)
日時2017-08-03 22:11:24
作者whitestar <whitestar@user...>
コミッターwhitestar

ログメッセージ

adds the Nexus 2 support.

変更サマリ

差分

--- a/cookbooks/nexus-grid/CHANGELOG.md
+++ b/cookbooks/nexus-grid/CHANGELOG.md
@@ -1,5 +1,10 @@
11 # nexus-grid CHANGELOG
22
3+0.1.2
4+-----
5+- adds the Nexus 2 support.
6+- adds Concourse pipeline configurations.
7+
38 0.1.1
49 -----
510 - adds a reverse proxy (nginx) service to the `nexus-grid::docker-compose` recipe.
--- a/cookbooks/nexus-grid/README.md
+++ b/cookbooks/nexus-grid/README.md
@@ -70,6 +70,7 @@ run_list(
7070 )
7171
7272 image = 'sonatype/nexus3'
73+#image = 'sonatype/nexus' # Nexus2
7374 port = '8081'
7475
7576 override_attributes(
@@ -92,12 +93,22 @@ override_attributes(
9293 'image' => image,
9394 'volumes' => [
9495 # This volume will be set by the nexus-grid::docker-compose recipe automatically.
95- #"#{node['nexus-grid']['docker-compose']['data_dir']}:/nexus-data",
96+ # * Nexus3
97+ #"#{node['nexus-grid']['docker-compose']['data_dir']}:/nexus-data:rw",
98+ # * Nexus2
99+ #"#{node['nexus-grid']['docker-compose']['data_dir']}:/sonatype-work:rw",
96100 ],
97101 'environment' => {
102+ # * Nexus3
98103 #'JAVA_MAX_HEAP' => '1200m', # passed as -Xmx. Defaults to 1200m.
99104 #'JAVA_MIN_HEAP' => '1200m', # passed as -Xms. Defaults to 1200m.
100105 #'EXTRA_JAVA_OPTS' => '', # Additional options can be passed to the JVM via this variable.
106+ # * Nexus2
107+ #'CONTEXT_PATH' => '/nexus',
108+ #'MAX_HEAP' => '768m',
109+ #'MIN_HEAP' => '256m',
110+ #'JAVA_OPTS' => '-server -XX:MaxPermSize=192m -Djava.net.preferIPv4Stack=true',
111+ #'LAUNCHER_CONF' => './conf/jetty.xml ./conf/jetty-requestlog.xml',
101112 },
102113 },
103114 },
@@ -120,6 +131,7 @@ run_list(
120131 )
121132
122133 image = 'sonatype/nexus3'
134+#image = 'sonatype/nexus' # Nexus2
123135 port = '8081'
124136 cn = 'nexus.io.example.com'
125137
@@ -153,12 +165,22 @@ override_attributes(
153165 'image' => image,
154166 'volumes' => [
155167 # This volume will be set by the nexus-grid::docker-compose recipe automatically.
156- #"#{node['nexus-grid']['docker-compose']['data_dir']}:/nexus-data",
168+ # * Nexus3
169+ #"#{node['nexus-grid']['docker-compose']['data_dir']}:/nexus-data:rw",
170+ # * Nexus2
171+ #"#{node['nexus-grid']['docker-compose']['data_dir']}:/sonatype-work:rw",
157172 ],
158173 'environment' => {
174+ # * Nexus3
159175 #'JAVA_MAX_HEAP' => '1200m', # passed as -Xmx. Defaults to 1200m.
160176 #'JAVA_MIN_HEAP' => '1200m', # passed as -Xms. Defaults to 1200m.
161177 #'EXTRA_JAVA_OPTS' => '', # Additional options can be passed to the JVM via this variable.
178+ # * Nexus2
179+ #'CONTEXT_PATH' => '/nexus',
180+ #'MAX_HEAP' => '768m',
181+ #'MIN_HEAP' => '256m',
182+ #'JAVA_OPTS' => '-server -XX:MaxPermSize=192m -Djava.net.preferIPv4Stack=true',
183+ #'LAUNCHER_CONF' => './conf/jetty.xml ./conf/jetty-requestlog.xml',
162184 },
163185 },
164186 },
--- a/cookbooks/nexus-grid/attributes/default.rb
+++ b/cookbooks/nexus-grid/attributes/default.rb
@@ -51,6 +51,7 @@ version_2_config = {
5151 },
5252 'nexus' => {
5353 'restart' => 'always',
54+ #'image' => 'sonatype/nexus', # Nexus2
5455 'image' => 'sonatype/nexus3',
5556 'ports' => [
5657 # Do not expose!
@@ -59,12 +60,22 @@ version_2_config = {
5960 ],
6061 'volumes' => [
6162 # This volume will be set by the nexus-grid::docker-compose recipe automatically.
62- #"#{node['nexus-grid']['docker-compose']['data_dir']}:/nexus-data",
63+ # * Nexus3
64+ #"#{node['nexus-grid']['docker-compose']['data_dir']}:/nexus-data:rw",
65+ # * Nexus2
66+ #"#{node['nexus-grid']['docker-compose']['data_dir']}:/sonatype-work:rw",
6367 ],
6468 'environment' => {
69+ # * Nexus3
6570 #'JAVA_MAX_HEAP' => '1200m', # passed as -Xmx. Defaults to 1200m.
6671 #'JAVA_MIN_HEAP' => '1200m', # passed as -Xms. Defaults to 1200m.
6772 #'EXTRA_JAVA_OPTS' => '', # Additional options can be passed to the JVM via this variable.
73+ # * Nexus2
74+ #'CONTEXT_PATH' => '/nexus',
75+ #'MAX_HEAP' => '768m',
76+ #'MIN_HEAP' => '256m',
77+ #'JAVA_OPTS' => '-server -XX:MaxPermSize=192m -Djava.net.preferIPv4Stack=true',
78+ #'LAUNCHER_CONF' => './conf/jetty.xml ./conf/jetty-requestlog.xml',
6879 },
6980 },
7081 },
--- a/cookbooks/nexus-grid/recipes/docker-compose.rb
+++ b/cookbooks/nexus-grid/recipes/docker-compose.rb
@@ -17,8 +17,6 @@
1717 # limitations under the License.
1818 #
1919
20-doc_url = 'https://hub.docker.com/r/sonatype/nexus3/'
21-
2220 include_recipe 'platform_utils::kernel_user_namespace'
2321 include_recipe 'docker-grid::compose'
2422
@@ -46,6 +44,10 @@ override_config_srvs = node.override['nexus-grid']['docker-compose']['config']['
4644 rproxy_vols = config_srvs['reverseproxy']['volumes'].to_a
4745 nexus_vols = config_srvs['nexus']['volumes'].to_a
4846
47+nexus_ver = config_srvs['nexus']['image'] =~ %r{^sonatype/nexus3} ? '3' : '2'
48+doc_url = 'https://hub.docker.com/r/sonatype'
49+doc_url = nexus_ver == '3' ? "#{doc_url}/nexus3/" : "#{doc_url}/nexus/"
50+
4951 ports = config_srvs['reverseproxy']['ports']
5052 override_config_srvs['reverseproxy']['ports'] = ['8081:8081'] if ports.empty?
5153
@@ -55,6 +57,9 @@ template "#{etc_dir}/nginx/nginx.conf" do
5557 group 'root'
5658 mode '0644'
5759 action :create
60+ variables(
61+ nexus_ver: nexus_ver
62+ )
5863 end
5964
6065 rproxy_vols.push("#{etc_dir}/nginx/nginx.conf:/etc/nginx/nginx.conf:ro")
@@ -67,7 +72,8 @@ resources(directory: data_dir) rescue directory data_dir do
6772 recursive true
6873 end if !data_dir.nil? && !data_dir.empty?
6974
70-nexus_vols.push("#{data_dir}:/nexus-data") if !data_dir.nil? && !data_dir.empty?
75+container_data_dir = nexus_ver == '3' ? '/nexus-data' : '/sonatype-work'
76+nexus_vols.push("#{data_dir}:#{container_data_dir}:rw") if !data_dir.nil? && !data_dir.empty?
7177
7278 if node['nexus-grid']['with_ssl_cert_cookbook']
7379 ::Chef::Recipe.send(:include, SSLCert::Helper)
--- a/cookbooks/nexus-grid/templates/default/opt/docker-compose/app/nexus/etc/nginx/nginx.conf
+++ b/cookbooks/nexus-grid/templates/default/opt/docker-compose/app/nexus/etc/nginx/nginx.conf
@@ -1,5 +1,6 @@
11 <%
22 ssl_enabled = node['nexus-grid']['with_ssl_cert_cookbook']
3+context_path = @nexus_ver == '3' ? '/' : '/nexus'
34 -%>
45 worker_processes 1;
56
@@ -24,8 +25,8 @@ http {
2425 listen 8081;
2526 <% end %>
2627
27- location / {
28- proxy_pass http://docker-nexus;
28+ location <%= context_path %> {
29+ proxy_pass http://docker-nexus<%= context_path %>;
2930 proxy_redirect off;
3031 proxy_set_header Host $http_host; # $host does not include the port number.
3132 proxy_set_header X-Real-IP $remote_addr;
--- a/cookbooks/nexus-grid/version
+++ b/cookbooks/nexus-grid/version
@@ -1 +1 @@
1-0.1.1
1+0.1.2
旧リポジトリブラウザで表示