This file contains hidden or 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
sudo: required | |
services: | |
- docker | |
language: python | |
script: | |
- python -m pytest -v |
This file contains hidden or 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
#!/bin/sh | |
wget -qO- https://toolbelt.heroku.com/install-ubuntu.sh | sh | |
heroku container:login | |
heroku container:push web --app $HEROKU_APP_NAME | |
heroku container:release web --app $HEROKU_APP_NAME |
This file contains hidden or 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
#!/bin/sh | |
docker login -u $DOCKER_USER -p $DOCKER_PASS | |
if [ "$TRAVIS_BRANCH" = "master" ]; then | |
TAG="latest" | |
else | |
TAG="$TRAVIS_BRANCH" | |
fi | |
docker build -f Dockerfile -t $TRAVIS_REPO_SLUG:$TAG . | |
docker push $TRAVIS_REPO_SLUG:$TAG |
This file contains hidden or 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
FROM alpine:3.5 | |
RUN apk add --update python py-pip | |
COPY requirements.txt /src/requirements.txt | |
RUN pip install -r /src/requirements.txt | |
COPY app.py /src | |
COPY buzz /src/buzz | |
CMD python /src/app.py |
This file contains hidden or 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
import os | |
from flask import Flask | |
from buzz import generator | |
app = Flask(__name__) | |
@app.route("/") | |
def generate_buzz(): | |
page = '<html><body><h1>' | |
page += generator.generate_buzz() |
This file contains hidden or 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
import unittest | |
from buzz import generator | |
def test_sample_single_word(): | |
l = ('foo', 'bar', 'foobar') | |
word = generator.sample(l) | |
assert word in l | |
def test_sample_multiple_words(): |
This file contains hidden or 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
from __future__ import print_function | |
import random | |
buzz = ('continuous testing', 'continuous integration', | |
'continuous deployment', 'continuous improvement', 'devops') | |
adjectives = ('complete', 'modern', 'self-service', 'integrated', 'end-to-end') | |
adverbs = ('remarkably', 'enormously', 'substantially', 'significantly', | |
'seriously') | |
verbs = ('accelerates', 'improves', 'enhances', 'revamps', 'boosts') |
NewerOlder