Anyone is welcome to contribute code changes and additions to this project. If you'd like your changes merged into the dev branch, please read the following document before opening a [pull request][pulls].
There are several ways in which you can help improve this project:
- Fix an existing [issue][issues] and submit a [pull request][pulls].
- Review open [pull requests][pulls].
- Report a new [issue][issues]. Only do this after you've made sure the behavior or problem you're observing isn't already documented in an open issue.
This project is a Drupal (version 8.7.x) content management system. Development dependencies are managed using Composer.
When installing the given composer.json
some tasks are taken care of:
- Drupal will be installed in the
docroot
-directory. - Modules (packages of type
drupal-module
) will be placed indocroot/modules/contrib/
- Theme (packages of type
drupal-theme
) will be placed indocroot/themes/contrib/
- Profiles (packages of type
drupal-profile
) will be placed indocroot/profiles/contrib/
- Latest version of drush is installed locally for use at
docroot/vendor/bin/drush
. - Latest version of DrupalConsole is installed locally for use at
docroot/vendor/bin/drupal
. - Creates environment variables based on your .env file. See .env.example.
First you need to install docker.
Clone this repo in your desired directory:
git clone [email protected]:Bixal/solutioning-exercise.git
cd solutioning-exercise
Set default environment variables and connection strings:
cp .env.example .env
cp docroot/sites/default/settings.local.php.example docroot/sites/default/settings.local.php
Initialize the docker containers with Ngnix, Drupal app, and MariaDB:
docker-compose up -d
Install a standard Drupal application:
make installdrupal
Setup the application:
Note: You don't have to execute this command if you have a db dump file(s) in your mariadb-init folder. In that case execute
make setup
.
To stop the containers execute:
make stop
If you want to know more available commands, please review the following document [Makefile][makefile]
Redirect cmssolution.docker.localhost to your localhost:
sudo sh -c "echo '127.0.0.1 cmssolution.docker.localhost' >> /etc/hosts"
Lastly, navigate to https://cmssolution.docker.localhost:8000 in your Web browser of choice.
Instead of installing the site, you can choose to place a .sql or .sql.gz file in mariadb-init. All files in this folder will be imported, in alphabetical order. .sql and .sql.gz files are gitignored so you do not have to worry about them getting committed.
- Clone the project's repo.
- Place an updated db dump (.sql or .sql.gz) file in mariadb-init.
- Create a feature branch for the code changes you're looking to make:
git checkout -b your-descriptive-branch-name origin/master
. - Write some code!
- Run the application and verify that your changes function as intended. Remember to run
make cr
if you are not seeing your changes. - If your changes would benefit from testing, add the necessary tests and verify everything passes.
- Export the configuration with your changes:
make cex
. - Run tests and coding standards:
make codeck
- Commit your changes:
git commit -am 'Add some new feature or fix some issue'
. (See this excellent article for tips on writing useful Git commit messages.) - Push the branch to solution exercise repository: git push -u origin your-descriptive-branch-name.
- Wait until al checks are passed.
- Create a pull request and request a review from a minimum of two team members.
make codeck
If you need to apply patches (depending on the project being modified, a pull request is often a better solution), you can do so with the composer-patches plugin.
To add a patch to drupal module foobar insert the patches section in the extra section of composer.json:
"extra": {
"patches": {
"drupal/foobar": {
"Patch description": "URL or local path to patch"
}
}
}