Share
Embed
Pantheon Terminus
Presented at drupal and wordpress meetup in Microtel, Mall of Asia, Pasay City, Philippines
Paul de Paula
June 26, 2016
Transcript
19 slides
-
Pantheon.io 2 WHO AM I ? Customer Success Engineer @
Pantheon Technical Reviewer @ drupal.Org Lead Advocate of Drupal Pilipinas -
Pantheon.io 3 TERMINUS ALLOWS YOU TO: ‣ Create new sites,
including sites using Drupal Installation Profiles ‣ Trigger workflow operations, including deploying and syncing ‣ Connect to services (e.g. mysql or redis) over secure SSH tunnels -
– Pantheon One of our goals in building Pantheon was
to free web developers from the role of “accidental sysadmin” -
Pantheon.io 5 Installation Terminus is Pantheon's Command Line Interface (CLI),
providing equivalent functionality to the Pantheon Web Dashboard and easier scripting. ‣ Requirements: • PHP version 5.5.9 or later • PHP-CLI • PHP-CURL -
Pantheon.io 6 Installing with Composer The fastest and easiest way
to install Terminus is via Composer. Simply run this in your terminal client: $> composer require pantheon-systems/terminus -
Pantheon.io 7 Installing with cURL Run this in your terminal
client: $> curl https://github.com/pantheon-systems/terminus/ releases/download/0.11.2/terminus.phar -L -o /usr/local/ bin/terminus && chmod +x /usr/local/bin/terminus -
Pantheon.io 8 Installing with Homebrew(for Macs) If you do not
have homebrew-php already tapped, here are the commands for the taps: $> brew tap homebrew/dupes $> brew tap homebrew/versions $> brew tap homebrew/php And after you're all tapped out, install Terminus with this command: $> brew install homebrew/php/terminus -
Pantheon.io 9 Installing with Git Clone the repository. If you
plan on contributing to the project, create a fork and clone the fork instead. $> cd /install/location $> git clone https://github.com/pantheon-systems/ terminus.git terminus Install the Composer dependencies. $> cd terminus $> composer install -
Pantheon.io 10 Installing with Git Optionally, for ease of development,
we suggest aliasing or setting the path to this script in your Bash configuration file. This file is located at ~/.bashrc $> alias terminus="/install/location/terminus/bin/ terminus" Install the Composer dependencies. $> export PATH="$PATH:/install/location/terminus/bin" -
Pantheon.io 11 Importing Drush Site Archives with Terminus There are
a few things you'll need in order to make this work: ‣ A Pantheon account with at least one free Dev site slot open. ‣ A working local Drush installation that is up to date with 5.x or 6.x stable. SFTP development controls, including git commits ‣ Drush access to your existing Drupal site. -
Pantheon.io 14 Importing Drush Site Archives with Terminus $> drush
archive-dump --destination=drush-archive.tar.gz Generate a Drush archive of your existing site -
Pantheon.io 15 Importing Drush Site Archives with Terminus $> terminus
auth login $> terminus sites import $> Provide a name for the site. This will be part of the default URL: my-drush-import $> URL of archive to import: http://mysite.com/drush- archive.tar.gz $> Site is now building. $> The new site's UUID is xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx To get started with Terminus, you must first authenticate: -
Pantheon.io 16 Automate Imports with Terminus $> terminus sites import
--site=<sitename> --label=<label> --url=<archive/url.tar.gz> --org=<id> Every aspect of the Terminus process is designed to support automation. You can kick off an import non-interactively using the following options: -
Pantheon.io 18 WP-CLI with Terminus WP-CLI is a set of
command-line tools for managing WordPress installations. You can update plugins, set up multisite installs and much more, without using a web browser. $> wp cache add|decr|delete|flush|get|incr|replace|set|type $> wp post generate --count=1000 $> wp plugin install plugin-name $> wp post generate —count=1000 $> wp db query "SELECT id FROM wp_users;" terminus wp [CMD] —site=[SITENAME] —env=[ENVIRONMENT] -
Pantheon.io 19 DRUSH CLI with Terminus Drush is a command
line shell and Unix scripting interface for Drupal. Drush core ships with lots of useful commands for interacting with code like modules/themes/profiles. Similarly, it runs update.php, executes sql queries and DB migrations, and misc utilities like run cron or clear cache $> drush user-create USERNAME —mail=“[email protected]” --password="pass” $> drush user-add-role "administrator" --uid=<assigned uid> [email protected] terminus drush [CMD] —site=[SITENAME] —env=[ENVIRONMENT] EX. terminus --site=project-bolt --env=dev drush "sql-query 'show tables'"