Grid環境構築用のChefリポジトリです。
リビジョン | 74fe333e4009ddcf18ad748a5152cac116ed95f2 (tree) |
---|---|
日時 | 2017-08-03 22:11:24 |
作者 | whitestar <whitestar@user...> |
コミッター | whitestar |
adds the Nexus 2 support.
@@ -1,5 +1,10 @@ | ||
1 | 1 | # nexus-grid CHANGELOG |
2 | 2 | |
3 | +0.1.2 | |
4 | +----- | |
5 | +- adds the Nexus 2 support. | |
6 | +- adds Concourse pipeline configurations. | |
7 | + | |
3 | 8 | 0.1.1 |
4 | 9 | ----- |
5 | 10 | - adds a reverse proxy (nginx) service to the `nexus-grid::docker-compose` recipe. |
@@ -70,6 +70,7 @@ run_list( | ||
70 | 70 | ) |
71 | 71 | |
72 | 72 | image = 'sonatype/nexus3' |
73 | +#image = 'sonatype/nexus' # Nexus2 | |
73 | 74 | port = '8081' |
74 | 75 | |
75 | 76 | override_attributes( |
@@ -92,12 +93,22 @@ override_attributes( | ||
92 | 93 | 'image' => image, |
93 | 94 | 'volumes' => [ |
94 | 95 | # 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", | |
96 | 100 | ], |
97 | 101 | 'environment' => { |
102 | + # * Nexus3 | |
98 | 103 | #'JAVA_MAX_HEAP' => '1200m', # passed as -Xmx. Defaults to 1200m. |
99 | 104 | #'JAVA_MIN_HEAP' => '1200m', # passed as -Xms. Defaults to 1200m. |
100 | 105 | #'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', | |
101 | 112 | }, |
102 | 113 | }, |
103 | 114 | }, |
@@ -120,6 +131,7 @@ run_list( | ||
120 | 131 | ) |
121 | 132 | |
122 | 133 | image = 'sonatype/nexus3' |
134 | +#image = 'sonatype/nexus' # Nexus2 | |
123 | 135 | port = '8081' |
124 | 136 | cn = 'nexus.io.example.com' |
125 | 137 |
@@ -153,12 +165,22 @@ override_attributes( | ||
153 | 165 | 'image' => image, |
154 | 166 | 'volumes' => [ |
155 | 167 | # 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", | |
157 | 172 | ], |
158 | 173 | 'environment' => { |
174 | + # * Nexus3 | |
159 | 175 | #'JAVA_MAX_HEAP' => '1200m', # passed as -Xmx. Defaults to 1200m. |
160 | 176 | #'JAVA_MIN_HEAP' => '1200m', # passed as -Xms. Defaults to 1200m. |
161 | 177 | #'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', | |
162 | 184 | }, |
163 | 185 | }, |
164 | 186 | }, |
@@ -51,6 +51,7 @@ version_2_config = { | ||
51 | 51 | }, |
52 | 52 | 'nexus' => { |
53 | 53 | 'restart' => 'always', |
54 | + #'image' => 'sonatype/nexus', # Nexus2 | |
54 | 55 | 'image' => 'sonatype/nexus3', |
55 | 56 | 'ports' => [ |
56 | 57 | # Do not expose! |
@@ -59,12 +60,22 @@ version_2_config = { | ||
59 | 60 | ], |
60 | 61 | 'volumes' => [ |
61 | 62 | # 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", | |
63 | 67 | ], |
64 | 68 | 'environment' => { |
69 | + # * Nexus3 | |
65 | 70 | #'JAVA_MAX_HEAP' => '1200m', # passed as -Xmx. Defaults to 1200m. |
66 | 71 | #'JAVA_MIN_HEAP' => '1200m', # passed as -Xms. Defaults to 1200m. |
67 | 72 | #'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', | |
68 | 79 | }, |
69 | 80 | }, |
70 | 81 | }, |
@@ -17,8 +17,6 @@ | ||
17 | 17 | # limitations under the License. |
18 | 18 | # |
19 | 19 | |
20 | -doc_url = 'https://hub.docker.com/r/sonatype/nexus3/' | |
21 | - | |
22 | 20 | include_recipe 'platform_utils::kernel_user_namespace' |
23 | 21 | include_recipe 'docker-grid::compose' |
24 | 22 |
@@ -46,6 +44,10 @@ override_config_srvs = node.override['nexus-grid']['docker-compose']['config'][' | ||
46 | 44 | rproxy_vols = config_srvs['reverseproxy']['volumes'].to_a |
47 | 45 | nexus_vols = config_srvs['nexus']['volumes'].to_a |
48 | 46 | |
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 | + | |
49 | 51 | ports = config_srvs['reverseproxy']['ports'] |
50 | 52 | override_config_srvs['reverseproxy']['ports'] = ['8081:8081'] if ports.empty? |
51 | 53 |
@@ -55,6 +57,9 @@ template "#{etc_dir}/nginx/nginx.conf" do | ||
55 | 57 | group 'root' |
56 | 58 | mode '0644' |
57 | 59 | action :create |
60 | + variables( | |
61 | + nexus_ver: nexus_ver | |
62 | + ) | |
58 | 63 | end |
59 | 64 | |
60 | 65 | 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 | ||
67 | 72 | recursive true |
68 | 73 | end if !data_dir.nil? && !data_dir.empty? |
69 | 74 | |
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? | |
71 | 77 | |
72 | 78 | if node['nexus-grid']['with_ssl_cert_cookbook'] |
73 | 79 | ::Chef::Recipe.send(:include, SSLCert::Helper) |
@@ -1,5 +1,6 @@ | ||
1 | 1 | <% |
2 | 2 | ssl_enabled = node['nexus-grid']['with_ssl_cert_cookbook'] |
3 | +context_path = @nexus_ver == '3' ? '/' : '/nexus' | |
3 | 4 | -%> |
4 | 5 | worker_processes 1; |
5 | 6 |
@@ -24,8 +25,8 @@ http { | ||
24 | 25 | listen 8081; |
25 | 26 | <% end %> |
26 | 27 | |
27 | - location / { | |
28 | - proxy_pass http://docker-nexus; | |
28 | + location <%= context_path %> { | |
29 | + proxy_pass http://docker-nexus<%= context_path %>; | |
29 | 30 | proxy_redirect off; |
30 | 31 | proxy_set_header Host $http_host; # $host does not include the port number. |
31 | 32 | proxy_set_header X-Real-IP $remote_addr; |
@@ -1 +1 @@ | ||
1 | -0.1.1 | |
1 | +0.1.2 |