This file contains 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
""" | |
A file lock implementation that tries to avoid platform specific | |
issues. It is inspired by a whole bunch of different implementations | |
listed below. | |
- https://bitbucket.org/jaraco/yg.lockfile/src/6c448dcbf6e5/yg/lockfile/__init__.py | |
- http://svn.zope.org/zc.lockfile/trunk/src/zc/lockfile/__init__.py?rev=121133&view=markup | |
- http://stackoverflow.com/questions/489861/locking-a-file-in-python | |
- http://www.evanfosmark.com/2009/01/cross-platform-file-locking-support-in-python/ | |
- http://packages.python.org/lockfile/lockfile.html |
This file contains 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/local/bin/nginx: | |
apt install nginx |
This file contains 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
VENV=.venv | |
$(VENV): | |
virtualenv $(VENV) | |
$(VENV)/bin/py.test: $(VENV) | |
$(VENV)/bin/pip install dev_requirements.txt | |
test: $(VENV)/bin/py.test | |
$(VENV)/bin/py.test . |
This file contains 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
SOURCES=$(shell find . -name '*.go') | |
myapp: $SOURCES | |
go build -o myapp ./cmd/myapp |
This file contains 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
func CreateExecutor(cmdType string, cmdCfg CommandConfig) *CommandExecutor { | |
ce := &CommandExecutor{} | |
switch cmdType { | |
case "docker": | |
ce.Command = CreateDockerCommand(cmdCfg) | |
case "ssh": | |
ce.Command = CreateSSHCommand(cmdCfg) | |
} | |
This file contains 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
type CreateCommand func() []string | |
type CommandExecutor struct { | |
CmdString string | |
Command CreateCommand | |
} | |
func (ce *CommandExecutor) defaultCommand() []string { | |
return []string{"/bin/bash", "-c", ce.CmdString} | |
} |
This file contains 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
--- | |
- exec: | |
cmd: ls -la | |
- docker: | |
image: ubuntu | |
cmd: ls -la | |
- ssh: | |
connect: foo.example.com |
This file contains 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
package main | |
import ( | |
"encoding/json" | |
"flag" | |
"fmt" | |
"io/ioutil" | |
"os" | |
"github.com/ionrock/procs" |
This file contains 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
Failure/Error: expect(model).to eq('environment') | |
expected: "environment" | |
got: "environemnt" | |
(compared using ==) |
This file contains 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
craps.core=> (def my-list '(1 2 3 4)) | |
#'craps.core/my-list | |
craps.core=> (map println my-list) | |
(1 | |
2 | |
nil 3 | |
nil 4 | |
nil nil) | |
craps.core=> (map print my-list) | |
(12nil 3nil 4nil nil) |
NewerOlder