Skip to content

Commit 9de76ae

Browse files
committed
feat: init refactor
1 parent 81bd075 commit 9de76ae

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+12004
-5442
lines changed

.drone.yml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
kind: template
2+
load: deploythatapp.jsonnet
3+
data:
4+
projectName: ${DRONE_REPO}
5+
gitSshKey: default
6+
ciImageRegistry: "registry.lokalhost.net"
7+
domains: >-
8+
["lokalhost.net", "fresh2.dev"]
9+
domainTriggers: >-
10+
{
11+
"lokalhost.net": {
12+
"branch": ["main", "master"],
13+
"event": ["push", "custom"]
14+
},
15+
"fresh2.dev": {
16+
"event": ["tag"]
17+
}
18+
}
19+
imageTags: ""
20+
useDinD: false
21+
publishDockerHub: false
22+
deployStack: true
23+
deployCommands: >-
24+
{}
25+
secrets: >-
26+
[]
27+
secretFiles: >-
28+
{}
29+
volumes: >-
30+
[]
31+
domainVars: >-
32+
{
33+
"lokalhost.net": {
34+
"PYPI_CREDS": {"from_secret": "lokalhost.net_pypi-creds"}
35+
}
36+
}
37+
beforeSteps: >-
38+
[
39+
{
40+
"name": "run-tests",
41+
"image": "registry.lokalhost.net/python:3.9-buster",
42+
"commands": ["make test", "make build-docs"],
43+
"when": {
44+
"event": ["push", "custom", "tag"]
45+
}
46+
}
47+
]
48+
afterSteps: >-
49+
[
50+
{
51+
"name": "publish-testpypi",
52+
"image": "registry.lokalhost.net/python:3.9-buster",
53+
"commands": [
54+
"echo -n \"$PYPI_CREDS\" > ~/.pypirc",
55+
"make publish"
56+
],
57+
"when": {
58+
"branch": ["main", "master"],
59+
"event": ["push", "custom"]
60+
}
61+
},
62+
{
63+
"name": "publish-pypi",
64+
"image": "registry.lokalhost.net/python:3.9-buster",
65+
"commands": [
66+
"echo -n \"$PYPI_CREDS\" > ~/.pypirc",
67+
"VERSION=${DRONE_TAG} make publish-prod"
68+
],
69+
"when": {
70+
"event": ["tag"]
71+
}
72+
}
73+
]
74+
extraObjects: >-
75+
[]

.env

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
### STACK NAME
2+
COMPOSE_PROJECT_NAME=ezpq
3+
4+
### GLOBAL VARIABLES
5+
DOMAIN=
6+
PUBLIC_NETWORK=
7+
NFS_OPTS=
8+
IMAGE_REGISTRY=
9+
10+
### PROJECT VARIABLES
11+
12+
## APP
13+
APP_SVC_ID=app
14+
APP_SUBDOMAIN=ezpq.
15+
APP_ROUTE_PREFIX=
16+
APP_STRIP_PREFIX=
17+
APP_HTTP_PORT=80
18+
APP_PLACEMENT_LABEL=app-server

.gitignore

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
__pycache__
2-
.ipynb_checkpoints
3-
.vscode
41
*.csv
2+
*.egg-info
53
*.pyc
64
.Rhistory
7-
examples.py
5+
.idea
6+
.ipynb_checkpoints
7+
.mypy_cache
8+
.pytest_cache
9+
.vscode
10+
__pycache__
811
build
912
dist
10-
*.egg-info

CHANGELOG.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Changelog
22

3-
All notable changes to this project will be documented in this file.
3+
## v0.3.0
44

5-
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
5+
- refactor full of breaking changes, for the sake of simplicity and completeness.
66

77
## v0.2.1
88

@@ -43,4 +43,4 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a
4343

4444
## v0.1.0
4545

46-
- Initial release
46+
- Initial release

Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
ARG IMAGE_REGISTRY=docker.io
2+
FROM ${IMAGE_REGISTRY}/nginx:1
3+
4+
COPY public /usr/share/nginx/html

Makefile

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
SHELL := sh
2+
.SHELLFLAGS := -c
3+
MAKEFLAGS += --warn-undefined-variables
4+
.RECIPEPREFIX = >
5+
.DEFAULT_GOAL := help
6+
.PHONY: help clean deps test install build check publish publishprod
7+
8+
ifeq ($(OS),Windows_NT)
9+
RM = rmdir /s /q
10+
PYTHON = python
11+
else
12+
RM = rm -rf
13+
PYTHON = python3
14+
endif
15+
16+
PACKAGE_NAME = ezpq
17+
18+
19+
help:
20+
> echo halp
21+
22+
clean:
23+
> -$(RM) build dist .ipynb_checkpoints
24+
25+
deps:
26+
> $(PYTHON) -m pip install -r requirements.txt
27+
28+
test: deps
29+
> $(PYTHON) -m unittest discover --failfast -t . -s ./tests -p test_*.py
30+
31+
install: deps
32+
> pip install .
33+
34+
build: clean deps
35+
> pip install setuptools wheel build
36+
> $(PYTHON) -m build
37+
38+
build-docs: install
39+
> $(PYTHON) -m pip install pdoc
40+
> pdoc -o public --docformat google --search --show-source $(PACKAGE_NAME)
41+
42+
build-readme: deps
43+
> $(PYTHON) -m pip install jupyter ipywidgets ipykernel nbconvert docutils
44+
> jupyter nbconvert --execute *.ipynb --to markdown
45+
46+
check: build
47+
> $(PYTHON) -m pip install twine
48+
> twine check --strict dist/*
49+
50+
publish: check
51+
> twine upload --non-interactive --skip-existing -r testpypi dist/*
52+
53+
publish-prod: check
54+
> twine upload --non-interactive --skip-existing -r pypi dist/*

0 commit comments

Comments
 (0)