> For the complete documentation index, see [llms.txt](https://allierays.gitbook.io/drupal-project-resources/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://allierays.gitbook.io/drupal-project-resources/development-resources/setup-local-development-enviornment.md).

# Setup Local Development Enviornment

README for a project

### Setting up for the first time

This project is based on BLT, an open-source project template and tool that enables building, testing, and deploying Drupal installations following Acquia Professional Services best practices.

* Ensure that your computer meets the minimum installation requirements (and then install the required applications). See the [System Requirements](http://blt.readthedocs.io/en/8.x/INSTALL/).
* Fork the parent repository in GitHub
* Request access to the Acquia-PSO organization in GitHub
* Request access to the Acquia Cloud Environment for MTACC
* Setup a SSH key that can be used for GitHub and the Acquia Cloud (you CAN use the same key)
  * [Setup GitHub SSH Keys](https://help.github.com/articles/adding-a-new-ssh-key-to-your-github-account/)
  * [Setup Acquia Cloud SSH Keys](https://docs.acquia.com/acquia-cloud/ssh/generate)
* Clone your fork

```
$ git clone git@github.com:<your_repository>/<project_name>.git
```

* Add the parent repository as an upstream

```
$ git remote add upstream git@github.com:acquia-pso/<project_name>.git
```

* Install Composer Dependencies (warning: this can take some time based on internet speeds. If you have problems delete the vendor folder and rerun the command.)

```
$ composer install
```

* Setup Virtual Machine (warning: this can take some time based on internet speeds)

```
$ blt vm
```

* SSH into your vagrant environment.

```
$ vagrant ssh
```

```
$ blt setup
```

#### Optional

* Sync your local environment with ACE's Dev Env

```
blt sync:refresh
```

## Starting a Ticket

1. Rebase from main branch: `$ git fetch upstream` and `$ git rebase upstream/develop`
2. Checkout a branch with the ticket-number `$git checkout -b MTACC-[ticket-number]`
3. Pull a full database: `$ blt sync:refresh`

## Making a pull request

1. Do whatever work is required for ticket
2. Create new commit(s) as needed. All commit messages should follow the pattern: PROJ-XXX: commit messages go here. They must include the Ticket Number (with a dash AND a colon), a message, and a period.
   * Run Tests / Validation Scripts

```
$ blt validate
$ blt tests
```

1. Ensure no other changes have been made to the upstream/develop. If they have, rebase your branch.

```
$ git fetch upstream
$ git rebase upstream/develop
```

1. Push back to your forked origin repo `$git push origin [branch-name]`
2. Go to github and create a pull request.
