• R/O
  • HTTP
  • SSH
  • HTTPS

grid-chef-repo: コミット

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


コミットメタ情報

リビジョンb8fce998ea8955d921ae718917956fe1b886730f (tree)
日時2018-04-29 22:46:55
作者whitestar <whitestar@user...>
コミッターwhitestar

ログメッセージ

fixes format version detection of a local docker-compose.yml.

変更サマリ

差分

--- a/cookbooks/concourse-ci/CHANGELOG.md
+++ b/cookbooks/concourse-ci/CHANGELOG.md
@@ -1,6 +1,10 @@
11 concourse-ci CHANGELOG
22 ======================
33
4+0.2.6
5+-----
6+- fixes format version detection of a local `docker-compose.yml`.
7+
48 0.2.5
59 -----
610 - adds the docker-compose v2 format support.
--- a/cookbooks/concourse-ci/README.md
+++ b/cookbooks/concourse-ci/README.md
@@ -98,8 +98,8 @@ port = '18080'
9898 override_attributes(
9999 'concourse-ci' => {
100100 'docker-compose' => {
101+ # Version 1 docker-compose format (default)
101102 'config' => {
102- # Version 1 docker-compose format
103103 'concourse-web' => {
104104 'image' => image,
105105 'ports' => [
@@ -122,6 +122,35 @@ override_attributes(
122122 #],
123123 },
124124 },
125+=begin
126+ # Version 2 docker-compose format
127+ 'config_format_version' => '2',
128+ 'config' => {
129+ 'services' => {
130+ 'concourse-web' => {
131+ 'image' => image,
132+ 'ports' => [
133+ "#{port}:8080",
134+ ],
135+ #'volumes' => [
136+ # # These volumes will be set by the concourse-ci::docker-compose recipe automatically.
137+ # #"#{node['concourse-ci']['docker-compose']['web_keys_dir']}:/concourse-keys",
138+ #],
139+ 'environment' => {
140+ 'CONCOURSE_EXTERNAL_URL' => "http://192.168.1.3:#{port}",
141+ #'CONCOURSE_RESOURCE_CHECKING_INTERVAL' => '1m', # default
142+ },
143+ },
144+ 'concourse-worker' => {
145+ 'image' => image,
146+ #'volumes' => [
147+ # # These volumes will be set by the concourse-ci::docker-compose recipe automatically.
148+ # #"#{node['concourse-ci']['docker-compose']['worker_keys_dir']}:/concourse-keys",
149+ #],
150+ },
151+ },
152+ },
153+=end
125154 },
126155 },
127156 )
--- a/cookbooks/concourse-ci/attributes/default.rb
+++ b/cookbooks/concourse-ci/attributes/default.rb
@@ -2,7 +2,7 @@
22 # Cookbook Name:: concourse-ci
33 # Attributes:: default
44 #
5-# Copyright 2017, whitestar
5+# Copyright 2017-2018, whitestar
66 #
77 # Licensed under the Apache License, Version 2.0 (the "License");
88 # you may not use this file except in compliance with the License.
@@ -181,5 +181,9 @@ version_2_config = {
181181 'services' => new_config,
182182 }
183183
184-default['concourse-ci']['docker-compose']['config'] = \
185- node['concourse-ci']['docker-compose']['config_format_version'] == '1' ? version_1_config : version_2_config
184+case node['concourse-ci']['docker-compose']['config_format_version'].to_i
185+when 1
186+ default['concourse-ci']['docker-compose']['config'] = version_1_config
187+when 2
188+ default['concourse-ci']['docker-compose']['config'] = version_2_config
189+end
--- a/cookbooks/concourse-ci/recipes/docker-compose.rb
+++ b/cookbooks/concourse-ci/recipes/docker-compose.rb
@@ -2,7 +2,7 @@
22 # Cookbook Name:: concourse-ci
33 # Recipe:: docker-compose
44 #
5-# Copyright 2017, whitestar
5+# Copyright 2017-2018, whitestar
66 #
77 # Licensed under the Apache License, Version 2.0 (the "License");
88 # you may not use this file except in compliance with the License.
@@ -87,16 +87,16 @@ config_srvs_local = nil
8787 if File.exist?(config_file)
8888 require 'yaml'
8989 config_srvs_local = YAML.load_file(config_file)
90- config_srvs_local = config_srvs_local['services'] if config_srvs_local.key?('version') && config_srvs_local['version'] == '2'
90+ config_srvs_local = config_srvs_local['services'] if config_srvs_local.key?('version') && config_srvs_local['version'].to_i >= 2
9191 end
9292
9393 config_format_version = node['concourse-ci']['docker-compose']['config_format_version']
9494
95-# if config_format_version == '1'
95+# if config_format_version.to_i == 1
9696 config_srvs = node['concourse-ci']['docker-compose']['config']
9797 override_config_srvs = node.override['concourse-ci']['docker-compose']['config']
9898 force_override_config_srvs = node.force_override['concourse-ci']['docker-compose']['config']
99-if config_format_version == '2'
99+if config_format_version.to_i == 2
100100 config_srvs = config_srvs['services']
101101 override_config_srvs = override_config_srvs['services']
102102 force_override_config_srvs = force_override_config_srvs['services']
@@ -263,7 +263,7 @@ if node['concourse-ci']['docker-compose']['import_ca']
263263 = "/bin/sh -c \"#{import_ca_script} && #{image_entrypoint} web\""
264264 override_config_srvs['concourse-worker']['entrypoint'] \
265265 = "/bin/sh -c \"#{import_ca_script} && #{image_entrypoint} worker\""
266- if config_format_version == '2'
266+ if config_format_version.to_i == 2
267267 node.rm('concourse-ci', 'docker-compose', 'config', 'services', 'concourse-web', 'command')
268268 node.rm('concourse-ci', 'docker-compose', 'config', 'services', 'concourse-worker', 'command')
269269 else
--- a/cookbooks/concourse-ci/version
+++ b/cookbooks/concourse-ci/version
@@ -1 +1 @@
1-0.2.5
1+0.2.6
旧リポジトリブラウザで表示