OSDN Git Service

6891ddce3ce8fe589a172292882a6c92297c11ec
[metasearch/grid-chef-repo.git] / roles / screwdriver-on-docker.rb
1 #
2 # Copyright 2017, 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'
18 description 'Screwdriver on Docker'
19
20 # Default ports
21 #ui_port     = '9000'
22 #api_port    = '9001'
23 #store_port  = '9002'
24
25 run_list(
26   'role[docker]',
27   'recipe[screwdriver::docker-compose]',
28 )
29
30 override_attributes(
31   'screwdriver' => {
32     'api' => {
33       'config' => {
34         'scms' => {
35           'github.com' => {  # id and display name
36             'plugin' => 'github',
37             'config' => {
38               # **REQUIRED**: SCM OAuth client ID, secret and webhook secret (GitHub only)
39 =begin
40               # These 3 secrets should be set by the following `['screwdriver']['api']['scms_vault_items']` attribute.
41               'oauthClientId' => 'YOU-PROBABLY-WANT-SOMETHING-HERE',  # The client id used for OAuth with github. GitHub OAuth (https://developer.github.com/v3/oauth/)
42               'oauthClientSecret' => 'AGAIN-SOMETHING-HERE-IS-USEFUL',  # The client secret used for OAuth with github
43               'secret' => 'SUPER-SECRET-SIGNING-THING',  # Secret to add to GitHub webhooks so that we can validate them
44               #'gheHost' => 'github.screwdriver.cd',  # [Optional] GitHub enterprise host
45               'username' => 'sd-buildbot',  # [Optional] Username for code checkout
46               'email' => 'dev-null@screwdriver.cd',  # [Optional] Email for code checkout
47               '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)
48 =end
49             },
50           },
51         },
52       },
53     },
54     'docker-compose' => {
55       'config' => {
56         'services' => {
57           'api' => {
58             'ports' => [
59               #"#{api_port}:80",
60             ],
61             'environment' => {
62               #'NODE_TLS_REJECT_UNAUTHORIZED' => '0',  # for self-signed cetificates
63               # The following variables will be set by the screwdriver::docker-compose recipe automatically.
64               #'ECOSYSTEM_UI' => "http://#{node['fqdn']}:#{ui_port}",
65               #'ECOSYSTEM_STORE' => "http://#{node['fqdn']}:#{store_port}",
66             },
67           },
68           'ui' => {
69             'ports' => [
70               #"#{ui_port}:80",
71             ],
72             'environment' => {
73               # These variables will be set by the screwdriver::docker-compose recipe automatically.
74               #'ECOSYSTEM_API' => "http://#{node['fqdn']}:#{api_port}",
75               #'ECOSYSTEM_STORE' => "http://#{node['fqdn']}:#{store_port}",
76             },
77           },
78           'store' => {
79             'ports' => [
80               #"#{store_port}:80",
81             ],
82             'environment' => {
83               # This variable will be set by the screwdriver::docker-compose recipe automatically.
84               #'ECOSYSTEM_UI' => "http://#{node['fqdn']}:#{ui_port}",
85             },
86           },
87         },
88       },
89     },
90   },
91 )