Skip to content

Instantly share code, notes, and snippets.

mkdir /path/to/local-repos
git clone ssh://your.remote.server/path/to/git-repos/NewRepoName
git remote rename origin deploy
// Initialise empty strings
var gitOutput = "",
branch = null;
// Start reading stdin
process.stdin.resume();
// Store read in chunks
process.stdin.on('data', function (chunk) {
gitOutput += chunk;
// Initialise vars
var gitOutput = "",
branch = null;
// Start reading stdin
process.stdin.resume();
// Store read in chunks
process.stdin.on('data', function (chunk) {
gitOutput += chunk;
// Initialise vars
var gitOutput = "",
branch = null;
// Start reading stdin
process.stdin.resume();
// Store read in chunks
process.stdin.on('data', function (chunk) {
gitOutput += chunk;
|-- /var/w/
|-- .versions/
|-- [email protected]
|-- [email protected]
|-- [email protected]
|-- [email protected]
|-- [email protected]
|-- SiteName (symlink)
|-- AnotherSite (symlink)
|-- /var/w/
|-- .versions/
| |-- [email protected]
| |-- [email protected]
| |-- [email protected]
| |-- [email protected]
| |-- [email protected]
|-- SiteName (symlink)
|-- AnotherSite (symlink)
|-- /var/w/
|-- .versions/
| |-- [email protected]
| |-- [email protected]
| |-- [email protected]
| |-- [email protected]
| |-- [email protected]
|-- SiteName --> [email protected] (symlink)
|-- AnotherSite --> [email protected] (symlink)
|-- /var/w/
|-- .versions/
| |-- [email protected]
| |-- [email protected]
| |-- [email protected]
| |-- [email protected]
| |-- [email protected]
|-- SiteName --> [email protected] (symlink)
|-- AnotherSite --> [email protected] (symlink)
#!upstart
description "Sitename-state"
author "Ben Gourley"
start on (local-filesystems and net-device-up IFACE=eth0)
stop on shutdown
respawn # restart when job dies
respawn limit 5 60 # give up restart after 5 respawns in 60 seconds
set daemon 300 with start delay 60
check host BenGourley-dev with address 127.0.0.1
start "/sbin/start site.BenGourley-dev"
stop "/sbin/stop site.BenGourley-dev"
if failed port 3000 protocol HTTP
request /
with timeout 5 seconds
then restart