OSDN Git Service

refactoring.
authorwhitestar <whitestar@users.osdn.me>
Mon, 20 Aug 2018 12:22:03 +0000 (21:22 +0900)
committerwhitestar <whitestar@users.osdn.me>
Mon, 20 Aug 2018 12:22:03 +0000 (21:22 +0900)
cookbooks/screwdriver/attributes/default.rb
cookbooks/screwdriver/recipes/docker-compose.rb
roles/screwdriver-all-on-docker-override.rb
roles/screwdriver-on-docker-override.rb

index 6ae3a9b..ac69c00 100644 (file)
@@ -2,7 +2,7 @@
 # Cookbook Name:: screwdriver
 # Attributes:: default
 #
-# Copyright 2017, whitestar
+# Copyright 2017-2018, whitestar
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -158,17 +158,16 @@ default['screwdriver']['api']['config'] = {
     'tls' => false,
   },
   'executor' => {
-=begin
-    # default
     'plugin' => 'docker',
     'docker' => {
       'options' => {
         'docker' => {
           'socketPath' => '/var/run/docker.sock',
         },
-        'launchVersion' => 'stable',
+        'launchVersion' => 'latest',
       },
     },
+=begin
     # TODO: implement default settings
     'queue' => {
       'enabled' => 'false',  # EXECUTOR_QUEUE_ENABLED
@@ -191,6 +190,7 @@ default['screwdriver']['api']['config'] = {
 =begin
     'scm_a' => {  # id and display name
       'plugin' => 'github',
+      # access https://github.com/settings/developers to get an OAuth key.
       'config' => {
         # These 3 secrets should be set by the following `['screwdriver']['api']['scms_vault_items']` attribute.
         'oauthClientId' => 'YOU-PROBABLY-WANT-SOMETHING-HERE',  # The client id used for OAuth with github. GitHub OAuth (https://developer.github.com/v3/oauth/)
@@ -204,6 +204,7 @@ default['screwdriver']['api']['config'] = {
     },
     'scm_b' => {  # id and display name
       'plugin' => 'bitbucket',
+      # access https://bitbucket.org/account/user/<name>/api to get an OAuth key.
       'config' => {
         'oauthClientId' => 'YOUR-APP-KEY',
         'oauthClientSecret' => 'YOUR-APP-SECRET',
@@ -422,7 +423,7 @@ EOS
         # **DEPRECATED**: Non-Multiple SCMs setting format.
         #   - Note: Multiple SCMs not supported yet.
         #     https://github.com/screwdriver-cd/screwdriver/issues/365
-        #   - OAuth Callback URL: "http://#{cn}:9001/v4/auth/login/web"
+        #   - OAuth Callback URL: "http://#{cn}:9001/v4/auth/login"
         'SCM_PLUGIN' => 'github',  # or 'gitlab' or 'bitbucket'
         # * Commons
         'SCM_USERNAME' => 'sd-buildbot',
@@ -431,6 +432,7 @@ EOS
         'SECRET_OAUTH_CLIENT_ID' => '${SECRET_OAUTH_CLIENT_ID}',
         'SECRET_OAUTH_CLIENT_SECRET' => '${SECRET_OAUTH_CLIENT_SECRET}',
         # * GitHub only
+        # access https://github.com/settings/developers to get an OAuth account.
         'WEBHOOK_GITHUB_SECRET' => '${WEBHOOK_GITHUB_SECRET}',  #'SUPER-SECRET-SIGNING-THING'
         'SCM_GITHUB_GHE_HOST' => 'gitlab.io.example.com',  # for GHE
         'SCM_PRIVATE_REPO_SUPPORT' => 'false',
index 9566dd6..1591b94 100644 (file)
@@ -26,18 +26,6 @@ doc_url = 'https://hub.docker.com/r/screwdrivercd/screwdriver/'
 #include_recipe 'platform_utils::kernel_user_namespace'
 include_recipe 'docker-grid::compose'
 
-default_executor = {
-  'plugin' => 'docker',
-  'docker' => {
-    'options' => {
-      'docker' => {
-        'socketPath' => '/var/run/docker.sock',
-      },
-      'launchVersion' => 'stable',
-    },
-  },
-}
-
 app_dir = node['screwdriver']['docker-compose']['app_dir']
 bin_dir = node['screwdriver']['docker-compose']['bin_dir']
 config_dir = node['screwdriver']['docker-compose']['config_dir']
@@ -114,8 +102,6 @@ else
   }
 end
 
-override_api_config['executor'] = default_executor if override_api_config['executor'].empty?
-
 [
   'jwt_private_key_vault_item',
   'jwt_public_key_vault_item',
index 9d2eee1..3f0565f 100644 (file)
@@ -48,6 +48,14 @@ override_attributes(
   'screwdriver' => {
     'api' => {
       'config' => {
+        'executor' => {
+          #'plugin' => 'docker',
+          'docker' => {
+            'options' => {
+              #'launchVersion' => 'latest',
+            },
+          },
+        },
         'scms' => {
           # **REQUIRED**: SCM settings
           'github.com' => {  # id and display name
index e7212a1..52cd671 100644 (file)
@@ -48,6 +48,14 @@ override_attributes(
   'screwdriver' => {
     'api' => {
       'config' => {
+        'executor' => {
+          #'plugin' => 'docker',
+          'docker' => {
+            'options' => {
+              #'launchVersion' => 'latest',
+            },
+          },
+        },
         'scms' => {
           # **REQUIRED**: SCM settings
           'github.com' => {  # id and display name