-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhooker.conf.example.php
91 lines (79 loc) · 5.54 KB
/
hooker.conf.example.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
<?php
/**
* Hooker Configuration File
*/
return [
// Enable output of debugging information.
'debug' => true,
// Need to customise the default Git path?
// 'git_bin' => '/usr/bin/git',
// Need to customise the default PHP version used for running Composer and other PHP specific tasks?
// ** This path can also be overridden by individual sites/applications as required in the sites array below. **
//'php_bin' => '/usr/bin/php7.4',
// Need to customise the default Composer path?
// ** This path can also be overridden by individual sites/applications as required in the sites array below. **
//'composer_bin' => '/usr/bin/composer',
// By default we'll allow any server(s) to "hit" these deployment hooks but you can add specific IP addresses
// to the whitelist if you wish...
'ip_whitelist' => [],
'sites' => [
// An example basic HTML website (Webhook example: http://deploy.mysite.com/hooker.php?app=my_basic_website&key=SomeRandomWordThatMustBePresentInTheKeyParam).
'my_example_website' => [
'debug' => false, // Override and disable the output of debug info for this specific deployment workflow?
'key' => 'SomeRandomStringThatMustBePresentInTheKeyParam',
'remote_repo' => 'git@github.com:allebb/my_example_website.git',
'local_repo' => '/var/www/html-website', // Use current directory
'is_github' => true, // Use GitHub webhooks to trigger this workflow.
'branch' => 'master', // As long as the GitHub webhook request relates to changes on this git branch, we'll run the deployment workflow!
'git_ssh_key_path' => '/var/www/.ssh/html-website.deploykey', // If using Conductor, you can easily generate one by running `conductor genkey {appname}`
//'pre_commands' => [
// // Uses the default (inherited deployment commands)
//],
//'deploy_commands' => [
// // Uses the default (inherited deployment commands eg. cd {{local-repo}} && {{git-ssh-key}}{{git-bin}} reset --hard HEAD && {{git-ssh-key}}{{git-bin}} pull)
//],
//'post_commands' => [
// // Uses the default (inherited deployment commands)
//],
],
// An example Laravel Deployment Configuration (Webhook example: http://deploy.mysite.com/hooker.php?app=my_other_website&key=32c9f55eea8526374731acca13c81aca)
'my_other_website' => [
'key' => '32c9f55eea8526374731acca13c81aca',
'local_repo' => '@conductor', // This will auto-resolve to /var/conductor/applications/my_other_website
'git_ssh_key_path' => '@conductor', // This will auto-resolve and use the private key at /var/www/.ssh/my_other_website.deploykey
'user' => false,
'php_bin' => '/usr/bin/php8.0',
// Override the "default" PHP version used for this deployment/running Composer, this application needs PHP 8.0!
//'composer_bin' => '/usr/bin/composer', // Need to override with a different Composer version?
'pre_commands' => [
'{{php-bin}} {{local-repo}}/artisan down', // Example of a pre-command to set our Laravel application into "maintenance mode".
'{{php-bin}} {{local-repo}}/artisan config:clear', // We'll also clear the configuration cache before we pull the latest code from Git..
],
//'deploy_commands' => [
// // Uses the default (inherited deployment command eg. cd {{local-repo}} && {{git-bin}} reset --hard HEAD && {{git-ssh-key}}{{git-bin}} pull)
// // You can of course run other tasks here too, shell scripts, npm, nodejs etc. etc.
//],
'post_commands' => [
'cd {{local-repo}} && {{php-bin}} {{composer-bin}} install --no-dev --no-progress --prefer-dist --optimize-autoloader',
'chmod 755 {{local-repo}}/storage',
'{{php-bin}} {{local-repo}}/artisan migrate --force',
'{{php-bin}} {{local-repo}}/artisan config:cache',
'{{php-bin}} {{local-repo}}/artisan cache:clear',
'{{php-bin}} {{local-repo}}/artisan route:cache',
"{{php-bin}} {{local-repo}}/artisan view:cache",
'{{php-bin}} {{local-repo}}/artisan up',
//'{{php-bin}} {{local-repo}}/artisan queue:restart', // Using a job queue? Restart it so it uses the latest version of your code!
//'{{php-bin}} {{local-repo}}/artisan horizon:terminate', // Using Horizon for your queues instead??
],
],
// An example Configuration using a local ".hooker.json" repository configuration. (Webhook example: http://deploy.mysite.com/hooker.php?app=another_application&key=VgUjbEIPbOCpiRQa2UHjqiXcmbE8eIht)
'another_application' => [
'key' => 'VgUjbEIPbOCpiRQa2UHjqiXcmbE8eIht',
'remote_repo' => 'git@github.com:allebb/another_application.git',
'local_repo' => '@conductor', // This will auto-resolve to /var/conductor/applications/another_application
'git_ssh_key_path' => '@conductor', // This will auto-resolve and use the private key at /var/www/.ssh/another_application.deploykey
'disable_init' => true, // Prevent people (if they have the webhook URL) from re-initiating your application by appending the ?init parameter.
'use_json' => 'true', // This will read the configuration from a .hooker.json file stored in your git repo. eg. /var/www/another_application/.hooker.json
],
],
];