[CI] Add
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
kleph 2020-02-14 01:06:37 +01:00
parent 78dcca5e1a
commit acae6f1af4
4 changed files with 38 additions and 7 deletions

21
.drone.yml Normal file
View file

@ -0,0 +1,21 @@
kind: pipeline
name: lint
steps:
- name: pylint
image: python:slim
commands:
- "echo \"==> Pylint ...\""
- pip install -r requirements.txt
- pip install pylint
- pylint *.py
- name: dockerlint
image: hadolint/hadolint
commands:
- hadolint --ignore DL3013 Dockerfile # ignore pinning version in pip
- name: w3c validator
image: validator/validator:latest
commands:
- vnu static/*.html

1
.gitignore vendored
View file

@ -27,6 +27,7 @@ share/python-wheels/
.installed.cfg
*.egg
MANIFEST
.idea/
# PyInstaller
# Usually these files are written by a python script from a template

View file

@ -2,6 +2,7 @@ FROM python:slim
RUN pip install flask
COPY beer.py /beer.py
COPY static /static
EXPOSE 5000
CMD python /beer.py
CMD ["python", "/beer.py"]

20
beer.py
View file

@ -1,17 +1,25 @@
#!/usr/bin/env python3.6
# -*- coding:utf-8 -*-
""" stupid countdown beer app to amuse my colleagues and collect buzzwords """
from flask import Flask
# pylint: disable=invalid-name
app = Flask(__name__)
@app.route('/')
def index():
with open('static/beer.html') as f:
data = f.read()
""" main and only app """
with open('static/beer.html') as html_file:
data = html_file.read()
return data
@app.route('/hello/<phrase>')
def hello(phrase):
return phrase
app.run(host='::')
def main():
""" main func """
app.run(host='::')
if __name__ == '__main__':
main()