OSDN Git Service

adds the devops-suite-on-docker role.
[metasearch/grid-chef-repo.git] / roles / devops-suite-on-docker.rb
1 name 'devops-suite-on-docker'
2 description 'DevOps Suite on Docker'
3
4 aptly_port       = '7080'  # default: 8080
5 aptly_api_port   = '7081'  # default: 8081
6 concourse_port   = '8080'
7 gitlab_http_port =   '80'  # default: 80, and 8080 already in use.
8 gitlab_ssh_port  = '2022'
9 nexus_ver = '3'
10 nexus_port = nexus_ver == '3' ? '8081' : '8071'
11
12 run_list(
13   'role[docker]',
14   'role[aptly-on-docker]',
15   'role[concourse-on-docker]',
16   'role[gitlab-on-docker]',
17   'role[gitlab-runner]',
18   "role[nexus#{nexus_ver}-on-docker]",
19 )
20
21 #env_run_lists()
22
23 #default_attributes()
24
25 override_attributes(
26   'docker-grid' => {
27     'engine' => {
28       'skip_setup' => false,
29       'daemon_extra_options' => [
30         '-H fd://',
31         '--bip=192.168.100.1/24 --fixed-cidr=192.168.100.0/24',
32       ].join(' '), 
33     },
34     'compose' => {
35       'skip_setup' => false,
36     },
37   },
38   'apt_utils' => {
39     'aptly' => {
40       'docker-compose' => {
41         'config' => {
42           'services' => {
43             'reverseproxy' => {
44               'ports' => [
45                 "#{aptly_port}:8080",
46                 "#{aptly_api_port}:8081",
47               ],
48               # 'network_mode' => 'bridge',
49               # 'links' => [
50               #   'aptly',
51               # ],
52             },
53             'aptly' => {
54               # 'network_mode' => 'bridge',
55             },
56           },
57         },
58       },
59     },
60   },
61   'concourse-ci' => {
62     'docker-compose' => {
63       'config' => {
64         # Version 1 docker-compose format
65         'concourse-db' => {
66         },
67         'concourse-web' => {
68           'ports' => [
69             "#{concourse_port}:8080",
70           ],
71           'environment' => {
72             # If you sepecify no value, Chef will sets "http://#{node['ipaddress']}:8080".
73             #'CONCOURSE_EXTERNAL_URL' => "http://#{node['ipaddress']}:#{concourse_port}",
74           },
75         },
76         'concourse-worker' => {
77           'environment' => {
78           },
79         },
80       },
81     },
82   },
83   'gitlab-grid' => {
84     'gitlab.rb' => {
85       #'external_url' => "http://#{gitlab_cn}:#{gitlab_http_port}",
86       'gitlab_rails' => {
87         #'time_zone' => 'Asia/Tokyo',
88         'gitlab_shell_ssh_port' => gitlab_ssh_port.to_i,
89       },
90     },
91     'docker-compose' => {
92       'config' => {
93         'services' => {
94           'gitlab' => {
95             #'hostname' => gitlab_cn,
96             'ports' => [
97               "#{gitlab_http_port}:#{gitlab_http_port}",
98               "#{gitlab_ssh_port}:22",
99             ],
100             'network_mode' => 'bridge',  # for the Container Registry feature.
101           },
102         },
103       },
104     },
105     'runner-docker-compose' => {
106       'import_ca' => false,
107     },
108   },
109   'nexus-grid' => {
110     'docker-compose' => {
111       'config' => {
112         'services' => {
113           'reverseproxy' => {
114             'ports' => [
115               "#{nexus_port}:8081",
116             ],
117             # 'network_mode' => 'bridge',
118             # 'links' => [
119             #   'nexus',
120             # ],
121           },
122           'nexus' => {
123             #'image' => 'sonatype/nexus3',  # => role[nexus2/3-on-docker]
124             # 'network_mode' => 'bridge',
125           },
126         },
127       },
128     },
129   },
130 )