This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# Original Author, Dan Kubb (https://github.com/dkubb) | |
# Modified by Kevin English (https://github.com/monkseal) | |
# encoding: utf-8 | |
require 'pathname' | |
# files and extensions to process | |
FILES = %w[ capfile Capfile Gemfile Gemfile.lock Guardfile CHANGELOG LICENSE Manifest README README.rdoc README_FOR_APP RUBY-STYLE RUNNING_UNIT_TESTS Rakefile RUBY-STYLE SPECS TODO USAGE .autotest .gitignore .htaccess .rspec .rcov .rvmrc Vagrantfile .yardopts ].freeze |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace :ci do | |
require 'rubocop/rake_task' | |
def changed_files | |
cmd = %q( git diff --name-only --diff-filter=ACMRTUXB \ | |
$(git merge-base HEAD master) \ | |
| egrep '\.rake$|\.rb$' ) | |
diff = `#{cmd}` | |
diff.split("\n") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
inherit_from: .rubocop_todo.yml | |
AllCops: | |
Exclude: | |
- db/schema.rb | |
- db/migrate/* | |
- bin/* | |
RunRailsCops: true | |
Documentation: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
echo "Running pre-commit hook, to run with out do 'git commit -n'" | |
bin/rake ci:rubocop_changed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# This example tests that the commit message contains DS, exit 1 will fail the commit. | |
test "" != "$(grep '\[DS-[0-9]\+\]' "$1")" || { | |
echo >&2 "ERROR: Commit message is missing Jira issue number." | |
exit 1 | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Add git branch if relevant | |
parse_git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/' | |
} | |
# Extact tracker abbreviation and ticket number (e.g. DS-123) | |
parse_git_tracker_and_ticket() { | |
parse_git_branch | grep -e '[A-Z]\+-[0-9]\+' -o |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace :deploy do | |
# .... | |
# @example | |
# bundle exec cap uat deploy:invoke task=users:update_defaults | |
desc 'Invoke rake task on the server' | |
task :invoke do | |
fail 'no task provided' unless ENV['task'] | |
on roles(:app) do | |
within release_path do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Install dependent packages | |
sudo yum update | |
sudo yum install -y apr-devel apr-util-devel autoconf automake curl-devel \ | |
g++ gcc gcc-c++ git glibc-headers httpd-devel libxml2 \ | |
libxml2-devl libxslt libxslt-devel libyaml-devel make \ | |
mysql-devel mysql-server openssl-devel patch readline \ | |
readline-devel zlib zlib-devel |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Host => Guest (VM) | |
FORWARD_PORTS = { | |
3000 => 3000, # webrick | |
13_306 => 3306 # MySQL | |
} | |
# All Vagrant configuration is done below. The "2" in Vagrant.configure | |
# configures the configuration version (we support older styles for | |
# backwards compatibility). Please don't change it unless you know what | |
# you're doing. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
default: &default | |
adapter: mysql2 | |
encoding: utf8 | |
reconnect: false | |
pool: 5 | |
port: 13306 | |
username: blog_user | |
password: blog_user91x91x | |
host: localhost |
OlderNewer