Skip to content

Instantly share code, notes, and snippets.

View lcatlett's full-sized avatar
🍕

Lindsey Catlett lcatlett

🍕
View GitHub Profile
@lcatlett
lcatlett / README.md
Last active August 28, 2024 14:04
Enterprise Site Portfolio Deployments Scripting Library

Enterprise Many Site Deployment and Scripting Recommendations

This repository contains an example set of shell scripts that provide recommendations for Voya to execute CI / CD tasks at scale againt a large portfolio of Pantheon sites. Each script provided has inline docmentation for required functionality and additional examples of how to address common enterprise deployment challenges / requirements.

Features

  • Parallel execution of code and deployment tasks on multiple sites
  • Race condition handling for workflows, terminus commands, and git commands
  • Configuration of environment variables commonly required in enterprise deployment scripts
  • Automatic retries of failed site deployments
@lcatlett
lcatlett / 01-readme.md
Last active June 8, 2024 02:31
Enterprise CI / CD Release - Keepalive / Prime Site Portfolio

Keepalive Checks Script

This script is a wrapper to ensure that services are healthy and ready for code push and deployment tasks on Pantheon sites. It hardens the release process by adding:

  • Parallel execution of healthcheck and deployment tasks on many sites
  • Race condition handling for workflows and terminus commands
  • Automatic retry and wake of failed sites' services

Table of Contents

@lcatlett
lcatlett / call-deploy.yml
Last active May 31, 2024 21:19
Codeserver known host modificcation
name: 'Reusable: Deploy code to configurable Pantheon environment'
on:
workflow_call:
inputs:
environment:
required: true
type: string
site_id:
type: string
clone:
@lcatlett
lcatlett / collect-logz
Created May 28, 2024 14:46
Bulk Pantheon Log Collection
#!/bin/bash
# This script is used to streamline the process of collecting logs accross multiple environments and containers for a site.
# It sets up the necessary SSH configuration and keys to disable interactive prompts, then uses Terminus to collect logs from the desired site's environments.
# USAGE:./collect-logz <site> <env> where <env> is a single pantheon environment such as live or dev, or "all" to collect logs from all environments.
# EXAMPLE:./collect-logz ufc-com all will collect logs from all environments for the ufc-com site.
# EXAMPLE:./collect-logz ufc-com live will collect logs from the live environment for the ufc-com site.
# Put this script in /usr/local/bin/collect-logz and make it executable with chmod +x /usr/local/bin/collect-logz
SITE=$1
@lcatlett
lcatlett / Convert to InnoDB, Add missing PK, Dedupe PK
Last active August 8, 2023 15:24
Schema Changes For High Performance Drupal
ALTER TABLE ip2location_olson_timezone ENGINE=InnoDB;
CREATE TABLE tmp_s3 SELECT uri, filesize, timestamp, dir, version
FROM s3fs_file;
ALTER IGNORE TABLE tmp_seq ADD PRIMARY KEY (uri);
CREATE TABLE tmp_s3 SELECT uri, filesize, timestamp, dir, version
FROM s3fs_file;
ALTER IGNORE TABLE tmp_s3 ADD PRIMARY KEY (uri);
@lcatlett
lcatlett / .lando.yml
Last active August 10, 2022 20:06
Sample pantheon lando WP site network configuration
name: my-pantheon-site-network
recipe: pantheon
config:
framework: wordpress_network
site: my-pantheon-site-network
id: uuid
# Disable the SOLR index
index: false
# Enable the VARNISH edge
edge: true
@lcatlett
lcatlett / 404.sql
Last active August 10, 2022 16:18
Generate list of corrupted route caches in Drupal 9
SELECT `cid`, `data`, `expire`, `created`, `serialized`, `tags`, `checksum` FROM `cache_data` WHERE (`data` NOT LIKE '%parameters%') AND (`data` NOT LIKE '%access%') AND (`tags` = 'route_match') LIMIT 0,1000;
@lcatlett
lcatlett / redis.settings.php
Created August 9, 2022 23:00
Pantheon Advanced Redis Settings
/**
* Redis settings - these are enhancements to the default Pantheon Redis settings
* found on https://pantheon.io/docs/object-cache#enable-object-cache.
*
*/
if (defined('PANTHEON_ENVIRONMENT') && !\Drupal\Core\Installer\InstallerKernel::installationAttempted() && extension_loaded('redis')) {
// Set Redis as the default backend for any cache bin not otherwise specified.
$settings['cache']['default'] = 'cache.backend.redis';
@lcatlett
lcatlett / ssh-config-example.txt
Last active July 20, 2022 15:52
Sample ssh config to prevent dropped connections for Drush tasks
# Put this configuration in ~/.ssh/config.
# Note that any of the options available in ssh_config can be used in this file.
# See https://man.openbsd.org/ssh_config for the available options.
#
# These can also be configured on the cli via the -o parameter, and in the drush
# ssh.options configuraton in either drush.yml or the site alias .yml file.
# See https://linuxcommand.org/lc3_man_pages/ssh1.html and
# https://github.com/drush-ops/drush/blob/master/examples/example.drush.yml#L155-L159
Host *