Skip to content

Instantly share code, notes, and snippets.

View deploy.rb
set :application, 'my_app_name'
set :repo_url, 'git@example.com:me/my_repo.git'
set :branch, :master
set :deploy_to, -> { "/srv/www/#{fetch(:application)}" }
set :log_level, :info
set :linked_files, fetch(:linked_files, []).push('.env')
set :linked_dirs, fetch(:linked_dirs, []).push('web/app/uploads')
namespace :deploy do
desc 'Restart application'
View md.php
<?php
namespace Roots\Bedrock;
use League\CommonMark\CommonMarkConverter;
class MarkdownPosts {
const POST_OPTION = 'roots/bedrock/markdown_posts';
const IS_MD_META = 'roots/bedrock/is_markdown';
View Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
require 'yaml'
ANSIBLE_PATH = '.' # path targeting Ansible directory (relative to Vagrantfile)
# Set Ansible roles_path relative to Ansible directory
ENV['ANSIBLE_ROLES_PATH'] = File.join(ANSIBLE_PATH, 'vendor', 'roles')
View iThemes
It’s unbelievable that people are using words like “honesty” and “transparency” right now.
iThemes is a company that KNOWINGLY stored plain text passwords for 6 years.
Did they ever mention this until now? No. That’s not honest or transparent.
They were hiding it from their customers for 6 years hoping that no one would ever find out.
Two things are obvious about this:
1) They don’t know what they’re doing when it comes to security.
2) They don’t care about their customers enough to protect them and do things properly.
View copy.rb
set :theme_path, Pathname.new('web/app/themes/mytheme')
set :local_app_path, Pathname.new('/Applications/MAMP/htdocs/mysite')
set :local_theme_path, fetch(:local_app_path).join(fetch(:theme_path))
namespace :deploy do
task :compile_assets do
run_locally do
within fetch(:local_theme_path) do
execute :grunt, :build
end
@swalkinshaw
swalkinshaw / site.yml
Last active Jun 15, 2018
Multiple sites on one box with bedrock-ansible
View site.yml
# this is group_vars/development
---
www_root: /srv/www
# Define your WordPress sites here
wordpress_sites:
- site_name: site1.dev
site_hosts:
- site1.dev
View Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.require_version '>= 1.5.1'
Vagrant.configure('2') do |config|
config.vm.define 'dev' do |dev|
dev.vm.box = 'roots/bedrock'
dev.vm.network :private_network, ip: '192.168.50.5'
dev.vm.hostname = 'example.dev'
View wp.conf
server {
listen 80;
server_name example.dev;
access_log /var/logs/nginx/example.dev.access.log;
error_log /var/logs/nginx/example.dev.error.log;
root /srv/www/example.dev/current/web;
index index.php;
location / {
View Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.require_version '>= 1.5.1'
Vagrant.configure('2') do |config|
config.vm.box = 'precise64'
config.vm.box_url = 'http://files.vagrantup.com/precise64.box'
config.vm.network :private_network, ip: '192.168.50.5'
View composer.json
{
"repositories": [
{
"type": "composer",
"url": "http://wpackagist.org"
},
{
"type": "package",
"package": {
"name": "wordpress",