Skip to content

Instantly share code, notes, and snippets.

Juampy NR juampynr

View GitHub Profile
@juampynr
juampynr / commands.sh
Created Oct 30, 2018
Tweak a migration group and commit the changes
View commands.sh
# 1. Delete the migration group.
# This command needs the patch at https://www.drupal.org/project/migrate_tools/issues/2977501#comment-12640911
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
juampynr / bash.sh
Last active Oct 30, 2018
Set up Drupal 8 and run the first migration
View bash.sh
# 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
juampynr / mymodule.info
Last active Apr 19, 2019
Drupal 7 Views 3 custom filter handler
View mymodule.info
dependencies[] = ctools
; Views Handlers
files[] = views/mymodule_handler_filter_myfiltername.inc
@juampynr
juampynr / CHANGELOG.md
Created Mar 27, 2018
Sample CHANGELOG
View CHANGELOG.md

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
juampynr / update-path.sh
Last active Dec 16, 2017
Drupal 8: Common steps to run after deploying code. See https://www.lullabot.com/articles/a-successful-drupal-8-deployment for further details.
View update-path.sh
#!/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
juampynr / script.pipeline
Created Jul 7, 2017
Jenkins job to sync Production into Develoment
View script.pipeline
String pro_domain = '2017.drupalcamp.es'
String dev_domain = 'dev.drupalcamp.es'
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: "dev.drupalcamp.es") {
@juampynr
juampynr / deployment.log
Created Jul 7, 2017
Jenkins dev deployment success
View deployment.log
Started by GitHub push by juampynr
Ejecutando.en el espacio de trabajo /var/lib/jenkins/jobs/DrupalCampSpain-dev-deploy/workspace
> git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
> git config remote.origin.url git@github.com:AsociacionDrupalES/DrupalCampSpain.git # timeout=10
Cleaning workspace
> git rev-parse --verify HEAD # timeout=10
Resetting working tree
> git reset --hard # timeout=10
> git clean -fdx # timeout=10
@juampynr
juampynr / deployment.log
Last active Jul 7, 2017
DrupalCamp Spain - Dev deployment failure Jenkins log.
View deployment.log
Started by GitHub push by juampynr
Started by GitHub push by juampynr
Ejecutando.en el espacio de trabajo /var/lib/jenkins/jobs/DrupalCampSpain-dev-deploy/workspace
> git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
> git config remote.origin.url git@github.com:AsociacionDrupalES/DrupalCampSpain.git # timeout=10
Cleaning workspace
> git rev-parse --verify HEAD # timeout=10
Resetting working tree
> git reset --hard # timeout=10
@juampynr
juampynr / log.txt
Created Jul 6, 2017
DrupalCamp Spain 2.2.2 deployment Jenkins log
View log.txt
Lanzada por el usuario Juampy NR
Ejecutando.en el espacio de trabajo /var/lib/jenkins/jobs/DrupalCampSpain-prod-deploy/workspace
> git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
> git config remote.origin.url git@github.com:AsociacionDrupalES/DrupalCampSpain.git # timeout=10
Cleaning workspace
> git rev-parse --verify HEAD # timeout=10
Resetting working tree
> git reset --hard # timeout=10
> git clean -fdx # timeout=10
@juampynr
juampynr / db-download.sh
Last active Sep 24, 2018
Downloads a Drupal database dump from a Docker container
View db-download.sh
#!/usr/bin/env bash
# Downloads a database dump from a docker container
#
# Usage:
# sh db-download.sh [hostname] [user] [container]
set -x
HOST=$1
You can’t perform that action at this time.