Skip to content

Instantly share code, notes, and snippets.

@ranqiangjun
Forked from jmolivas/how-to-setup.md
Created November 5, 2016 15:08
Show Gist options
  • Save ranqiangjun/6b7203858ac200b8dffcfd75faf1eb58 to your computer and use it in GitHub Desktop.
Save ranqiangjun/6b7203858ac200b8dffcfd75faf1eb58 to your computer and use it in GitHub Desktop.

Contribution setup instructions

Fork DrupalConsole

Fork your own copy of the DrupalConsole repository to your account

Clone

Get a copy of your recently cloned version of console in your machine.

$ git clone [email protected]:[your-git-user-here]/DrupalConsole.git

If you have the project cloned already Make sure you sync with upstream for the latest changes.

Configuring a remote fork:

Specify and configure a new remote upstream repository that points to the upstream repository in Git.

git remote add upstream https://github.com/hechoendrupal/DrupalConsole.git

Syncing your fork

Sync your fork to keep it up-to-date with the upstream repository.

git fetch upstream
git merge upstream/master

Install dependencies

Now that you have cloned/updated the project, you need to download/update dependencies via Composer.

$ cd /path/to/DrupalConsole
$ composer install

Install Drupal using DrupalComposer project

composer create-project \
drupal-composer/drupal-project:8.x-dev \
drupal.dev \
--prefer-dist \
--no-progress \
--no-interaction

Where drupal.dev is the directory name where Drupal 8 will be installed.

Confirm DrupalConsole downloaded version.

Execute composer show | grep drupal/console from new drupal.dev created directory you should see an output like this one.

drupal/console                        1.0.0-beta5 The Drupal Console is a CLI tool to g...

Update composer.json adding local repository.

    "repositories": [
        ...
        {
            "type": "path",
            "url": "/PATH/TO/DRUPAL-CONSOLE"
        }
    ],

Where /PATH/TO/DRUPAL-CONSOLE is the path where DrupalConsole was previously cloned.

Update composer.json Drupal Console package to read from local cloned repo.

"require": {
        ...
        "drupal/console": "*",
        ...
},

Remove DrupalConsole vendor directory

rm -rf vendor/drupal/console

Update DrupalConsole using composer

composer update

Confirm DrupalConsole was updated

Execute composer show | grep drupal/console you should see an output like this one.

drupal/console                     dev-master 76112d9 The Drupal Console is a CLI to...
drupal/console-core                dev-master ab53750 Drupal Console Core
drupal/console-en                  dev-master df8f0be Drupal Console English Language

Confirm DrupalConsole is properly working

Change to web directory executing cd web and execute ../vendor/bin/drupal list. You should see something like this.

...
Available commands:
  about           Display basic information about Drupal Console project
  check           System requirement checker
  complete        Shell completion command list
  exec            Execute an external command.
  help            Displays help for a command
  init            Copy configuration files to user home directory.
  list            Lists all available commands
 settings
  settings:debug  List user Drupal Console settings.
  settings:set    Change a specific setting value in DrupalConsole config file


 [WARNING] In order to list all of the available commands you should install drupal first.

Install DrupalConsole launcher tool

curl https://drupalconsole.com/installer -L -o drupal.phar
mv drupal.phar /usr/local/bin/drupal
chmod +x /usr/local/bin/drupal

NOTE: If you have the global executable already in your system, use self-update command to download the latest version.

Copy configuration files (make sure you answer yes to first question)

drupal init

Confirm executable is working properly

Move to drupal.dev directory and execute drupal list.

Available commands:
  about           Display basic information about Drupal Console project
  check           System requirement checker
  complete        Shell completion command list
  exec            Execute an external command.
  help            Displays help for a command
  init            Copy configuration files to user home directory.
  list            Lists all available commands
 settings
  settings:debug  List user Drupal Console settings.
  settings:set    Change a specific setting value in DrupalConsole config file


 [WARNING] In order to list all of the available commands you should install drupal first.

Install Drupal

Execute drupal site:install and answer question using the interactive mode.

Execute the server command, open your browser and point it to http://127.0.0.1:8088.

Write you code changes

You can now make changes on your DrupalConsole local branch and should be reflected on your site immediately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment