File tree Expand file tree Collapse file tree 2 files changed +67
-0
lines changed
Expand file tree Collapse file tree 2 files changed +67
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Deployer ;
4+
5+ /**
6+ * Define your custom tasks as shown below.
7+ */
8+ desc ( 'Some task ' );
9+ task ( 'some:task ' , function () {
10+ // task code here.
11+ } );
12+
13+
14+ desc ( 'Some other task ' );
15+ task ( 'some:othertask ' , function () {
16+ // task code here.
17+ } );
18+
19+ /**
20+ * Update the tasks variable and add your tasks in the order where they should be.
21+ * You can also remove any tasks which you may not need.
22+ */
23+ $ tasks = [
24+ 'deploy:prepare ' ,
25+ 'deploy:unlock ' ,
26+ 'deploy:lock ' ,
27+ 'deploy:release ' ,
28+ 'rsync ' ,
29+ 'wp:config ' ,
30+ 'some:task ' , // Adding custom task in $tasks variable.
31+ 'some:othertask ' , // Adding custom task in $tasks variable.
32+ 'cachetool:download ' ,
33+ 'deploy:shared ' ,
34+ 'deploy:symlink ' ,
35+ 'permissions:set ' ,
36+ 'opcache:reset ' ,
37+ 'core_db:update ' ,
38+ 'deploy:unlock ' ,
39+ 'cleanup ' ,
40+ ];
41+
42+ // Stop editing now. The above given tasks will be run by deploy.php of this action now.
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ function some_custom_function() {
4+ # function logic goes here.
5+ echo ' Custom logic goes here'
6+ }
7+
8+ # Overriding the main function of `main.sh`.
9+ # This is compulsory. You can take the functions that are run
10+ # in `main.sh`'s `main` functions else condition and
11+ # add edit/remove them as well as add your function
12+ # where needed for custom deployment changes.
13+ function main() {
14+ setup_hosts_file
15+ check_branch_in_hosts_file
16+ setup_ssh_access
17+ maybe_install_node_dep
18+ maybe_run_node_build
19+ maybe_install_submodules
20+ some_custom_function # Adding the custom function in the order where needed.
21+ setup_wordpress_files
22+ deploy
23+ }
24+
25+ main
You can’t perform that action at this time.
0 commit comments