Skip to content

Instantly share code, notes, and snippets.

View jonpugh's full-sized avatar

Jon Pugh jonpugh

View GitHub Profile
@jonpugh
jonpugh / git-pull-recursive.rb
Last active October 20, 2021 03:20
Lots of repos? Try "git-pull-recursive" to run "git pull" on all subfolders with a .git folder inside. Thanks to http://snipplr.com/view/62314/perform-git-pull-on-subdirectory-recursive/
# For use in Chef:
# Adds a command: git-pull-recursive
file "/usr/local/bin/git-pull-recursive" do
owner "root"
group "root"
mode "0755"
action :create
content 'find . -type d -name .git -exec sh -c "cd \"{}\"/../ && pwd && git pull" \;'
end
@jonpugh
jonpugh / Sample client side links loader.
Last active December 24, 2015 02:29
Sample client side links loader.
@jonpugh
jonpugh / drupalsite.sh
Last active December 30, 2015 19:19
Getting a drupal site up locally in least time possible with the least dependencies. I want to make this a new command. Just some brainstorming.
# Install Drush
# Install Git
# Install MySQL
# Get drupal codebase
git clone git@github.com:your/repo.git
cd repo
# Create drush alias
$aliases['sitename'] = array(
@jonpugh
jonpugh / bootstrap.sh
Last active August 29, 2015 13:57
Bootstrap
sudo apt-get install boot-repair git vim drush chromium-browser gnome-do mysql-server curl
@jonpugh
jonpugh / update-devshop-head.sh
Created September 12, 2014 13:52
Script to update devshop head once replaced with git repos.
cd /var/aegir/devshop-6.x-1.x/profiles/devshop/
git pull
cd /var/aegir/devshop-6.x-1.x/profiles/devshop/modules/devshop/devshop_hosting
git pull
cd /var/aegir/.drush/devshop_provision
git pull
drush @hostmaster cc all
drush @hostmaster updb -y
@jonpugh
jonpugh / gist:9a605976f53c1fe741e3
Created January 13, 2015 21:20
bin/behat -dl with drupalextension
default | Then I should get a :code response trying to access :url
default | Given I am an anonymous user
default | Given I am not logged in
default | Given I am logged in as a user with the :role role(s)
default | Given I am logged in as :name
default | Given I am logged in as a user with the :permissions permission(s)
default | Then I should see (the text ):text in the ":rowText" row
default | Given I click :link in the :rowText row
default | Then I (should )see the :link in the :rowText row
default | Given the cache has been cleared
@jonpugh
jonpugh / docker-compose.yml
Created May 19, 2015 04:14
Exported docker-compose.yml from Rancher for a working wordpress cluster.
app:
environment:
WORDPRESS_DB_PASSWORD: password
external_links:
1979c1fa-26cd-45a0-91cc-c73812fc94b5: mysql
tty: true
image: wordpress
links:
- database
stdin_open: true
@jonpugh
jonpugh / bootstrap.php
Created July 15, 2015 21:45
Custom Behat steps for OG: @given I start a :type community called :title with description :description
<?php
use Drupal\DrupalExtension\Context\RawDrupalContext;
use Behat\Behat\Hook\Scope\BeforeScenarioScope;
use Behat\Behat\Context\SnippetAcceptingContext;
use Behat\Behat\Tester\Exception\PendingException;
use Behat\Behat\Hook\Scope\AfterStepScope;
use Behat\Behat\Hook\Scope\BeforeStepScope;
use Behat\Gherkin\Node\PyStringNode;
use Behat\Gherkin\Node\TableNode;
use Behat\Mink\Exception;
@jonpugh
jonpugh / FeatureContext.php
Last active November 21, 2018 14:21
This custom Behat FeatureContext includes a step called "Then every link should work". It checks every visitable link on a page for a 200 code.
<?php
use Drupal\DrupalExtension\Context\RawDrupalContext;
use Drupal\DrupalExtension\Context\DrupalContext;
use Behat\Behat\Context\Context;
use Behat\Behat\Context\SnippetAcceptingContext;
use Behat\Gherkin\Node\PyStringNode;
use Behat\Gherkin\Node\TableNode;
@jonpugh
jonpugh / gist:33e6220ef1817b7748c1
Created September 14, 2015 21:03
All the drupal extension behat steps: bin/behat -dl
default | Then every link should work
default | Given I am an anonymous user
default | Given I am not logged in
default | Given I am logged in as a user with the :role role(s)
default | Given I am logged in as a user with the :role role(s) and I have the following fields:
default | Given I am logged in as :name
default | Given I am logged in as a user with the :permissions permission(s)
default | Then I should see (the text ):text in the ":rowText" row
default | Given I click :link in the :rowText row
default | Then I (should )see the :link in the :rowText row