Skip to content

Latest commit

 

History

History
200 lines (150 loc) · 6.91 KB

example-README.md

File metadata and controls

200 lines (150 loc) · 6.91 KB

My Project

This repository consists of the <machine_name>.

Getting Started

This project is based on BLT 12.x with Lando local env, an open-source project template and tool that enables building, testing, and deploying Drupal installations following Acquia Professional Services best practices. While this is one of many methodologies, it is our recommended methodology.

  1. Review the Required / Recommended Skills for working with a BLT project.
  2. Ensure that your computer meets the minimum installation requirements (and then install the required applications). See the System Requirements.

If Starting From Scratch

  1. Download the latest version of Drupal
$ composer create-project --no-interaction acquia/drupal-recommended-project <machine_name>
  1. Add the blt-lando plugin
$ composer require mikemadison13/blt-lando
  1. Setup your container settings by modifying your .lando.yml file.
$ blt recipes:vm:lando
  1. Finalize settings and setup
$ blt setup

Note: if you receive a failure during the install related to the database, please check the docroot/sites/default/settings/local.settings.php file to ensure that the proper credentials are in the database array. This is a very common problem with Lando!

Working from an existing project

  1. Request access to organization that owns the project repo in GitHub (if needed).
  2. Fork the project repository in GitHub.
  3. Request access to the Acquia Cloud Environment for your project (if needed).
  4. Setup a SSH key that can be used for GitHub and the Acquia Cloud (you CAN use the same key).
    1. Setup GitHub SSH Keys
    2. Setup Acquia Cloud SSH Keys
  5. Clone your forked repository. By default, Git names this "origin" on your local.
$ git clone [email protected]:<account>/<machine_name>.git
  1. To ensure that upstream changes to the parent repository may be tracked, add the upstream locally as well.
$ git remote add upstream [email protected]:acquia-pso/<machine_name>.git
  1. Install Composer dependencies. After you have forked, cloned the project and setup your blt.yml file install Composer Dependencies. (Warning: this can take some time based on internet speeds.)
$ composer install
  1. Setup Lando. Setup the container by modifying your .lando.yml with the configuration from this repositories configuration files.
$ lando start
  1. Setup a local Drupal site with an empty database. Use BLT to setup the site with configuration. If it is a multisite you can identify a specific site.
$ lando blt setup

or

$ lando blt setup --site=[sitename]
  1. Log into your site with drush. Access the site and do necessary work at #LOCAL_DEV_URL by running the following commands.
$ lando drush uli

Other Local Setup Steps

  1. Set up frontend build and theme. By default BLT sets up a site with the lightning profile and a cog base theme. You can choose your own profile before setup in the blt.yml file. If you do choose to use cog, see Cog's documentation for installation. See BLT's Frontend docs to see how to automate the theme requirements and frontend tests. After the initial theme setup you can configure blt/blt.yml to install and configure your frontend dependencies with blt setup.

  2. Pull Files locally. Use BLT to pull all files down from your Cloud environment.

$ lando blt drupal:sync:files
  1. Sync the Cloud Database. If you have an existing database you can use BLT to pull down the database from your Cloud environment.
$ lando blt sync

To start developing every time

  1. Start clean from the upstream's integration branch
git fetch upstream
git rebase upstream/develop
  1. Create a new feature branch from develop
git checkout -b JIRA-000-feature-branch
  1. Install Composer dependencies. After you have forked, cloned the project and setup your blt.yml file install Composer Dependencies. (Warning: this can take some time based on internet speeds.)
$ composer install
  1. Setup container
$ lando start
  1. Setup a local Drupal site

There are two options to setup a local Drupal site: with a clean database, or with a copy of a database from a cloud environment.

1. Setup a local Drupal site with an empty database. The blt-cohesion composer package will run all necessary site studio commands. 

Use BLT to setup the site with configuration.

$ lando blt setup


or  If it is a multisite you can identify a specific site.


$ lando blt setup --site=<machine_name>


2. Setup a local Drupal site with an existing database. If you have an existing database you can use BLT to pull down the database from your Cloud environment.


$ lando blt sync
  1. Log into your site with drush. Access the site and do necessary work at #LOCAL_DEV_URL by running the following commands.
$ cd docroot
$ lando drush uli

To Create a Pull Request.

  1. After you make changes inside your local drupal site. Export your configuration from the database to your configuration. Export your drupal config changes if you have them.
$ lando drush cex

To export Site studio configuration to your site studio package run the following command.

$ lando drush sync:export
  1. commit your changes and push your changes to your origin repository.
$ git status
$ git add -p
$ git commit -m"<machine_name>-000: Committing new changes to site."
$ git push --set-upstream origin <machine_name>-000-new-site-change
  1. Navigate to Github and open a pull request against the upstream. Assign a person on your team to review.

Resources

Additional BLT documentation may be useful. You may also access a list of BLT commands by running this:

$ blt

Note the following properties of this project:

  • Primary development branch: Develop
  • Local site URL: http://<machine_name>.lndo.site

Working With a BLT Project

BLT projects are designed to instill software development best practices (including git workflows).
Our BLT Developer documentation includes an example workflow.

Important Configuration Files

BLT uses a number of configuration (.yml or .json) files to define and customize behaviors. Some examples of these are:

  • blt/blt.yml (formerly blt/project.yml prior to BLT 9.x)
  • blt/local.blt.yml (local only specific blt configuration)
  • landio.yml (Lando configuration)
  • drush/sites (contains Drush aliases for this project)
  • composer.json (includes required components, including Drupal Modules, for this project)