OSDN Git Service

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