jigarius / drall Goto Github PK
View Code? Open in Web Editor NEWA tool to run drush commands on multi-site Drupal installations.
License: GNU General Public License v3.0
A tool to run drush commands on multi-site Drupal installations.
License: GNU General Public License v3.0
--uri=@@uri
.--uri
is a proper hostname
drush uli
generates the correct URL with the correct --uri
.@@uri
placeholder that uses the keys in $sites
.@@dir
placeholder that uses the values in $sites
.@@key
represents the keys in $sites
.
$sites
keys which include port numbers and paths. See example.sites.php.@@ukey
represents unique keys in $sites
.@@dir
represents the site directory, i.e. replaces old @@uri
.When running a command on multiple sites, the user might want to cancel the operation. Currently, when Ctrl + C
is pressed, Drall stops immediately. It might make sense to finish at least the current operation before terminating.
SIGINT
is received,
Stopping...
SIGINT
is received more than once, stop immediately.I have run "composer require global jigarius/drall" and then when I run the command drall I get the error "drall: command not found"
How do I run drall from the command line after installing this way? Do I instead need to run "composer global require jigarius/drall"? Or is there a different / proper way?
This will make Drall wait n
seconds between tasks.
This will also require the number of workers to be set as 1
.
-vvv
, the -vvv
gets passed to Drush.-vvv
and it makes it hard to read the Drall log messages.--drall-verbose
and --drall-debug
to control Drall's verbosity.--root
option should make Drall do site/alias discovery in the correct directory instead of just using PWD
.Allow the user to choose verbosity of output by using a nicer way of logging with something like the LoggerAwareTrait
and ConsoleLogger
instead of just writing to $output
.
drall st
β Shows status of all sitesdrall st --fields=site ...
works correctly
drush
commands that returned a non-zero exit code.drush
commands return a non-zero exit code.I'm using Drall v2.1.0.
Running the command vendor/bin/drall exec drush @@site.T cr
inside a container derived from php:8.1.18-cli
spawns workers, but they don't return the result or exit code:
My version has the code committed for #71, so I'm not sure what the issue could be.
Drall currently depends on consolidation/site-alias:3.x but Drupal 10 requires consolidation/site-alias:4.x, which means drall can't be updated to support newer versions of Drupal.
exec:shell
and exec:drush
.exec:drush
command was used to ensure that we use the correct drush
executable, i.e. the one in the project.drall exec ...
in all cases, which is easier for the users as well and makes more sense because after all drush
is nothing but a command just like any other.exec:drush
command in favor of exec:shell
.
exec:drush
can then be performed with: drall exec:shell drush @@site.local st
drush
executable detected by the system will be used.vendor/bin/drush
, they can write @@drush
instead of drush
?drush site:install
.drall
unless we really want to test commands that interact with Drupal's database.drush site:install
optional.All sites in a multi-site don't always have site aliases. Many projects rely on drush's --uri
option to run the command on the correct site. Thus, we need to allow users to choose whether they want to use the URI or Drush aliases.
--uri=@@uri
, we replace the @@uri
with individual site URIs before sending the command to Drush.@@site
, we replace the @@site
with a site alias's name part, i.e. excluding the env
part.--uri=@@uri
by default.--drall-processes=5
.foo &; bar &
the lines of output of foo
and bar
get mixed up.drush
command appears together and is readable.--drall-processes
, say n
, is greater than 1
, then continue, otherwise, there's nothing special to do.tmp
directory to track command progress.
task
file.n
drall commands (let's call these workers) with a reference to the task
file.
drall --drall-task=/path/to/task.json ... &;
.exec:task
.
exec:drush
command.
--drall-processes=n
parameter.n > 1
, then generate a task
file and launch Drall workers to execute the tasks.sites/*/settings.php
SiteDetector
service to make the code re-usable.drall exec:drush ...
Run a single Drush command.drall exec:shell ...
Run one or more shell command.drall exec:drush ...
command would be like an alias to drall exec drush ...
Currently, drall
simply issues the drush
command in the shell. If the drush
binary isn't somewhere in the $PATH
, then we get unknown command drush. Since drall
depends on drush/drush
, it should be able to detect and use vendor/bin/drush
instead of simply issuing the drush
command.
vendor/bin/drush
instead of just drush
.
Running: drush ...
to keep it neat? Or should it show the entire /path/to/drush
?There are some features and fixes that will need to be ported to v2.x. Once that is done, all efforts will be concentrated on Drall 3.x.
Please create a launcher like drush or composer has, which is installed globally, then the drall is installed per project.
Tried using a quick Ddev setup, but it made life difficult to a great extent. Here's what would help:
docker-compose.yml
composer.json
sites.php
drush
directorydrush
aliases./hosts
file.drall
at /opt/drall
drall
from anywhere inside the container.Allow user to define site groups and then run drush
on those groups. Not sure how this will work with site aliases though.
DRUPAL/sites/sites.*.php
to define groups.
sites.php
always contains all the sites and it is the default site group, default
.drall exec --drall-group=foo
runs the command on all sites in sites.foo.php
.site:directories
command should support this option.site:aliases
command should support this option.Giving the command: ./vendor/bin/drall exd cr --drall-workers=4
on a site where there are 4 installations, it should do the command under one command time but it's visibly and measurable that it runs serial still, instead of parallel.
Not only Bitbucket, it seems Drall gets stuck without any message when it is executed on aliases that refer to remote environments, e.g.
drall exd @@site.dev core:status
Maybe there's some kind of dialog that's present in there that we can't see? This seems like a dealbreaker.
--with-resume
.resume
, store Drall's execution state in a drall.state.json
file.\
.If I get 25 ππ½ on this issue, I'll start working on it.
--drall-no-progress
.drall ex drush cr
[success] Cache rebuild complete.
message generated by Drush.In sites.php
the values are not sorted. If you monitor the output, it seems a bit odd. You see a site with z
first and then a site with a
when you're reading the logs.
--no-sort
?--drall-group
is fixed for specific environments/servers.DRALL_GROUP
env var which will automatically decide the --drall-group
value.amphp/process
libraries to execute commands in parallel.--drall-no-buffer
that would force Drall to throw all output to the console instead of collecting it in a variable.@@site
for site alias' name part, e.g. The @foo
part in @foo.env
.@@uri
for site's subdir under sites
.@@host
for the site's key in $sites
.@@dir
instead of @@uri
.@@uri
instead of @@host
.Need to think over it before jumping to conclusions. This will be required once @@host
support is added.
Allow the user to run commands on a list of sites. Say, there are 4 sites, but I want to run the command only on abc.com
and def.com
.
# This one has a safe namespace and takes multiple sites at once.
drall --drall-uris="abc.com def.com"
# Similarly, we can have something for aliases.
drall --drall-sites="@abc @def" st
exec:drush
or exd
after drall
.drall list
in such cases.exec:drush
.
Application::findAlternatives()
command, so we'll have to cheat.--drall-filter
, you might want to see exactly which sites will be affected by the filtering.--drall-no-execute
for drall exec
When I simple give the command $ ./vendor/bin/drall exd uli
I receive URLs which does not contain the domains:
Running: drush --uri=eaad uli
http://eaad/en/user/reset/1/1658916912/XtxmYUYDfYWCNDiF2Jf43DCXuQmpeNo6JbRW1NFIFhQ/login
Running: drush --uri=escaide uli
http://escaide/en/user/reset/1/1658916913/nFrSxO18O9BEHqC5E9cYO13pnJpp_2_28_qo5Ai0Rc4/login
Running: drush --uri=portal uli
http://portal/en/user/reset/1/1658916913/ugMuDeCVgV0Q5LgUJWTl7fPJ3N7lnDPebipyeVGtoeQ/login
Running: drush --uri=vaccine uli
http://vaccine/en/user/reset/1/1658916913/zzinbUGo-UrOm4izTtFtSByJqQQofUl6AHGIzIxgaMY/login
To have it correctly I need to run ./vendor/bin/drall exd @@@uri uli
Running: drush @eaad uli
http://ecdc-eaad.lh:8080/en/user/reset/1/1658916788/TpF3oxM2c5b3xuyisYbgfdzJqkBSRvNMgP27JjX4KlA/login
Running: drush @escaide uli
http://ecdc-escaide.lh:8080/en/user/reset/1/1658916789/xrZNk927t2Yalo1n3fpPrdRcMY3ZfEN9j_ylpAgjq9o/login
Running: drush @portal uli
http://ecdc-portal.lh:8080/en/user/reset/1/1658916789/gIvVSelKq1VyWkXExzQ7kjWFZ_5ZCrYcXI8FKeal6Gk/login
Running: drush @vaccine uli
http://ecdc-vaccine.lh:8080/en/user/reset/1/1658916789/NXtzQYeDinF04dF4nU5DyZR3zWMrKp-f4ZjHF4bAKDI/login
I would expect to have the correct url with the simple exd uli command too.
NOTE: here for us the @@@uri does work as the directory and the drush alias name is actually the same, otherwise it won't work.
Depending on where we write --drall-*
options, Symfony Console, Drall commands do not receive the --drall-*
options. We need to figure out exactly what's going on and document it in the README
.
exec
command.exec:drush
command.exec:shell
command will be added alongside.This will demotivate people from using the exec
command which will eventually be renamed to exec:drush
in v2.x
.
sites.php
.
sites.php
.sites/*
directories have meaningful names and they don't need to be explicitly defined in sites.php
.sites/*/settings.php
.If I get 15 thumbs up on the issue, I'll consider starting development.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.