OSDN Git Service

bug fix.
[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 docker_skip_setup = false
21 docker_ver_on_centos = '17.12.1.ce-1'
22 docker_ver_on_ubuntu = '17.12.1~ce-0'
23 docker_compose_skip_setup = false
24 docker_compose_ver = '1.21.2'
25 docker_bip        = '192.168.100.1/24'
26 docker_fixed_cidr = '192.168.100.0/24'
27 network_mode_bridge = false
28 api_ver    = 'latest'
29 ui_ver     = 'latest'
30 store_ver  = 'latest'
31 launch_ver = 'latest'
32
33 # Default ports
34 #ui_port     = '9000'
35 #api_port    = '9001'
36 #store_port  = '9002'
37
38 run_list(
39   'role[screwdriver-on-docker]',
40 )
41
42 override_attributes(
43   'docker-grid' => {
44     'engine' => {
45       'skip_setup' => docker_skip_setup,
46       #'version' => '',  # '' (=latest) or exact version
47       'version_on_centos' => docker_ver_on_centos,  # '18.06.0.ce-3', '18.03.1.ce-1', '17.12.1.ce-1'
48       'version_on_ubuntu' => docker_ver_on_ubuntu,  # '18.06.0~ce~3-0', '18.03.1~ce-0', '17.12.1~ce-0' 
49       #'storage-driver_on_centos' => 'overlay',   # defacto: 'devicemapper'
50       #'storage-driver_on_ubuntu' => 'overlay2',  # defacto: 'aufs'
51       'daemon_extra_options' => [
52         '-H fd://',
53         "--bip=#{docker_bip} --fixed-cidr=#{docker_fixed_cidr}",
54       ].join(' '),
55     },
56     'compose' => {
57       'skip_setup' => docker_compose_skip_setup,
58       'version' => docker_compose_ver,
59     },
60   },
61   'screwdriver' => {
62     'api' => {
63       'config' => {
64         'executor' => {
65           #'plugin' => 'docker',
66           'docker' => {
67             'options' => {
68               'launchVersion' => launch_ver,
69             },
70           },
71         },
72         'scms' => {
73           # **REQUIRED**: SCM settings
74           'github.com' => {  # id and display name
75             'plugin' => 'github',
76             'config' => {
77               # These 3 secrets should be set by the following `['screwdriver']['api']['scms_vault_items']` attribute.
78               'oauthClientId' => 'YOU-PROBABLY-WANT-SOMETHING-HERE',  # The client id used for OAuth with github. GitHub OAuth (https://developer.github.com/v3/oauth/)
79               'oauthClientSecret' => 'AGAIN-SOMETHING-HERE-IS-USEFUL',  # The client secret used for OAuth with github
80               'secret' => 'SUPER-SECRET-SIGNING-THING',  # Secret to add to GitHub webhooks so that we can validate them
81               #'gheHost' => 'github.screwdriver.cd',  # [Optional] GitHub enterprise host
82               'username' => 'sd-buildbot',  # [Optional] Username for code checkout
83               'email' => 'dev-null@screwdriver.cd',  # [Optional] Email for code checkout
84               '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)
85             },
86           },
87         },
88       },
89     },
90     'docker-compose' => {
91       'network_mode_bridge' => network_mode_bridge,
92       'config' => {
93         'services' => {
94           'api' => {
95             'image' => "screwdrivercd/screwdriver:#{api_ver}",
96             'ports' => [
97               #"#{api_port}:80",
98             ],
99             'environment' => {
100               #'NODE_TLS_REJECT_UNAUTHORIZED' => '0',  # for self-signed cetificates
101               # The following variables will be set by the screwdriver::docker-compose recipe automatically.
102               #'ECOSYSTEM_UI' => "http://#{node['fqdn']}:#{ui_port}",
103               #'ECOSYSTEM_STORE' => "http://#{node['fqdn']}:#{store_port}",
104             },
105           },
106           'ui' => {
107             'image' => "screwdrivercd/ui:#{ui_ver}",
108             'ports' => [
109               #"#{ui_port}:80",
110             ],
111             'environment' => {
112               # These variables will be set by the screwdriver::docker-compose recipe automatically.
113               #'ECOSYSTEM_API' => "http://#{node['fqdn']}:#{api_port}",
114               #'ECOSYSTEM_STORE' => "http://#{node['fqdn']}:#{store_port}",
115             },
116           },
117           'store' => {
118             'image' => "screwdrivercd/store:#{store_ver}",
119             'ports' => [
120               #"#{store_port}:80",
121             ],
122             'environment' => {
123               # This variable will be set by the screwdriver::docker-compose recipe automatically.
124               #'ECOSYSTEM_UI' => "http://#{node['fqdn']}:#{ui_port}",
125             },
126           },
127         },
128       },
129     },
130   },
131 )