File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed
Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,34 @@ function () {
3434inventory ( 'deploy.yml ' );
3535
3636// Tasks.
37+ desc ( 'Check WordPress is installed ' );
38+ task (
39+ 'wp:install ' ,
40+ function (): void {
41+ if ( ! get ( 'wordpress ' ) ) {
42+ return ;
43+ }
44+
45+ within (
46+ '{{release_path}} ' ,
47+ function (): void {
48+ $ is_installed = test ( '{{bin/wp}} core is-installed ' );
49+ if ( $ is_installed ) {
50+ return ;
51+ }
52+ writeln ( '<comment>Installing WordPress</comment> ' );
53+ $ env = run ( 'set -o allexport; source wordpress/.env; set +o allexport; echo "https://$_HTTP_HOST,$MULTISITE" ' );
54+ [ $ url , $ is_multisite ] = explode ( ', ' , $ env );
55+ if ( $ is_multisite ) {
56+ run ( "{{bin/wp}} core multisite-install --url= {$ url } --title=WordPress --admin_user=required --admin_email=info@required.ch --skip-email --skip-config " );
57+ } else {
58+ run ( "{{bin/wp}} core install --url= {$ url } --title=WordPress --admin_user=required --admin_email=info@required.ch --skip-email " );
59+ }
60+ }
61+ );
62+ }
63+ );
64+
3765desc ( 'Install WordPress translations ' );
3866task (
3967 'wp:install_translations ' ,
@@ -133,6 +161,7 @@ function (): void {
133161 'deploy:shared ' ,
134162 'deploy:writable ' ,
135163 'deploy:vendors ' ,
164+ 'wp:install ' ,
136165 'wp:translations ' ,
137166 'deploy:clear_paths ' ,
138167 'deploy:symlink ' ,
You can’t perform that action at this time.
0 commit comments