-
Notifications
You must be signed in to change notification settings - Fork 1
/
config.txt
268 lines (191 loc) · 6.25 KB
/
config.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
Config
======
This page contains some example configuration that will give you some more insight of the possible parameters.
In your config you can setup stuff like ssh credentials, symlinks, mysql backup and much more...
It's important to understand how settings are loaded and which settings are possible.
We've implemented a nice feature to inherit settings based on environments and projects.
We'll start by explaining each config file by it's location on the filesystem.
Root config
-----------
The main configuration file must be located in the root folder and named "config.json"
This config file contains json structured params, like your master password.
.. note:: Don't commit this file to your repo because the master password should be stored elsewhere.
/config.json
::
{
"master_password": "abc1234",
"env": {
"debug": "False",
"warning_only": "True",
"running": "False",
"stdout": "False"
}
}
Mail config
-----------
When using automated deployments and executing tasks it can send out notifications and other mails to keep you and your team up to date.
.. note:: If you'll leave the mail configuration empty it won't send out any mails.
Don't have a smtp server? Try the free `mandrillapp <https://mandrillapp.com>`_
/config.json
::
{
"mail":{
"host":"smtp.host.com",
"port":"587",
"from":"your@email.com",
"user":"smtpuser",
"password":"smtppassword",
"to":["devops@yourdomain.com"]
}
}
Webserver config
----------------
.. sidebar:: Default path
The runserver command will autodetect the current path, application path and virtualenv path to generate the right command for executing the gunicorn webserver.
By default it expects the virtualenv folder 'environment' in the root of the home path where your configuration lives.
The webserver runs by default on port 8687, and ip 0.0.0.0.
This config will overwrite the default config.
dc_application_path : the deploy commander path.
dc_virtualenv_path : path to virtualenv
dc_home_path : path to configuration
/config.json
::
{
"webserver":{
"ip":"0.0.0.0",
"port":"8687",
"dc_application_path":"/deploy-commander/code/path",
"dc_virtualenv_path":"/default/home/path/environment",
"dc_home_path":"/default/home/path",
"workers":1
}
}
Initial project config
----------------------
This config file is located in the /config/<project> folder.
Here you can define settings related to deploy commander.
This file is optional, and not required to be present.
The application autodetects the presence of this file.
/<project>/config.json
::
{
"config_load_strategy": [
"config/default.json",
"config/%(environment)s.json",
"config/%(project)s/default.json",
"Your own config here"
]
}
.. note:: config_load_strategy is optional, leave it empty by default
Global project config
---------------------
.. sidebar:: Config Examples
For more information about the configuration options please see the examples in ./config in the `example github repo <https://github.com/munstermedia/deploy-commander-example>`_.
The basic foundation of this system are tasks and actions. You can initiate a task, and these have actions to execute.
The default config strategy (if not set in /<project>/config.json) will be:
1. **/config/default.json**
This is the base config. Everything will be extended from this config.
2. **/config/%(environment)s.json**
Main config for development environments.
This will overwrite the ./config/default.json
3. **/config/%(project)s/default.json**
Main Config for the development project.
This will overwrite the ./config/default.json, and development.json
4. **/config/%(project)s/%(environment)s.json**
Config for the development project.
This will overwrite the ./config/default.json, default.json and development.json
To view the configuration from the command line you can run:
::
$ deploy-commander go show_config
When running a task it will load in sequence (if available) and combine the configuration of:
1. Generic config (default.json)
2. Generic environment config (<environment>.json)
3. Project config (<project>/default.json)
4. Project environment config (<project>/<environment>.json)
.. note:: If you want to load a different config strategy for your project, you can create a file '<project>/config.json'
(See `Initial project config`)
So in this case, the 2'nd config will append and overwrite the 1'st. The 3'rd the 2'nd etc..
This is an example structure of a project config:
1. **/config/default.json**
::
{
"params": {
"some_param": "param/value"
},
"post_params": {
"dynamic_post_param": "/some/%(some_param)s/path"
},
"tasks": {
"deploy": {
"description": "Deploy project",
"actions": {
"your-own-description": {
"sequence": 1,
"execute": "command.action",
"params": {
"dynamic_param": "%(dynamic_param)s/repo",
"dynamic_post_param": "%(dynamic_post_param)s/source/%(tag)s"
}
}
}
}
}
}
2. **/config/testing.json**
::
{
"params": {
"environment": "testing"
}
}
3. **/config/test/default.json**
::
{
"params": {
"project_name": "test"
},
"post_params": {
"post_test": "%(project_name)s-%(environment)-%(password)s"
},
"tasks": {
"deploy": {
"description": "Lets change the title"
}
}
}
4. **/config/test/testing.json**
::
{
"params": {
"password": "1234"
}
}
When executing : $ deploy-commander go:test,testing show_config it will output as:
::
{
"params": {
"some_param": "param/value",
"password": "1234",
"project_name": "test",
"environment": "testing"
},
"post_params": {
"dynamic_post_param": "/some/%(some_param)s/path",
"post_test": "%(project_name)s-%(environment)-%(password)s"
},
"tasks": {
"deploy": {
"description": "Lets change the title",
"actions": {
"your-own-description": {
"sequence": 1,
"execute": "command.action",
"params": {
"dynamic_param": "%(dynamic_param)s/repo",
"dynamic_post_param": "%(dynamic_post_param)s/source/%(tag)s"
}
}
}
}
}
}