From e9d1dce43b16e2e4f7e095a36a7595d9eb5a9308 Mon Sep 17 00:00:00 2001 From: whitestar Date: Wed, 15 Feb 2017 22:36:47 +0900 Subject: [PATCH] Bug fix: SSH keys directory volume mount configurations. --- cookbooks/concourse-ci/CHANGELOG.md | 4 ++++ cookbooks/concourse-ci/README.md | 25 ++++++++++++++++++------ cookbooks/concourse-ci/attributes/default.rb | 6 ++++-- cookbooks/concourse-ci/metadata.rb | 9 ++++++++- cookbooks/concourse-ci/recipes/docker-compose.rb | 8 ++++++++ 5 files changed, 43 insertions(+), 9 deletions(-) diff --git a/cookbooks/concourse-ci/CHANGELOG.md b/cookbooks/concourse-ci/CHANGELOG.md index a5c7850..bd43a50 100644 --- a/cookbooks/concourse-ci/CHANGELOG.md +++ b/cookbooks/concourse-ci/CHANGELOG.md @@ -1,6 +1,10 @@ concourse-ci CHANGELOG ====================== +0.1.4 +----- +- Bug fix: SSH keys directory volume mount configurations. + 0.1.3 ----- - moves secrets from the `docker-compose.yml` file to the `.env` file. diff --git a/cookbooks/concourse-ci/README.md b/cookbooks/concourse-ci/README.md index b9967c1..2750753 100644 --- a/cookbooks/concourse-ci/README.md +++ b/cookbooks/concourse-ci/README.md @@ -72,7 +72,7 @@ run_list( 'recipe[concourse-ci::docker-compose]', ) -image = 'concourse/concourse:2.6.0' +image = 'concourse/concourse:2.7.0' port = '18080' override_attributes( @@ -85,12 +85,20 @@ override_attributes( 'ports' => [ "#{port}:8080", ], + #'volumes' => [ + # # These volumes will be set by the concourse-ci::docker-compose recipe automatically. + # #"#{node['concourse-ci']['docker-compose']['web_keys_dir']}:/concourse-keys", + #], 'environment' => { 'CONCOURSE_EXTERNAL_URL' => "http://192.168.1.3:#{port}", }, }, 'concourse-worker' => { 'image' => image, + #'volumes' => [ + # # These volumes will be set by the concourse-ci::docker-compose recipe automatically. + # #"#{node['concourse-ci']['docker-compose']['worker_keys_dir']}:/concourse-keys", + #], }, }, }, @@ -140,14 +148,19 @@ override_attributes( #'CONCOURSE_TLS_CERT' => '/root/server.crt', #'CONCOURSE_TLS_KEY' => '/root/server.key', }, - 'volumes' => [ - # These volumes will be set by the concourse-ci::docker-compose recipe automatically. - #"#{server_cert_path(node['concourse-ci']['ssl_cert']['common_name'])}:/root/server.crt:ro", - #"#{server_key_path(node['concourse-ci']['ssl_cert']['common_name'])}:/root/server.key:ro", - ], + #'volumes' => [ + # # These volumes will be set by the concourse-ci::docker-compose recipe automatically. + # #"#{node['concourse-ci']['docker-compose']['web_keys_dir']}:/concourse-keys", + # #"#{server_cert_path(node['concourse-ci']['ssl_cert']['common_name'])}:/root/server.crt:ro", + # #"#{server_key_path(node['concourse-ci']['ssl_cert']['common_name'])}:/root/server.key:ro", + #], }, 'concourse-worker' => { 'image' => image, + #'volumes' => [ + # # These volumes will be set by the concourse-ci::docker-compose recipe automatically. + # #"#{node['concourse-ci']['docker-compose']['worker_keys_dir']}:/concourse-keys", + #], }, }, }, diff --git a/cookbooks/concourse-ci/attributes/default.rb b/cookbooks/concourse-ci/attributes/default.rb index c2c4f13..ec652ca 100644 --- a/cookbooks/concourse-ci/attributes/default.rb +++ b/cookbooks/concourse-ci/attributes/default.rb @@ -83,7 +83,8 @@ version_1_config = { #'8443:8443', # https ], 'volumes' => [ - "#{node['concourse-ci']['docker-compose']['web_keys_dir']}:/concourse-keys", + # These volumes will be set by the concourse-ci::docker-compose recipe automatically. + #"#{node['concourse-ci']['docker-compose']['web_keys_dir']}:/concourse-keys", ], 'environment' => { #'CONCOURSE_TLS_BIND_PORT' => '8443', # activate HTTPS @@ -106,7 +107,8 @@ version_1_config = { ], 'command' => 'worker', 'volumes' => [ - "#{node['concourse-ci']['docker-compose']['worker_keys_dir']}:/concourse-keys", + # These volumes will be set by the concourse-ci::docker-compose recipe automatically. + #"#{node['concourse-ci']['docker-compose']['worker_keys_dir']}:/concourse-keys", ], 'environment' => { 'CONCOURSE_TSA_HOST' => 'concourse-web', diff --git a/cookbooks/concourse-ci/metadata.rb b/cookbooks/concourse-ci/metadata.rb index 1e7c95b..c554a4b 100644 --- a/cookbooks/concourse-ci/metadata.rb +++ b/cookbooks/concourse-ci/metadata.rb @@ -5,10 +5,17 @@ maintainer_email '' license 'Apache 2.0' description 'Installs/Configures Concourse CI by Docker Compose' long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) -version '0.1.3' +version '0.1.4' source_url 'http://scm.osdn.jp/gitroot/metasearch/grid-chef-repo.git' issues_url 'https://osdn.jp/projects/metasearch/ticket' +supports 'ubuntu', '>= 14.04' +=begin +%w( centos redhat ).each do |os| + supports os, '>= 8.0' +end +=end + depends 'docker-grid', '>= 0.2.7' depends 'platform_utils', '>= 0.4.3' depends 'ssl_cert', '>= 0.3.7' diff --git a/cookbooks/concourse-ci/recipes/docker-compose.rb b/cookbooks/concourse-ci/recipes/docker-compose.rb index a12fcf5..23aeea4 100644 --- a/cookbooks/concourse-ci/recipes/docker-compose.rb +++ b/cookbooks/concourse-ci/recipes/docker-compose.rb @@ -150,6 +150,8 @@ web_vols = config_srvs['concourse-web']['volumes'].to_a web_ports = config_srvs['concourse-web']['ports'] override_config_srvs['concourse-web']['ports'] = ['8080:8080'] if web_ports.empty? +web_vols.push("#{node['concourse-ci']['docker-compose']['web_keys_dir']}:/concourse-keys") + web_password_reset = node['concourse-ci']['docker-compose']['web_password_reset'] basic_auth_passwd = nil web_password_vault_item = node['concourse-ci']['docker-compose']['web_password_vault_item'] @@ -201,6 +203,12 @@ force_override_config_srvs['concourse-web']['environment'] = web_envs unless web # reset vlumes array. override_config_srvs['concourse-web']['volumes'] = web_vols unless web_vols.empty? +# Worker +worker_vols = config_srvs['concourse-worker']['volumes'].to_a +worker_vols.push("#{node['concourse-ci']['docker-compose']['worker_keys_dir']}:/concourse-keys") +# reset vlumes array. +override_config_srvs['concourse-worker']['volumes'] = worker_vols unless worker_vols.empty? + template env_file do source 'opt/docker-compose/app/concourse/.env' owner 'root' -- 2.11.0