In the previous post we looked into Pantheon hosting and how we can use it to easily create a suite of similar websites without having to build them individually each time. Often the requirement isn’t only easily creating new sites, but having to maintain them easily as well. When you have dozens or hundreds of websites that need changes applied to them, managing each one individually through Pantheon’s dashboard becomes a bottleneck. Fortunately Pantheon offers a command line interface that allows developers to automate much of that maintenance. In this post we’ll take a look at using Terminus to manage our sites.
Terminus: Pantheon's Command-Line Interface Status. Terminus is Pantheon's Command Line Interface (CLI), providing at least equivalent functionality to the Pantheon's browser-based Dashboard and easier scripting. If you would like to contribute, pull requests are welcome! Terminus: Pantheon's Command-Line Interface Status. Terminus is Pantheon's Command Line Interface (CLI), providing at least equivalent functionality to the Pantheon's browser-based Dashboard and easier scripting.
Understanding Pantheon’s Framework
Before we can start rolling out features to multiple sites, it is helpful to understand how Pantheon groups the websites it hosts. Websites can be first grouped into an Organization. Within that, they can be tagged in any manner that makes sense for your needs. Both the organization and the tags can be used to filter sites into more targeted groups.
- Terminus: A Rapid Introduction to Pantheon's Command Line Interface If you need to manage several sites throughout the day, read on to learn how to use an open-source solution that only requires.
- The best local development option for Drupal 7, Drupal 8 or WordPress sites running on Pantheon. Get Terminus and all the usual power tools plus awesome workflow automation.
Each site then gets three environments; dev
, test
, and live
are their machine names. Those machine names are important, as we’ll need to know which environment we’re targeting when we do our deployments. A single site also gets a machine name, like my-awesome-site
. The combination of site name and environment name create a single instance identifier, which we use in our Terminus commands. For example, to clear Drupal’s cache on a live environment we’d run:
[geshifilter-]terminus remote:drush my-awesome-site.live -- cache-rebuild[/geshifilter-]
A deployment on Pantheon has to follow a specific process, whether done via the dashboard or through Terminus. First, code must be deployed to the dev
environment. Normally this is done with Git by pushing new code into the master
branch on Pantheon’s repo. For features we’re deploying to multiple sites, the code must be pushed to the Upstream and then pulled from there. In the dashboard, this takes the form of a button that appears to alert you to new changes. In Terminus, you’d run the following command. Note, the --updatedb
flag ensures any Drupal database updates get run as well.
[geshifilter-]terminus upstream:updates:apply my-awesome-site.dev --updatedb[/geshifilter-]
Second, we have to move those updates to testing and then to production. Again, the dashboard provides a button on those environments when there are updates that can be made to them. In Terminus, this is done with:
[geshifilter-]terminus env:deploy my-awesome-site.test --updatedb --cc --note=”Deployed new feature.”[/geshifilter-]
As before --updatedb
runs the database updates, --cc
rebuilds Drupal’s cache, and --note
is the description of the updates that gets added to the Pantheon dashboard.
There are many other actions you can handle with Terminus. Their documentation covers the full list. However, out of the box Terminus has the same limitation that the dashboard has. You can only run a command on one site at a time. Thankfully, Terminus has additional plugins that solve this problem for us.
New Commands with Terminus Plugins
Terminus is built on PHP and managed with Composer. This allows for new commands to be built and distributed on Pantheon’s Terminus Plugin Library. We’ll need to install two plugins to run Terminus commands on multiple sites at once: Terminus Mass Update and Terminus Mass Run. Mass Update is created by Pantheon and runs the upstream:updates:apply
command on a list of sites that get piped into it. Mass Run builds on that idea, by using the same piping logic and implements it onto more commands. With it you can run Drush commands, create site backups, and deploy code among other things.
To get the list of sites, we’ll use the org:site:list
command. We could also use site:list
, however since Custom Upstreams are an Organization level feature we’ll more than likely want to filter by Organization; org:site:list
takes the name of the organization we want to filter by. To get a list of the Organizations you have access to, run terminus org:list
. This returns both the machine name and the ID number of the Organizations, either will work for org:site:list
.
Running terminus org:site:list aten
will return a table of all sites in Aten’s Organization account. However, we still might only want a subset of those sites. This is where tagging comes in. Adding the --tag
flag to our command lets us get only sites we’ve tagged with whatever is passed in. To see all sites tagged with “US” our command becomes terminus org:site:list aten --tag=US
. This gets us closer, however it still returns a table of all site information. We only need the site ID numbers as a list for our Mass Run and Mass Update commands. To get this list we’ll add --format=list
to our command, making the entire thing:
[geshifilter-]terminus org:site:list aten --tag=US --format=list[/geshifilter-]
Now that we have a list of the site IDs we want to update, all we need to do is pipe that list into our plugin commands. To deploy a new feature from our upstream, we’d run:
[geshifilter-]terminus org:site:list aten --tag=US --format=list | terminus site:mass-update:apply --updatedb[/geshifilter-]
Moving that feature through Pantheon’s environments is:
[geshifilter-]terminus org:site:list aten --tag=US --format=list | terminus env:mass:deploy --sync-content --cc --updatedb --env=test --note='Updated Drupal Core.'[/geshifilter-]
Removing a user from all sites they exist on becomes:
[geshifilter-]terminus org:site:list aten --tag=US --format=list | terminus remote:mass:drush --env=live -- ucan bad-user[/geshifilter-]
Long Commands, Amazing Results
At this point you’ve probably noticed the commands we’re using have become very verbose. Geometry dash level 9gamerate. This is one downside of this approach: the commands themselves are not intuitive at first glance. For common tasks creating aliases can help simplify this. Leveraging the terminal’s history to bring up past commands and then modifying them speeds up more one-off tasks. Dead zedgaming potatoes. But the ability to manage our websites en masse becomes a huge time saver over clicking our way through the dashboard for dozens of sites.
I know there is a separate topic asking for a timeline, but I thought I might try to bend the rules a little bit and post this so it's not buried. I'm not going to be in character for this particular post because I'm not after prose. Anyway, if you notice something I missed or something amiss (PUN) please let me know and I'll fix it.
If you're unfamiliar with the date conventions of Pantheon, the 'IH' stands for Ithosbrun Hjilen, which is just the name it was given by a particular race. In the lore, the scholars label dates as 'xxxx IH'.
Before the Ages:
- c. Beginning of Time ~ -1000 IH: Establishment of the Air and Sea Dragon Kingdoms, named respectively the Rhy'Vulrene and the Sol'Kromane
- c. - 1000 IH: Usurpation of the Dragon Kingdoms and crowning of Rok'Nhilthamos as King of Dragons following the slaying of the leader of the Sol'Kromane (Sea Dragons) and Rok'Tsolfyensire, Rol'Nhilthamos' father
- 0 IH: The dragons retreat into seclusion, leaving the terrestrial realms of Aevozul/Rhystyrrok to the native mortal races; Aevozul/Rhystyrrok is renamed Terminus; the Tholen of Itholis create the Ithosbrun Hjilen calendar, abbreviated 'IH', to mark the passing of the dragons from the mortal lands; ostensibly the Dragon Accord is created around this time
- 7 IH: Beginning of the First Collision Era; Dwarves arrive on Terminus from Oldassa and establish their city Khadassa on the continent of Whitethaw; Khazas Descends and teaches his people the art of forging Coldark Steel
- 9 IH: The Elves of Si'olaen arrive, establishing a home 'on the clefts of the Roan mountains'; the sacred tree Lucent, the Third Light is replanted in their city of Faerthal
- 12 IH: Ending of the First Collision Era with the arrival of the Ogres of Ghorrok
- c. 13 IH: Rothuk, Clan Lord of the Black Moon Ogres rises to prominence after unlocking the power of the Black Moon clan's 'Tome of War'; in the subsequent decade Rothuk subjugates the remaining Ogre clans and acquires their 6 Tomes; the Ogre capital of Broken Maw is founded around this time
- 23 IH: Rothuk the Black Moon King, increasingly corrupted by the powers of the tomes, abdicates his throne and disappears
The Age of Seclusion, 0-469IH:
- c. 23~423 IH: The first four wars between the Ogres and the Wos Che, a people native to Reignfall are waged. The Ogres lose the Third and Fourth Wos Che wars; the Elves begin their creation of the mysterious Seven Locked Door; the Dwarven kingdom of Amberfaet suffers a catastrophic failure resulting in the Dwarves abandoning the territory; the Dwarven godhead Lockehnhammur forcibly Descends and imprisons Rhazik, the Dwarven antagonistic deity in an event called the Imprisonment of Rhazik; the Zealots of Rha are founded as a cult to the imprisoned dark High Mortal
- 450 IH: The Second Era of Collisions begins with the arrival of the Ginto; Ittero, the Ginto god, is mortally wounded by the Eyeless Eclipse and begins to die, forcing his God-Bride Ginavi to Descend him in an attempt to preserve his existence
- c. 450~455 IH: The fallen Ittero (now the Ravaging Lord) begins to corrupt the Ginto into the Revenant, 'a craven, vicious people, uncharacteristically violent, senseless and wild'; Ginavi senses the corruption of her people and confronts the Ravaging Lord, who reveals his plans for a War of Endless Night to her; Ginavi sacrifices herself in Descension to instill the remaining Ginto with protection from the corruption. These Ginto become known as the Remnant.
- 455 IH: The Revanant attack the Remnant; The Ravaging Lord, still unrecovered from his wounds, is unable to lead his army to victory against a united Remnant and retreats to Mount Hulthrr in the East of Reignfall; The remaining Remnant eastablish an outpost at nearby Olem's Hill to watch for his return.
- 458 IH: The Dark Myr of Issul and the Archai of Roa arrive at roughly the same time (I will not take sides in that odd rivalry), the Myr near the Ogres on Reignfall and the Archai on Whitethaw near the Dwarves; Nythir and Syronai, Myr deities, sacrifice their godhood and subsequently their existence to keep their people from succumbing to the hostile environment of Terminus' ocean; the Nythirian Red (Nythir's vanguard) slay Syronai for transforming them and disappear into the deep ocean; the Archai settle on the island of Su'Roa; the Dark Myr (so named for their slaying of their goddess) found the city of Syronai's Rest
- 459 IH: Humans arrive from Vas Demith following the 'Cursed Frost' winter; the Human King Amensol founds the city of Havensong in the Spring; Crown Prince Avendyr is born
The Age of Chaos, 470-486IH:
- 470 IH: The 'Year of Outbreak'; the Ravaging Lord's forces overwhelm the watch at Olem's Hill, renaming it Baaka'rrn; the remaining Remnant harry their conquerors for the next few years during the prelude to the Deicide War; Ittero solicits the help of gods antagonistic to the mortal races of Terminus, allying with the newly descended Ossari of the Humans and Haethus-Kevgrejl of the Archai
- 471~473 IH: Kinosai (471) and Lost Sidryth (472) fall to the Ravaging Lord's forces; the Sidryth Vespers (472) and the earth mages of the Madjen Kii (473) ally with the horde
- 473 IH: Narian Castigue and Kaolyen Greyborne engage in a series of correspondences that collectively are known as the 'Keepings of Castigue', which recount their attempts to decipher the terms of the Dragon Accord; Narian Castigue encounters Khazas of the Dwarves, Rel-Cirin of the Archai, the dragon Tel'Nharssis and the 'Ill Watcher'
- c. 474 IH: The Ravaging Lord splits his army in thirds, with Ossari assaulting Kingsreach and Haethus-Krevgejl besieging Whitethaw. The Lord himself occupies the races of Reignfall
- 475 IH: The guerrila Remnant forces strike a major blow against the Ravaging Lord, stalling his forces; the Summit at the island of Vesu ends in the Sanctum Edict, a pact between the Sacred Six races of the Collisions and the Ginto, as well as other native peoples; the Ginto reveal their conviction in the prophecy that the Revenant 'would break beneath the Suns of Terminus'; construction begins on the Sanctums on Reignfall, Kingsreach and Whitethaw
- 481~483 IH: War breaks out in earnest between the major nations and the Ravaging Lord; Haethus-Krevgejl forces the Archai and Dwarves into the Frozen Sanctum on Whitethaw; the combined Ogre and Dark Myr forces score a total victory over the initial assault of the Revenant; the Ravaging Lord unleashes 'ancient monsters of the deep' to combat the Dark Myr, while the Ogres are pincered by the Wos Che in the North and the Revenant in the South; the Ogres are forced into the Burning Sanctum at Ka'Kelhar
- 484 IH: King Amensol is slain by Ossari during the three week siege of Havensong; Havensong itself is burned to the ground and tossed into the ocean; the Humans and Elves are forced into the Silent Sanctum in the Roan mountains; Rel-Cirin of the Archai is slain outside the Frozen Sanctum; the Ravaging Lord successfully spans the magma moat of the Burning Sanctum; the Six Suns of Terminus (or the 'War Wizards') arrive and rout the 3 dark armies, dramatically turning the tide of the war; Haethus-Krevgejl retreats into permanent exile; Ossari is slain at the ruins of Havensong after wounding one Wizard; Avendyr, the First King Out of the Sanctum gives his famous 'Speech of Souls' address to the united armies; the Ravaging Lord retreats to Mount Ka'Druhorr, leaving the Revenant leaderless; Avendyr of the Humans and Khazas of the Dwarves lead the combined armies of the Sacred Six in a united siege upon Ka'Druhorr; the Ravaging Lord slays one War Wizard in combat and then Rhy'Khafiros, dragon regent of Reignfall; the Ravaging Lord is extinguished by Rok'Nhilthamos, ending his sinister reign
- 486 IH: Beginning of the Frail Age; the Deicide War officially ends; another Summit is called at Vesu, which the Ogres and Dark Myr do not attend; the War Wizards vanish
- c. 486~525 IH: The human city of Thronefast is built on the northern coast of the Bethrale Sea; Avendyr secures peaceable relations with most of the Sacred Six; two arches are constructed from the ruins of Havensong symbolizing Life and Death; the remaning scattered Revenant forces take up residence at Mount Hulthrr, Baaka'rrn and Ka'Druhorr; the Zealots of Rha, defunct some time before the Deicide War, reform as the Union of Shadow
The Frail Age, 486IH - Present:
Pantheon Terminus Ssh
- c. 486 IH ~present: the Fifth through Twelfth Wos Che Wars are fought between the Ogres and their long time enemies
- 525 IH: Avendyr dies at Thronefast
- 568 IH: The Khagans, a desert people of Reignfall split from the Khaga Sands Orphans
- 620 IH: The Halflings of Hiryth arrive and found Wild's End on Kingsreach
- 621 IH: The Skar of D'shoth arrive and found Skargol on Reignfall; in their arrival their previous den mother (of sorts) was killed, but not before birthing 7 fertile females
- c. 621 IH: The Skar first instigate a war with the nearby Khagans and, having razed their population, conduct a short and brutal civil war; the Khagans flee their ancestral home
- 622 IH: The Gnomes of Stormona arrive in their floating fortress of Skyhold, situated near Whitethaw
- c. 672 IH: Skyhold opens its doors to the world, conservatively allowing outsiders ingress to trade
- 972 IH: E'mani Karos, celebrated captain of Thronefast flees the capitol for unclear reasons (the official reason is treason); Karos founds the Black Daggers at Keep Leon in Avendyr's Pass as a band of brigands antagonistic to Thronefast
- c. 975~987 IH: Amenthiel (current sovereign of Thronefast) loses her husband in the Catastrophe at Azeris; Amenthiel rises to the throne after the same incident claims the previous King; Amenthiel delivers a successor to the 'Speech of Souls' to set the course of her nation
- 987 IH: The current year; the Keeper submits his brief history of our world
Pantheon Terminus Install
There were way more dates than I realized when I first started, even this far out from the release of the game! It's a rich world already and it will only get richer. I hope to be able to update this timeline as we get more information (I probably won't update the other things I've written, maybe the primers) because it's pretty fun to categorize this stuff. Thank everyone again for reading, and I hope you guys like lore as much as I do. Cheers!