Skip to content

Instantly share code, notes, and snippets.

View andrew-epstein's full-sized avatar

Andrew Epstein andrew-epstein

  • Elsevier
  • Philadelphia
View GitHub Profile

Process

  • Nothing gets merged to develop without having an associated JIRA issue.
    • Before a dev begins work on anything, there must exist an issue in JIRA specifying the work to be done.
  • Pull requests are reviewed by at least 1 person other than the author before being merged.
  • There exists a rigorously-defined Definition of Ready.
  • Devs do not begin work on stories until they meet the Definition of Ready.
    • Stories are not added to sprints unless they have a definition.
  • There exists a rigorously-defined Definition of Done.
  • Stories are not closed until they meet the Definition of Done.
  • The development team has a ScrumMaster.
@andrew-epstein
andrew-epstein / get_data.sh
Last active August 11, 2017 18:02
Dump a remote database and restore locally
#!/usr/bin/env bash
function pause() {
N=5
echo "Sleeping for $N seconds"
sleep $N
}
OC_ENV='dev'
git clone git@github.com:elsevierPTG/eols-assessment-service.git
git clone git@github.com:elsevierPTG/EOD-DBMigrations.git
brew install postgres
brew install gradle
pg_ctl -D /usr/local/var/postgres start
psql -d postgres
create database eod;
create user eoduser password 'testing123' SUPERUSER INHERIT CREATEDB CREATEROLE REPLICATION;
create user eols password 'Baseball1' SUPERUSER INHERIT CREATEDB CREATEROLE REPLICATION;
\q
@andrew-epstein
andrew-epstein / oc-functions.sh
Last active November 21, 2018 14:46
OpenShift Bash Functions
#!/usr/bin/env bash
TOO_FEW_ARGS_ERR="Too few arguments!"
TOO_MANY_ARGS_ERR="Too many arguments! (Did you forget to quote?)"
function usage() {
echo -e "Usage:\\n\\t$1"
}
function oc-pod-name() {
@andrew-epstein
andrew-epstein / pull.sh
Created January 19, 2017 14:58
execute git pull --all in all repos
#!/usr/bin/env bash
Red='\033[0;31m'
Yellow='\033[0;33m'
Green='\033[0;32m'
NC='\033[0m' # No Color
REPO_PATH='/Users/epsteina/EOLS-repos'
pushd $REPO_PATH > /dev/null
@andrew-epstein
andrew-epstein / get-hooks.sh
Last active April 17, 2017 18:52
install git hooks
#!/usr/bin/env bash
URL='https://gist.githubusercontent.com/andrew-epstein/3f16948597c8482a30d3e554c0a02212/raw/prepare-commit-msg.sh'
REPO_PATH='' # Fill this in
FILE_PATH='/tmp/prepare-commit-msg'
if [[ -z $REPO_PATH ]]; then
echo "Define the REPO_PATH variable!"
exit 1
fi
@andrew-epstein
andrew-epstein / prepare-commit-msg.sh
Last active January 17, 2017 20:24
Add JIRA issue key to commit message
#!/usr/bin/env bash
#
# Automatically starts every commit message with the JIRA issue key. This info is derived from the branch name.
#
# This hook takes one to three parameters. The first is the name of the file that contains the commit log message.
# The second is the source of the commit message, and can be:
# message (if a -m or -F option was given)
# template (if a -t option was given or the configuration option commit.template is set)
# merge (if the commit is a merge or a .git/MERGE_MSG file exists)
# squash (if a .git/SQUASH_MSG file exists)
@andrew-epstein
andrew-epstein / clone.sh
Last active February 27, 2017 13:59
Clone all repos
#!/usr/bin/env bash
# Follow these instructions for creating an oauth token: https://help.github.com/articles/creating-an-access-token-for-command-line-use/
TOKEN='your_token'
# Only 100 results per page, and we have 100 ≤ x ≤ 200 repos
curl -u $TOKEN:x-oauth-basic -s https://api.github.com/orgs/elsevierPTG/repos\?per_page\=100\&page\=1 | ruby -rubygems -e 'require "json"; JSON.load(STDIN.read).each { |repo| %x[git clone #{repo["ssh_url"]} ]}'
curl -u $TOKEN:x-oauth-basic -s https://api.github.com/orgs/elsevierPTG/repos\?per_page\=100\&page\=2 | ruby -rubygems -e 'require "json"; JSON.load(STDIN.read).each { |repo| %x[git clone #{repo["ssh_url"]} ]}'