OSDN Git Service

improves devops-suite roles.
[metasearch/grid-chef-repo.git] / roles / concourse-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 'concourse-on-docker'
18 description 'Concourse on Docker'
19
20 image = 'concourse/concourse'
21 #port = '8080'  # '8443' (for https)
22 #concourse_cn = 'concourse.io.example.com'
23
24 run_list(
25   #'recipe[ssl_cert::server_key_pairs]',  # for https
26   'role[docker]',
27   'recipe[concourse-ci::docker-compose]',
28   #'recipe[concourse-ci::fly]',
29 )
30
31 #env_run_lists()
32
33 #default_attributes()
34
35 override_attributes(
36   # for https
37   'ssl_cert' => {
38     #'common_names' => [
39       #concourse_cn,
40     #],
41   },
42   'docker-grid' => {
43     'engine' => {
44       'skip_setup' => false,
45     },
46     'compose' => {
47       'skip_setup' => false,
48     },
49   },
50   'concourse-ci' => {
51     'with_ssl_cert_cookbook' => false,  # or true (for https)
52     'ssl_cert' => {
53       #'common_name' => concourse_cn,
54     },
55     'docker-compose' => {
56       'config' => {
57         # Version 1 docker-compose format
58         'concourse-web' => {
59           'image' => image,
60           #'ports' => [
61             #"#{port}:8080",  # If you sepecify no value, Chef will sets '8080:8080'.
62             #"#{port}:8443",  # for https
63           #],
64           'environment' => {
65             #'CONCOURSE_RESOURCE_CHECKING_INTERVAL' => '1m',
66             # If you sepecify no value, Chef will sets "http://#{node['ipaddress']}:8080".
67             #'CONCOURSE_EXTERNAL_URL' => "http://192.168.1.3:#{port}",  # or "https://192.168.1.3:#{port}"
68             #'CONCOURSE_TLS_BIND_PORT' => '8443',  # activate HTTPS
69             # These environments will be set by the concourse-ci::docker-compose recipe automatically.
70             #'CONCOURSE_TLS_CERT' => '/root/server.crt',
71             #'CONCOURSE_TLS_KEY' => '/root/server.key',
72           },
73           #'volumes' => [
74             # These volumes will be set by the concourse-ci::docker-compose recipe automatically.
75             #"#{server_cert_path(node['concourse-ci']['ssl_cert']['common_name'])}:/root/server.crt:ro",
76             #"#{server_key_path(node['concourse-ci']['ssl_cert']['common_name'])}:/root/server.key:ro",
77           #],
78         },
79         'concourse-worker' => {
80           'image' => image,
81         },
82       },
83     },
84   },
85 )