1 | <?php |
||||||
2 | namespace Deployer; |
||||||
3 | |||||||
4 | require 'recipe/symfony4.php'; |
||||||
5 | require 'vendor/deployer/recipes/recipe/slack.php'; |
||||||
6 | |||||||
7 | // Project name |
||||||
8 | set('application', 'ual-payments'); |
||||||
0 ignored issues
–
show
Bug
introduced
by
![]() |
|||||||
9 | |||||||
10 | // Project repository |
||||||
11 | set('repository', 'ssh://[email protected]/ualibraries/ual-payments.git'); |
||||||
12 | |||||||
13 | // [Optional] Allocate tty for git clone. Default value is false. |
||||||
14 | set('git_tty', true); |
||||||
15 | |||||||
16 | // Keep all releases |
||||||
17 | set('keep_releases', -1); |
||||||
18 | |||||||
19 | // Default branch to deploy from |
||||||
20 | set('branch', 'master'); |
||||||
21 | |||||||
22 | // Shared files/dirs between deploys |
||||||
23 | set('shared_files', ['.env']); |
||||||
24 | set('shared_dirs', ['var/log', 'var/sessions', 'backups']); |
||||||
25 | // Writable dirs by web server |
||||||
26 | set('writable_dirs', ['var']); |
||||||
27 | |||||||
28 | // We're not allowing anonymous stats |
||||||
29 | set('allow_anonymous_stats', false); |
||||||
30 | |||||||
31 | set('slack_webhook', 'https://hooks.slack.com/services/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'); |
||||||
32 | |||||||
33 | // Hosts |
||||||
34 | host('production') |
||||||
0 ignored issues
–
show
The function
host was not found. Maybe you did not declare it correctly or list all dependencies?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||||
35 | ->user('deploy') |
||||||
36 | ->hostname('pay-prd.library.arizona.edu') |
||||||
37 | ->set('deploy_path', '/var/www') |
||||||
38 | ->stage('prd'); |
||||||
39 | |||||||
40 | host('stage') |
||||||
41 | ->user('deploy') |
||||||
42 | ->hostname('pay-stg.library.arizona.edu') |
||||||
43 | ->set('deploy_path', '/var/www') |
||||||
44 | ->stage('stg'); |
||||||
45 | |||||||
46 | // Tasks |
||||||
47 | task('assets-build', function () { |
||||||
0 ignored issues
–
show
The function
task was not found. Maybe you did not declare it correctly or list all dependencies?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||||
48 | run('cd {{release_path}} && composer assets:build'); |
||||||
49 | }); |
||||||
50 | |||||||
51 | // Backup remote database |
||||||
52 | task('backup-remote-db', function () { |
||||||
53 | cd('{{release_path}}'); |
||||||
54 | run('source .env && mysqldump -u $DB_USER -p$DB_PASSWORD $DB_NAME | gzip > ./backups/$DB_NAME-`date +%s`.sql.gz'); |
||||||
55 | // Remove database backup files older than 30 days |
||||||
56 | run('find ./backups -name *sql.gz -mtime 30 -type f -delete'); |
||||||
57 | }); |
||||||
58 | |||||||
59 | desc('Deploy project'); |
||||||
0 ignored issues
–
show
The function
desc was not found. Maybe you did not declare it correctly or list all dependencies?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||||
60 | task('deploy', [ |
||||||
61 | 'deploy:info', |
||||||
62 | 'deploy:prepare', |
||||||
63 | 'deploy:lock', |
||||||
64 | 'deploy:release', |
||||||
65 | 'deploy:update_code', |
||||||
66 | 'deploy:shared', |
||||||
67 | 'deploy:writable', |
||||||
68 | 'deploy:vendors', |
||||||
69 | 'deploy:cache:clear', |
||||||
70 | 'deploy:cache:warmup', |
||||||
71 | 'backup-remote-db', |
||||||
72 | 'database:migrate', |
||||||
73 | 'assets-build', |
||||||
74 | 'deploy:symlink', |
||||||
75 | 'deploy:unlock', |
||||||
76 | 'cleanup', |
||||||
77 | ]); |
||||||
78 | |||||||
79 | // [Optional] if deploy fails automatically unlock. |
||||||
80 | after('deploy:failed', 'deploy:unlock'); |
||||||
0 ignored issues
–
show
The function
after was not found. Maybe you did not declare it correctly or list all dependencies?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||||
81 | |||||||
82 | // Slack notifications |
||||||
83 | before('deploy', 'slack:notify'); |
||||||
0 ignored issues
–
show
The function
before was not found. Maybe you did not declare it correctly or list all dependencies?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||||
84 | after('deploy', 'slack:notify:success'); |
||||||
85 | after('deploy:failed', 'slack:notify:failure'); |
||||||
86 |