• R/O
  • HTTP
  • SSH
  • HTTPS

grid-chef-repo: コミット

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


コミットメタ情報

リビジョンcbac76746ae55b8cf5386916ed3f3d2198701b3d (tree)
日時2018-02-03 22:49:51
作者whitestar <whitestar@user...>
コミッターwhitestar

ログメッセージ

adds PostgreSQL support.

変更サマリ

差分

--- a/cookbooks/screwdriver/CHANGELOG.md
+++ b/cookbooks/screwdriver/CHANGELOG.md
@@ -1,5 +1,10 @@
11 # screwdriver CHANGELOG
22
3+0.5.0
4+-----
5+- adds PostgreSQL support.
6+- fixes typo.
7+
38 0.4.0
49 -----
510 - adds MySQL support.
--- a/cookbooks/screwdriver/README.md
+++ b/cookbooks/screwdriver/README.md
@@ -656,6 +656,7 @@ override_attributes(
656656
657657 If you use database other than sqlite, its database initialization will takes a few tens of seconds.
658658 You should run a database container only at the beginning and then start the others.
659+
659660 ```
660661 $ sudo docker-compose up -d db
661662 ...
--- a/cookbooks/screwdriver/attributes/default.rb
+++ b/cookbooks/screwdriver/attributes/default.rb
@@ -418,6 +418,21 @@ when 'mysql'
418418 #'MYSQL_DATABASE' => 'screwdriver',
419419 },
420420 }
421+when 'postgres'
422+ version_2_config['services']['db'] = {
423+ 'image' => 'postgres:9',
424+ 'volumes' => [
425+ # This variable will be set by the screwdriver::docker-compose recipe automatically.
426+ #"#{node['screwdriver']['docker-compose']['data_dir']}/postgres:/database:rw",
427+ ],
428+ 'environment' => {
429+ # These variables will be set by the screwdriver::docker-compose recipe automatically.
430+ #'POSTGRES_USER' => '${DB_USERNAME}',
431+ #'POSTGRES_PASSWORD' => '${DB_PASSWORD}',
432+ #'POSTGRES_DB' => 'screwdriver',
433+ #'PGDATA' => '/database',
434+ },
435+ }
421436 end
422437
423438 default['screwdriver']['docker-compose']['config'] = version_2_config
--- a/cookbooks/screwdriver/recipes/docker-compose.rb
+++ b/cookbooks/screwdriver/recipes/docker-compose.rb
@@ -244,7 +244,7 @@ case db_dialect
244244 when 'sqlite'
245245 api_vols.push("#{data_dir}:/sd-data:rw")
246246 api_envs['DATASTORE_SEQUELIZE_STORAGE'] = '/sd-data/storage.db'
247-when 'mysql'
247+when 'mysql', 'postgres'
248248 override_config_srvs['api']['links'] = ['db']
249249 api_envs['DATASTORE_SEQUELIZE_HOST'] = 'db'
250250 end
@@ -270,6 +270,20 @@ if db_dialect != 'sqlite'
270270 db_envs['MYSQL_PASSWORD'] = '${DB_PASSWORD}' unless db_password.nil?
271271 db_envs['MYSQL_ROOT_PASSWORD'] = '${DB_ROOT_PASSWORD}' unless db_root_password.nil?
272272 db_vols.push("#{mysql_data_dir}:/var/lib/mysql:rw")
273+ when 'postgres'
274+ pg_data_dir = "#{data_dir}/postgres"
275+ resources(directory: pg_data_dir) rescue directory pg_data_dir do
276+ owner 'root'
277+ group 'root'
278+ mode '0755'
279+ recursive true
280+ end
281+
282+ db_envs['POSTGRES_DB'] = api_envs_org['DATASTORE_SEQUELIZE_DATABASE']
283+ db_envs['POSTGRES_USER'] = '${DB_USERNAME}' unless db_username.nil?
284+ db_envs['POSTGRES_PASSWORD'] = '${DB_PASSWORD}' unless db_password.nil?
285+ db_envs['PGDATA'] = '/database'
286+ db_vols.push("#{pg_data_dir}:/database:rw")
273287 end
274288 end
275289
--- a/cookbooks/screwdriver/version
+++ b/cookbooks/screwdriver/version
@@ -1 +1 @@
1-0.4.0
1+0.5.0
旧リポジトリブラウザで表示