Skip to content

Commit 216a1af

Browse files
committed
project structure, settings, and scaffolding
1 parent 962d31e commit 216a1af

File tree

11 files changed

+177
-0
lines changed

11 files changed

+177
-0
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,3 +99,7 @@ ENV/
9999

100100
# mypy
101101
.mypy_cache/
102+
103+
104+
settings.yaml
105+
*.private-key.pem

Makefile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
2+
SHELL:=/bin/bash
3+
ROOT_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
4+
5+
.PHONY: all fresh fulluninstall install dependencies clean
6+
7+
all: dependencies
8+
9+
fresh: clean dependencies
10+
11+
fulluninstall: uninstall clean
12+
13+
install:
14+
15+
dependencies:
16+
if [ ! -d $(ROOT_DIR)/venv ]; then python3 -m venv $(ROOT_DIR)/venv; fi
17+
source $(ROOT_DIR)/venv/bin/activate; yes w | pip install -e .
18+
19+
clean:
20+
rm -rf $(ROOT_DIR)/env;
21+
rm -rf $(ROOT_DIR)/gitconsensusservice/*.pyc;

README.md

Whitespace-only changes.

bin/devserv

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/usr/bin/env bash
2+
3+
# Get real directory in case of symlink
4+
if [[ -L "${BASH_SOURCE[0]}" ]]
5+
then
6+
DIR="$( cd "$( dirname $( readlink "${BASH_SOURCE[0]}" ) )" && pwd )"
7+
else
8+
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
9+
fi
10+
11+
source "$DIR/envvar"
12+
13+
flask run

bin/envvar

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/usr/bin/env bash
2+
3+
# Get real directory in case of symlink
4+
if [[ -L "${BASH_SOURCE[0]}" ]]
5+
then
6+
DIR="$( cd "$( dirname $( readlink "${BASH_SOURCE[0]}" ) )" && pwd )"
7+
else
8+
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
9+
fi
10+
source $DIR/../venv/bin/activate
11+
12+
export SETTINGS=$DIR/../settings.yaml
13+
export FLASK_APP=$DIR/../gitconsensusservice/www.py

bin/gcs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/usr/bin/env bash
2+
3+
# Get real directory in case of symlink
4+
if [[ -L "${BASH_SOURCE[0]}" ]]
5+
then
6+
DIR="$( cd "$( dirname $( readlink "${BASH_SOURCE[0]}" ) )" && pwd )"
7+
else
8+
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
9+
fi
10+
11+
source "$DIR/envvar"
12+
python -m gitconsensusservice.cli "$@"

gitconsensusservice/__init__.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
from flask import Flask
2+
import os
3+
import yaml
4+
5+
6+
app = Flask(__name__)
7+
8+
if 'SETTINGS' in os.environ:
9+
if os.path.isfile(os.environ['SETTINGS']):
10+
with open(os.environ['SETTINGS'], 'r') as infile:
11+
app.config.update(yaml.load(infile.read()))

gitconsensusservice/www.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
from flask import Flask, session, redirect, url_for, escape, request, render_template, flash, send_from_directory
2+
from gitconsensusservice import app
3+
4+
5+
@app.route('/')
6+
def index():
7+
return redirect('https://www.gitconsensus.com/')

requirements.txt

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
asn1crypto==0.24.0
2+
certifi==2018.1.18
3+
cffi==1.11.4
4+
chardet==3.0.4
5+
click==5.1
6+
cryptography==2.1.4
7+
Flask==0.12.2
8+
gitconsensus==0.4.0
9+
-e [email protected]:tedivm/GitConsensusService.git@962d31e6154fa58964dd264038abb747e0aa1bd9#egg=gitconsensusservice
10+
github3.py==0.9.6
11+
idna==2.6
12+
itsdangerous==0.24
13+
Jinja2==2.10
14+
MarkupSafe==1.0
15+
pycparser==2.18
16+
PyJWT==1.5.3
17+
PyYAML==3.12
18+
requests==2.18.4
19+
six==1.11.0
20+
uritemplate==3.0.0
21+
uritemplate.py==3.0.2
22+
urllib3==1.22
23+
Werkzeug==0.14.1

settings.dist.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
DEBUG: false
2+
GITHUB_PRIVATE_KEY: '/absolute/path/to/private-key.pem'
3+
GITHUB_APP_ID: 0

0 commit comments

Comments
 (0)