Repository URL to install this package:
|
Version:
2.3.0 ▾
|
meltmedia/meltconsole
/
README.md
|
|---|
melt Console is a command line utility that offers quite a few commands to help Drupal developers interact with the Drupal Land server and uses the wonderful Symfony Console as it's base for command line interactivity.
We created meltconsole as a public package stored on Gemfury so we could leverage composer to install it as a dependency for our projects.
composer.json in your Drupal project directory
composer config repositories.meltmedia composer https://php.fury.io/meltmedia/
composer require meltmedia/meltconsole
development.pem file added to your ~/.ssh/ directory. See https://confluence.meltdev.com/display/CP/Development+Server+SSH+Keymelt:setup-local meltconsole command from the bin directory
vendor/bin/meltconsole melt:setup-local
This will create a .lando.local.yml file that will contains configuration that meltconsole uses. This file should be added to the .gitignore. It also creates a .lando.base.yml yml file that contains some global defaults.The following steps in this section require it be done on the server.
Log into the server and run
composer global config repositories.meltmedia composer https://php.fury.io/meltmedia/
composer global require meltmedia/meltconsole
To update meltconsole after it's installed globally, run:
composer global update meltmedia/meltconsole
~/.meltconsole.envCreate a ~/.meltconsole.env file. Top secret credentials should be stored in environment variables and not committed to git. Here are the current environment variables that meltconsole uses:
export MELT_DB_USER=''
export MELT_DB_PASS=''
export MELT_ENV='aws'
.meltconsole directory@TODO
This directory was created to house twig template for nginx, ssl, and drupal config files. We may want to find a better way to do this. Sebi thought these particular files shouldn't be stored in git...well he's gone...so now what!!!
Alias: melt:ce
If you've used Pantheon before, this option is similar to their multi-dev environment feature. This allows developers to spin up a new environment in isolation from other environments.
Some common environments are dev, qa, stage, or uat, however you can name them whatever you want.
Example
lando meltconsole melt:ce --env=dev
If you don't pass the --env flag, you will be prompted to enter an environment name.
Alias: melt:re
Just as easy as it is to create an environment, it's as easy to remove an environment with this command.
Example
lando meltconsole melt:re --env=pr25
If you don't pass the --env flag, you will be prompted to enter an environment name.
Alias: melt:sl
Generates the following files:
.lando.base.yml.lando.local.yml (add to .gitignore file)docroot/sites/default/settings/local.settings.php (add to .gitignore file)Alias: melt:ss
This command is ONLY ran on the server. It creates nginx config files and generates an SSL certificate using LetsEncrypt.
Alias: melt:pulld
Pulls database from remote environment to local.
Alias: melt:pullf
Pulls files from remote environment to local
Alias: melt:dc
Deploys code to remote environment
Alias: melt:sre
Sync database and/or files between environments on the server. This is useful if you just want to override one of the environments.
New commands can be created by adding new classes to the src/App/Commands directory. All commands SHOULD extend the MeltCommand.php class because it contains a bunch of different helper methods. After the class has been created, you'll need to instantiate the command in the bin/meltconsole file. e.g.:
use MeltConsole\App\Commands\AwesomeNewCommand;
$app->add(new AwesomeNewCommand());
To add/update/delete features for meltconsole, the code is stored under meltmedia's gemfury account. If you don't have a gemfury account, ask one of our devops peeps to add you. After that:
git remote add fury https://git.fury.io/meltmedia/meltconsole.git
git push fury master
v1.0.0 and we need to update the version to v1.1.0, we run:
git tag -a v1.1.0 -m="v1.0.0"
git push fury v1.1.0
You may be wondering, why are the dependencies for meltconsole in a suggest object rather than using the require. Well because, we're using the latest version of Symfony v4 whereas Drupal is using v3. We run into conflicts when running composer install since Drupal 8 requires v3. This is a temporary fix for now.