OSDN Git Service

adds the ['hypercontainer']['config'] attribute.
[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 #ui_port     = '9000'
21 #api_port    = '9001'
22 #store_port  = '9002'
23
24 run_list(
25   'role[docker]',
26   'recipe[screwdriver::docker-compose]',
27 )
28
29 override_attributes(
30   'screwdriver' => {
31     'docker-compose' => {
32       # REQUIRED: SCM OAuth client ID and secret
33 =begin
34       'oauth_client_id_vault_item' => {
35         'vault' => 'screwdriver',
36         'name' => 'oauth_client_id',
37         'env_context' => false,
38         'key' => 'cid',  # real hash path: "/cid"
39       },
40       'oauth_client_secret_vault_item' => {
41         'vault' => 'screwdriver',
42         'name' => 'oauth_client_secret',
43         'env_context' => false,
44         'key' => 'secret',  # real hash path: "/secret"
45       },
46 =end
47       'config' => {
48         'services' => {
49           'api' => {
50             'ports' => [
51               #"#{api_port}:80",
52             ],
53             'environment' => {
54               # REQUIRED: SCM settings
55               'SCM_PLUGIN' => 'github',  # 'gitlab' or 'github' or 'bitbucket'
56               # OAuth Callback URL: "http://#{node['fqdn']}:9001/v4/auth/login/web"
57               'SCM_USERNAME' => 'ci-tool',
58               'SCM_EMAIL' => 'citool@mail.example.com',
59               #'WEBHOOK_GITHUB_SECRET' => 'SUPER-SECRET-SIGNING-THING',
60               #'SCM_GITLAB_HOST' => 'gitlab.io.example.com',
61               #'SCM_GITLAB_PROTOCOL' => 'https',
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               #'SECRET_OAUTH_CLIENT_ID' => '${SECRET_OAUTH_CLIENT_ID}',
65               #'SECRET_OAUTH_CLIENT_SECRET' => '${SECRET_OAUTH_CLIENT_SECRET}',
66               #'SECRET_JWT_PRIVATE_KEY' => '${SECRET_JWT_PRIVATE_KEY}',
67               #'SECRET_JWT_PUBLIC_KEY' => '${SECRET_JWT_PUBLIC_KEY}',
68               #'ECOSYSTEM_UI' => "http://#{node['fqdn']}:#{ui_port}",
69               #'ECOSYSTEM_STORE' => "http://#{node['fqdn']}:#{store_port}",
70             },
71           },
72           'ui' => {
73             'ports' => [
74               #"#{ui_port}:80",
75             ],
76             'environment' => {
77               # These variables will be set by the screwdriver::docker-compose recipe automatically.
78               #'ECOSYSTEM_API' => "http://#{node['fqdn']}:#{api_port}",
79               #'ECOSYSTEM_STORE' => "http://#{node['fqdn']}:#{store_port}",
80             },
81           },
82           'store' => {
83             'ports' => [
84               #"#{store_port}:80",
85             ],
86             'environment' => {
87               # These variables will be set by the screwdriver::docker-compose recipe automatically.
88               #'ECOSYSTEM_UI' => "http://#{node['fqdn']}:#{ui_port}",
89               #'SECRET_JWT_PUBLIC_KEY' => '${SECRET_JWT_PUBLIC_KEY}',
90             },
91           },
92         },
93       },
94     },
95   },
96 )