Skip to content

Instantly share code, notes, and snippets.


Juampy NR juampynr

View GitHub Profile
juampynr / config.yml
Last active February 26, 2021 01:10
Sample .tugboat/config.yml for a Drupal 8 contrib project (webform). Inspired by
View config.yml
image: q0rban/tugboat-drupal:8.8
default: true
http: false
depends: mysql
update: |
set -eux
# Check out a branch using the unique Tugboat ID for this repository, to
juampynr / extract_fields.php
Created July 17, 2020 16:43
Drupal 7: script to extract all fields
View extract_fields.php
* Drupal 7 field extract script.
* Extracts all fields into a csv file so it can be open with Google Spreadsheet, LibreOffice, or Excel.
* Usage:
* 1. Save this file to the docroot.
* 2. run drush php-script exctract_fields.php
juampynr / query.sql
Created July 14, 2020 13:44
Drupal 7: Extract all fields per content type
View query.sql
select fci.entity_type, fci.bundle, fci.field_name, fc.type, fc.module
from field_config_instance fci
inner join field_config fc on = fci.field_id
order by fci.entity_type ASC, fci.bundle ASC, fci.field_name ASC;
juampynr / RoboFile.php
Last active October 9, 2021 10:07
Drupal 8 common migration tasks
View RoboFile.php
* Command line tasks.
* @codingStandardsIgnoreStart
* @codeCoverageIgnore
* @SuppressWarnings(PHPMD)
class RoboFile extends \Robo\Tasks {
juampynr /
Created October 30, 2018 23:26
Tweak a migration group and commit the changes
# 1. Delete the migration group.
# This command needs the patch at
drush migrate:delete-group migrate_drupal_7
# 2. Recreate the migration group.
drush migrate:upgrade --legacy-db-key=drupal7 --legacy-root=sites/default/files --configure-only
# 3. Export the configuration, then review and commit the changes.
drush config:export -y
juampynr /
Last active October 30, 2018 23:16
Set up Drupal 8 and run the first migration
# 1. Download dependencies.
composer require drupal/migrate_tools:4.x-dev drupal/migrate_upgrade:3.x-dev drupal/migrate_plus:4.x-dev
# 2. Enable modules.
drush en -y migrate_tools,migrate_upgrade,migrate_plus
# 3. Generate a migration group.
drush migrate:upgrade --legacy-db-key=drupal7 --legacy-root=/var/www/drupal/drupal7 --configure-only
# 4. Export group into configuration and commit the files. Then review and commit the files.
juampynr /
Last active August 10, 2021 16:56
Drupal 7 Views 3 custom filter handler
dependencies[] = ctools
; Views Handlers
files[] = views/
juampynr /
Created March 27, 2018 09:35

Change Log

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog and this project adheres to Semantic Versioning.

[Unreleased] - yyyy-mm-dd

Here we write upgrading notes for brands. It's a team effort to make them as

juampynr /
Last active December 16, 2017 11:13
Drupal 8: Common steps to run after deploying code. See for further details.
#!/usr/bin/env bash
# If this is a production deployment script, append: --no-dev --optimize-autoloader --prefer-dist
composer install -vvv
drush updatedb -y -v
drush config-import -y -v
juampynr / script.pipeline
Created July 7, 2017 10:01
Jenkins job to sync Production into Develoment
View script.pipeline
String pro_domain = ''
String dev_domain = ''
String drush_pro = "drush -l ${pro_domain} -r /var/www/${pro_domain}/current/web"
String drush_dev = "drush -l ${dev_domain} -r /var/www/${dev_domain}/current/web"
String files_pro = "/var/www/${pro_domain}/shared/web/sites/default/files/"
String files_dev = "/var/www/${dev_domain}/shared/web/sites/default/files/"
String rsyncOpts = '-azv --delete --exclude .php --exclude php --exclude styles'
String deploySshKeyId = 'some-key-id'
lock(resource: "") {