OSDN Git Service

improves the screwdriver cookbook.
[metasearch/grid-chef-repo.git] / roles / screwdriver-all-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-all-on-docker-override'
18 description 'Screwdriver with all components 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-all-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         'scms' => {
52           # **REQUIRED**: SCM settings
53           'github.com' => {  # id and display name
54             'plugin' => 'github',
55             'config' => {
56               # These 3 secrets should be set by the following `['screwdriver']['api']['scms_vault_items']` attribute.
57               'oauthClientId' => 'YOU-PROBABLY-WANT-SOMETHING-HERE',  # The client id used for OAuth with github. GitHub OAuth (https://developer.github.com/v3/oauth/)
58               'oauthClientSecret' => 'AGAIN-SOMETHING-HERE-IS-USEFUL',  # The client secret used for OAuth with github
59               'secret' => 'SUPER-SECRET-SIGNING-THING',  # Secret to add to GitHub webhooks so that we can validate them
60               #'gheHost' => 'github.screwdriver.cd',  # [Optional] GitHub enterprise host
61               'username' => 'sd-buildbot',  # [Optional] Username for code checkout
62               'email' => 'dev-null@screwdriver.cd',  # [Optional] Email for code checkout
63               '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)
64             },
65           },
66         },
67       },
68     },
69     'docker-compose' => {
70       'network_mode_bridge' => false,
71       'config' => {
72         'services' => {
73           'api' => {
74             #'image' => 'screwdrivercd/screwdriver:latest',
75             'ports' => [
76               #"#{api_port}:80",
77             ],
78             'environment' => {
79               #'NODE_TLS_REJECT_UNAUTHORIZED' => '0',  # for self-signed cetificates
80               # The following variables will be set by the screwdriver::docker-compose recipe automatically.
81               #'ECOSYSTEM_UI' => "http://#{node['fqdn']}:#{ui_port}",
82               #'ECOSYSTEM_STORE' => "http://#{node['fqdn']}:#{store_port}",
83               #'DATASTORE_SEQUELIZE_DIALECT' => 'mysql',  # or 'postgres'
84             },
85           },
86           'ui' => {
87             #'image' => 'screwdrivercd/ui:latest',
88             'ports' => [
89               #"#{ui_port}:80",
90             ],
91             'environment' => {
92               # These variables will be set by the screwdriver::docker-compose recipe automatically.
93               #'ECOSYSTEM_API' => "http://#{node['fqdn']}:#{api_port}",
94               #'ECOSYSTEM_STORE' => "http://#{node['fqdn']}:#{store_port}",
95             },
96           },
97           'store' => {
98             #'image' => 'screwdrivercd/store:latest',
99             'ports' => [
100               #"#{store_port}:80",
101             ],
102             'environment' => {
103               # This variable will be set by the screwdriver::docker-compose recipe automatically.
104               #'ECOSYSTEM_UI' => "http://#{node['fqdn']}:#{ui_port}",
105             },
106           },
107           'db' => {
108           },
109           'screwdriver.s3' => {
110           },
111         },
112       },
113     },
114   },
115 )