OSDN Git Service

refactoring.
[metasearch/grid-chef-repo.git] / roles / screwdriver-on-docker-override.rb
1 #
2 # Copyright 2018, whitestar
3 #
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
7 #
8 #     http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15 #
16
17 name 'screwdriver-on-docker-override'
18 description 'Screwdriver on Docker (customized)'
19
20 # Default ports
21 #ui_port     = '9000'
22 #api_port    = '9001'
23 #store_port  = '9002'
24
25 run_list(
26   'role[screwdriver-on-docker]',
27 )
28
29 override_attributes(
30   'docker-grid' => {
31     'engine' => {
32       #'skip_setup' => true,  # default: false
33       #'version' => '',  # '' (=latest) or exact version
34       #'version_on_centos' => '17.12.1.ce-1',  # '18.06.0.ce-3', '18.03.1.ce-1'
35       #'version_on_ubuntu' => '17.12.1~ce-0',  # '18.06.0~ce~3-0', '18.03.1~ce-0' 
36       #'storage-driver_on_centos' => 'overlay',   # defacto: 'devicemapper'
37       #'storage-driver_on_ubuntu' => 'overlay2',  # defacto: 'aufs'
38       'daemon_extra_options' => [
39         '-H fd://',
40         '--bip=192.168.100.1/24 --fixed-cidr=192.168.100.0/24',
41       ].join(' '),
42     },
43     'compose' => {
44       #'skip_setup' => true,  # default: false
45       'release_base_url' => 'https://github.com/docker/compose/releases/download/1.21.2',
46     },
47   },
48   'screwdriver' => {
49     'api' => {
50       'config' => {
51         'executor' => {
52           #'plugin' => 'docker',
53           'docker' => {
54             'options' => {
55               #'launchVersion' => 'latest',
56             },
57           },
58         },
59         'scms' => {
60           # **REQUIRED**: SCM settings
61           'github.com' => {  # id and display name
62             'plugin' => 'github',
63             'config' => {
64               # These 3 secrets should be set by the following `['screwdriver']['api']['scms_vault_items']` attribute.
65               'oauthClientId' => 'YOU-PROBABLY-WANT-SOMETHING-HERE',  # The client id used for OAuth with github. GitHub OAuth (https://developer.github.com/v3/oauth/)
66               'oauthClientSecret' => 'AGAIN-SOMETHING-HERE-IS-USEFUL',  # The client secret used for OAuth with github
67               'secret' => 'SUPER-SECRET-SIGNING-THING',  # Secret to add to GitHub webhooks so that we can validate them
68               #'gheHost' => 'github.screwdriver.cd',  # [Optional] GitHub enterprise host
69               'username' => 'sd-buildbot',  # [Optional] Username for code checkout
70               'email' => 'dev-null@screwdriver.cd',  # [Optional] Email for code checkout
71               'privateRepo' => false,  # [Optional] Set to true to support private repo; will need read and write access to public and private repos (https://developer.github.com/v3/oauth/#scopes)
72             },
73           },
74         },
75       },
76     },
77     'docker-compose' => {
78       'network_mode_bridge' => false,
79       'config' => {
80         'services' => {
81           'api' => {
82             #'image' => 'screwdrivercd/screwdriver:latest',
83             'ports' => [
84               #"#{api_port}:80",
85             ],
86             'environment' => {
87               #'NODE_TLS_REJECT_UNAUTHORIZED' => '0',  # for self-signed cetificates
88               # The following variables will be set by the screwdriver::docker-compose recipe automatically.
89               #'ECOSYSTEM_UI' => "http://#{node['fqdn']}:#{ui_port}",
90               #'ECOSYSTEM_STORE' => "http://#{node['fqdn']}:#{store_port}",
91             },
92           },
93           'ui' => {
94             #'image' => 'screwdrivercd/ui:latest',
95             'ports' => [
96               #"#{ui_port}:80",
97             ],
98             'environment' => {
99               # These variables will be set by the screwdriver::docker-compose recipe automatically.
100               #'ECOSYSTEM_API' => "http://#{node['fqdn']}:#{api_port}",
101               #'ECOSYSTEM_STORE' => "http://#{node['fqdn']}:#{store_port}",
102             },
103           },
104           'store' => {
105             #'image' => 'screwdrivercd/store:latest',
106             'ports' => [
107               #"#{store_port}:80",
108             ],
109             'environment' => {
110               # This variable will be set by the screwdriver::docker-compose recipe automatically.
111               #'ECOSYSTEM_UI' => "http://#{node['fqdn']}:#{ui_port}",
112             },
113           },
114         },
115       },
116     },
117   },
118 )