-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathenvoy.config.php
140 lines (116 loc) · 3.6 KB
/
envoy.config.php
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
<?php
/**
* Config block
*/
$config = [
// application name
'application_name' => 'project_envoy',
// The default remote connection(s) to execute tasks on
'default' => ['local'],
/**
* connection settings
* @example row set: 'webserver1'=>['-p 2222 [email protected]'],
* @example row set: 'webserver2'=>['[email protected] -p2222'],
* @example row set: '[email protected]',
*/
'connections' => [
'local' => '-p 9999 [email protected]',
'staging' => 'deploy@staginghost',
],
];
/**
* Remote block
*/
$remote = [
// Remote server
//////////////////////////////////////////////////////////////////////
// The number of releases to keep at all times
'keep_releases' => 4,
// Folders
////////////////////////////////////////////////////////////////////
// The root directory where your applications will be deployed
// This path *needs* to start at the root, ie. start with a /
'root_directory' => '/home/deploy',
// A list of folders/file to be shared between releases
// Use this to list folders that need to keep their state, like
// user uploaded data, file-based databases, etc.
'shared' => [
'storage',
'.env'
],
// Permissions
////////////////////////////////////////////////////////////////////
'permissions' => [
// The folders and files to set as web writable
'files' => [
'storage',
],
// Here you can configure what actions will be executed to set
// permissions on the folder above. The Closure can return
// a single command as a string or an array of commands
'callback' => function ($file) {
return [
sprintf('chmod -R 777 %s', $file),
];
},
],
// Dependencies
////////////////////////////////////////////////////////////////////
'dependencies' => [
// Which dependencies component will run after cloning code
'components' => [
'composer' => true,
'npm' => true,
'bower' => false,
'gulp' => true,
],
// Which commands run associate with components above
'commands' => [
'composer' => 'composer install --prefer-dist --no-scripts --no-interaction && composer dump-autoload --optimize',
'npm' => 'npm install',
'bower' => 'bower install',
'gulp' => 'gulp',
]
],
];
/**
* Scm block
*/
$scm = [
// SCM repository
//////////////////////////////////////////////////////////////////////
// The SCM used (only supported "git")
// The SSH address to your repository
// Example: [email protected]:username/repository.git
'repository' => '[email protected]:nguyenthanhtung88/laravel53-cd-demo.git',
// The branch to deploy
'branch' => 'develop',
// Recursively pull in submodules. Works only with GIT.
'submodules' => true,
];
/**
* Hooks block
*/
$hooks = [
// Tasks to execute before the core Tasks
'before' => [
'setup' => [],
'deploy' => [],
'dependencies' => [],
'symlink' => [
'php artisan migrate --force'
],
],
// Tasks to execute after the core Tasks
'after' => [
'setup' => [
'touch ' . $remote['root_directory'] . '/' . $config['application_name'] . '/shared/.env',
],
'deploy' => [
// 'sudo /etc/init.d/php7.0-fpm restart',
// 'sudo /etc/init.d/nginx restart'
],
'dependencies' => [],
'symlink' => [],
],
];