Skip to content

Instantly share code, notes, and snippets.

View venkatasykam's full-sized avatar

SVN Reddy venkatasykam

  • Hyderabad, India
View GitHub Profile
@venkatasykam
venkatasykam / swarm-with-docker-machine.sh
Created August 28, 2018 09:44 — forked from nishanttotla/swarm-with-docker-machine.sh
A bash script to set up a simple Docker Swarm cluster using Docker Machine
################################## INSTRUCTIONS ##################################
# 1. Make sure docker-machine is installed on your machine #
# 2. Download the file #
# 3. Run using $ . swarm-with-docker-machine.sh so that DOCKER_HOST is exported #
##################################################################################
# Remove any existing machines
docker-machine rm -y manager agent1 agent2
# Create machines
@venkatasykam
venkatasykam / pre-receive.bash
Created July 16, 2018 11:13 — forked from Pierstoval/pre-receive.bash
Git pre-receive example
#!/bin/bash
########################################################################
################################ README ################################
########################################################################
#
# This script is here to allow the use of "git push prod v1.2.3" commands or similar.
#
# Push a tag to a bare repository having this file as pre-receive hook,
# and you'll be able to deploy directly from command line in your local environment,
@venkatasykam
venkatasykam / commit-msg
Created July 13, 2018 10:31 — forked from opyate/commit-msg
JIRA code commit msg hook; presumes merges happen on remote (via PR mechanism, etc)
#!/bin/sh
# .git/hooks/commit-msg
test "" != "$(egrep '[A-Z]{3,}-\d+' "$1")" || {
echo >&2 Commit message requires JIRA code.
exit 1
}
#!/bin/sh
get_clean_message() {
egrep -o '^[^#].*' "$1"
}
# Do not allow empty messages after removing comments
[ -z "$(get_clean_message "$1")" ] && {
echo >&2 Commit message can NOT be empty.
exit 1