-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 036fe44
Showing
17 changed files
with
309 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.vagrant | ||
.pyc |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
FROM ubuntu:12.04 | ||
MAINTAINER Chris Reeves | ||
|
||
ADD . /foo | ||
|
||
WORKDIR /foo | ||
RUN cd /foo | ||
|
||
RUN apt-get install -y python python-dev python-software-properties | ||
RUN apt-get install -y make | ||
RUN apt-get install -y wget | ||
RUN apt-get install -y tar | ||
RUN wget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py --no-check-certificate -O - | python | ||
RUN wget https://raw.github.com/pypa/pip/master/contrib/get-pip.py --no-check-certificate -O - | python | ||
RUN make develop | ||
|
||
EXPOSE 8080 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# | ||
# Generic functions | ||
# | ||
|
||
clean_pyc: | ||
find . -name \*.pyc -delete | ||
|
||
documentation: | ||
make -C docs clean | ||
make -C docs html | ||
|
||
# | ||
# Install for development | ||
# | ||
|
||
# Install Development Requirements | ||
install_develop: | ||
./install.sh develop | ||
|
||
develop: install_develop | ||
|
||
# | ||
# Install for test running | ||
# | ||
|
||
# Install Test Requirements | ||
install_test: | ||
./install.sh test | ||
|
||
# Test Command | ||
run_tests: | ||
python setup.py test | ||
|
||
test: install_test run_tests | ||
|
||
# | ||
# Application Related Commands | ||
# | ||
|
||
runserver: | ||
python src/foo/run.py |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/usr/bin/ruby | ||
|
||
# | ||
# Vagrant File for Docker - Requires Vagrant 1.1+ | ||
# Provisioner: Salt | ||
# OS: Ubuntu 12.04 LTS 64Bit | ||
# | ||
|
||
Vagrant.configure("2") do |config| | ||
|
||
# Base Box - http://www.vagrantbox.es/ - Ubuntu 12.04 LTS 64bit | ||
config.vm.box = "precise64" | ||
config.vm.box_url = "http://files.vagrantup.com/precise64.box" | ||
config.ssh.forward_agent = true | ||
|
||
# Port Forwarding | ||
config.vm.network :forwarded_port, guest: 4243, host: 4243 | ||
(49000..49900).each do |port| | ||
config.vm.network :forwarded_port, :host => port, :guest => port | ||
end | ||
|
||
# Virutalbox Settings | ||
config.vm.provider :virtualbox do |v| | ||
# Enables symlinks | ||
v.customize ["setextradata", :id, "VBoxInternal2/SharedFoldersEnableSymlinksCreate/v-root", "1"] | ||
end | ||
|
||
# | ||
# Mounts | ||
# | ||
|
||
config.vm.synced_folder ".", "/foo" | ||
config.vm.synced_folder "./provisioner", "/srv/salt" | ||
|
||
# | ||
# Provisioner - Salt | ||
# | ||
|
||
config.vm.provision :salt do |salt| | ||
salt.run_highstate = true | ||
salt.minion_config = "provisioner/config/minion.conf" | ||
salt.install_type = "stable" | ||
end | ||
|
||
end |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash | ||
|
||
if [ $1 ] | ||
then | ||
pip install -e .[$1] | ||
else | ||
pip install -e . | ||
fi |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# | ||
# Salt Minion Config | ||
# | ||
|
||
# Masterless Mode | ||
file_client: local | ||
|
||
# File Roots | ||
file_roots: | ||
base: | ||
- /srv/salt/states/ | ||
|
||
# Renderer | ||
renderer: stateconf yaml . jinja |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# | ||
# docker.config | ||
# | ||
# Docker configuration | ||
# | ||
|
||
.docker_service_config: | ||
file: | ||
- managed | ||
- name: /etc/init/docker.conf | ||
- source: salt://docker/files/docker.service.conf | ||
- user: root | ||
- group: root | ||
- mode: 644 | ||
- require: | ||
- stateconf: docker.install::goal |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# | ||
# docker.dependencies | ||
# | ||
# Dependencies for installing Docker | ||
# | ||
|
||
.python-software-properties: | ||
pkg: | ||
- installed |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
description "Run docker" | ||
|
||
start on filesystem or runlevel [2345] | ||
stop on runlevel [!2345] | ||
|
||
respawn | ||
|
||
script | ||
/usr/bin/docker -d -H tcp://0.0.0.0:4243 | ||
end script |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# | ||
# Docker Salt Module | ||
# | ||
|
||
include: | ||
- ..dependencies | ||
- ..install | ||
- ..config | ||
- ..service |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# | ||
# docker.install | ||
# | ||
# Installs Docker | ||
# | ||
|
||
.docker_repo: | ||
pkgrepo: | ||
- managed | ||
- name: 'deb http://get.docker.io/ubuntu docker main' | ||
- key_url: 'https://get.docker.io/gpg' | ||
- require: | ||
- pkg: .dependencies::python-software-properties | ||
|
||
.linux-image-generic-lts-raring: | ||
pkg: | ||
- installed | ||
- require: | ||
- pkgrepo: .docker_repo | ||
|
||
.linux-headers-generic-lts-raring: | ||
pkg: | ||
- installed | ||
- require: | ||
- pkgrepo: .docker_repo | ||
|
||
.lxc-docker: | ||
pkg: | ||
- installed | ||
- require: | ||
- pkg: .linux-image-generic-lts-raring | ||
- pkg: .linux-headers-generic-lts-raring |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# | ||
# docker.service | ||
# | ||
# Docker Service Management | ||
# | ||
|
||
.docker_service: | ||
service: | ||
- running | ||
- name: docker | ||
- enable: True | ||
- reload: True | ||
- watch: | ||
- pkg: .install::lxc-docker | ||
- file: .config::docker_service_config | ||
- require: | ||
- stateconf: docker.config::goal |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# | ||
# Top SLS File | ||
# | ||
|
||
base: | ||
|
||
'*': | ||
- docker |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
#!/usr/bin/env python | ||
|
||
import os | ||
import sys | ||
import multiprocessing # NOQA | ||
|
||
from setuptools import setup, find_packages | ||
|
||
sys.path.append( | ||
os.path.abspath(os.path.join(os.path.dirname(__file__), 'src'))) | ||
|
||
|
||
def read(fname): | ||
return open(fname).read() | ||
|
||
|
||
install_requires = [ | ||
'flask==0.10.1', | ||
] | ||
|
||
test_requires = [ | ||
'mock==1.0.1', | ||
'tox==1.4.3', | ||
'nose==1.3', | ||
'coverage==3.6', | ||
'coveralls==0.2', | ||
] | ||
|
||
dev_requires = test_requires + [ | ||
'pytest==2.3.5', | ||
'pdbpp==0.7', | ||
'ipython==0.13.2', | ||
'flake8==2.0', | ||
] | ||
|
||
setup( | ||
name='foo', | ||
version='0.0.1', | ||
author='Christopher John Reeves', | ||
author_email='[email protected]', | ||
url='https://github.com/krak3n/foo.git', | ||
description='Fooythings', | ||
long_description='foo', | ||
package_dir={'': 'src'}, | ||
packages=find_packages('src'), | ||
include_package_data=True, | ||
zip_safe=False, | ||
install_requires=install_requires, | ||
test_suite='runtests.runtests', | ||
extras_require={ | ||
'test': test_requires, | ||
'develop': dev_requires, | ||
}, | ||
classifiers=[ | ||
'Environment :: Console', | ||
'Development Status :: 5 - Production/Stable', | ||
'Programming Language :: Python', | ||
'Programming Language :: Python :: 2.7', | ||
'Operating System :: Unix', | ||
'License :: OSI Approved :: BSD License', | ||
'Topic :: Software Development', | ||
'Topic :: Software Development :: Libraries :: Python Modules', | ||
], | ||
license='BSD' | ||
) |
Empty file.
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from flask import Flask | ||
app = Flask(__name__) | ||
|
||
|
||
@app.route('/') | ||
def hello_world(): | ||
return 'Foo All The Things!' | ||
|
||
|
||
if __name__ == '__main__': | ||
kwargs = {} | ||
kwargs.update({ | ||
'host': '0.0.0.0', | ||
'port': 8080 | ||
}) | ||
app.run(**kwargs) |