Repository URL to install this package:
|
Version:
2.0.8 ▾
|
| bin |
| src |
| templates |
| vendor |
| .gitignore |
| README.md |
| composer.json |
| composer.lock |
| melt-deploy.sh |
| melt-pull-db.sh |
| melt-pull-files.sh |
| melt-push-db.sh |
| melt-push-files.sh |
melt Console leverages the wonderful Symfony Console along with Lando tooling to create a command line interface for our Drupal sites built with Lando.
We created meltconsole as a public package stored on Gemfury so we could leverage composer to install it as a dependency for our projects.
Add the following to the blt/composer.melt.json or main composer.json file:
{
"repositories": {
"meltmedia": {
"type": "composer",
"url": "https://php.fury.io/meltmedia/"
}
},
"require": {
"meltmedia/meltconsole": "^1.0.0"
}
}
Run lando composer update
development.pem file added to your ~/.ssh/ directory. See https://confluence.meltdev.com/display/CP/Development+Server+SSH+Keyvendor/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.Run:
lando meltconsole melt:create-environment
This will create the files needed for the server:
docroot/sites/default/settings/local.settings.php file.lando.local.yml file in the root of the project that contains:
nameproxyAlias: 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 so they don't have to worry breaking prod.
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. T
Example
lando meltconsole melt:re --env=pr25
If you don't pass the --env flag, you will be prompted to enter an environment name.
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 a temporary fix for now.