-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Welcome to the drupal-env wiki!
Requirements:
You will need PHP 8(at least 8.1) installed locally to run the Robo scripts needed to interact with the software.
Recommendations:
- Composer installed locally to speed up commands.
- If you did not install Composer, you can use Docker
Replace composer in the following commands with docker run --rm -i --tty -v $PWD:/app composer
Install Drupal composer based project:
- Already have a Drupal composer based project? Skip to the next step.
- Check out the different options available for creating a project.
- Do not commit the new files created until the steps ask you too
composer create-project drupal/recommended-project --ignore-platform-reqs [NAME]
cd [NAME]
Do not init a git repository until the step asks for it, a lot of files that are added need to be ignored.
Install this package:
composer require "mattsqd/drupal-env:dev-main"
You will see the notice:
Not scaffolding files for mattsqd/drupal-env, because it is not listed in the element 'extra.drupal-scaffold.allowed-packages' in the root-level composer.json file.
This is expected, continue with the next step.
Run the scaffolding (accept the cweagans/composer-patches added to plugins prompt):
vendor/bin/robo drupal-env:scaffold
This will prepare the files for scaffolding and then run the scaffolding. After the scaffolding is installed, it will not run again until this is called again. Otherwise, it will try to update every time composer install happens. The scaffolding is now part of your project and can be updated at will, but new updates will be applied on top. They can be accepted or reverted.
Now that the scaffolding has been installed:
You no longer need to use vendor/bin/robo, you can use ./robo.sh
as a shortcut. Using Robo is how one accesses the functionality provided by this project. You can just type ./robo.sh
to see all commands that are available.
./robo.sh drupal-env:scaffold
to run again after scaffolding runs the first time.
You can commit all the untracked files. The scaffolding installs a .gitignore
for you that ignores the proper files and directories. Note that all files that Drupal core scaffolds will be committed to your repo. In that way, you can see what changes are made and accept them or not.
Git --version >= 2.28.0 git init -b develop
Git --version < 2.28.0 git init && git checkout -b develop
If you already have a remote git repository, you can add it as an origin now:
git remote add origin [git-address]
Now commit everything.
git add --all && git commit -m "Initial commit"
You are now ready to install local and remote environments.
Note: When running this for the first time, it will ask you for a different version of PHP.
./robo.sh common-admin:init