Skip to content

Instantly share code, notes, and snippets.

@kerasai
kerasai / !Robo-Setup.md
Last active November 3, 2023 16:59
Robo Setup

Robo Setup

Basic installation

Install dependencies:

lando composer require --dev consolidation/robo \
  drupal/coder \
 kerasai/robo-drupal:^1@rc \
@kerasai
kerasai / !Drupal-Project-Setup.md
Last active May 3, 2024 15:59
Drupal Project Setup

Drupal Project Setup

Drupal poject setup steps, for use in Lando environment.

Lando setup

  1. lando init
  2. Copy, adjust pertinent sections from provided .lando.yml
  3. lando start
@kerasai
kerasai / GitHub Actions Debugging
Last active July 29, 2022 15:04
Steps for debugging Apache and PHP configuration.
# View Apache setup.
- name: Apache setup
run: |
echo '--- /etc/apache2 ---'
sudo ls /etc/apache2
echo '--- /etc/apache2/conf-available ---'
sudo ls /etc/apache2/conf-available
echo '--- /etc/apache2/conf-enabled ---'
sudo ls /etc/apache2/conf-enabled
echo '--- /etc/apache2/mods-available ---'
#!/bin/bash
if [ -z "$1" ]; then
exit
fi
lando terminus drush $1 -- updatedb -y --no-cache-clear && \
lando terminus drush $1 -- cache:rebuild && \
lando terminus drush $1 -- config:import -y && \
lando terminus drush $1 -- cache:rebuild
@kerasai
kerasai / .lando.yml
Created July 16, 2021 16:06
Example Lando File
name: example-site
recipe: drupal8
config:
php: '7.4'
webroot: web
xdebug: true
tooling:
behat:
service: appserver
cmd:
@kerasai
kerasai / archive.sh
Created May 24, 2021 20:58
Static Site Archive
// Before you can do this, get http://brew.sh/
// Then get wget: brew install wget
//
// Grab an entire static archive of a site. (This might take a while)
wget -mkEpnp http://sitename.com
@kerasai
kerasai / backup_files.sh
Created April 26, 2021 22:31
TAR Files Backup
#!/bin/sh
# Run from /sites/default, etc.
tar \
--exclude='files/private/backup_migrate'\
--exclude='files/css' \
--exclude='files/js' \
--exclude='files/styles' \
-zcvf files.tar.gz files/
@kerasai
kerasai / commit-msg
Created November 4, 2020 23:16
Commit message validation for JIRA ticket number.
#!/bin/sh
MSG=$(head -n 1 $1)
PATTERN='[A-Z]+-[0-9]+: .'
# Allows us to read user input below, assigns stdin to keyboard
exec < /dev/tty
if [[ ! $MSG =~ $PATTERN ]]; then
echo 'Commit message does not match the format "ABC-123: i did some stuff".'
@kerasai
kerasai / prepare-commit-msg
Last active November 4, 2020 22:44
Script for Git Prepare Commit Message Hook - Attempts to prefix with JIRA issue number
#!/bin/bash
# Looks for a JIRA style ticket name in the branch name, and prefixes the
# commit message with the ticket, if found.
#
# If you're using the `git commit -m` style commit command, the issue number
# will be prefixed without notice.
#
# If you use the standard `git commit` command where you're sent to an editor,
# the issue number will appear as the default commit message in the editor.
@kerasai
kerasai / behat.yml
Created October 21, 2020 19:25
Behat w/Self Signed Certs
default:
extensions:
Behat\MinkExtension:
base_url: https://mysite.local
goutte:
guzzle_parameters:
verify: false