Skip to content

Commit b1f3a0d

Browse files
committed
build: apply project template
1 parent 9de76ae commit b1f3a0d

Some content is hidden

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

52 files changed

+1741
-10438
lines changed

.bumpversion.cfg

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[bumpversion]
2+
current_version = 0.3.0
3+
commit = False
4+
message = bump: {current_version} --> {new_version}
5+
tag = False
6+
tag_name = {current_version}
7+
tag_message =
8+
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(?P<rc_kind>[A-Za-z]*)(?P<rc>\d*)
9+
serialize =
10+
{major}.{minor}.{patch}{rc_kind}{rc}
11+
{major}.{minor}.{patch}
12+
13+
[bumpversion:glob:src/*/__version__.py]

.copier-answers.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Changes here will be overwritten by Copier
2+
_commit: a093063
3+
_src_path: https://codeberg.org/Fresh2dev/copier-f2dv-project.git
4+
author_email: [email protected]
5+
author_name: Donald Mellenbruch
6+
ci_domain_name: lokalhost.net
7+
docs_url: https://www.Fresh2.dev/code/r/ezpq/i
8+
funding_url: https://www.Fresh2.dev/funding
9+
home_page: https://www.Fresh2.dev
10+
is_minimal: false
11+
is_python: true
12+
license_type: GPLv3
13+
package_name: ezpq
14+
project_description: None
15+
project_name: ezpq
16+
python_version: '3.7'
17+
repo_mirror: https://www.Fresh2.dev/code/r/ezpq
18+
repo_name: fresh2dev/ezpq
19+
repo_owner: fresh2dev
20+
repo_url: https://www.github.com/fresh2dev/ezpq
21+

.dockerignore

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
**/.git
2+
3+
**/secrets
4+
!**/*.keep
5+
**/*.tmp/build
6+
**/.coverage
7+
**/.hypothesis
8+
**/.tox
9+
**/.idea
10+
**/.vscode
11+
**/*.egg-info
12+
**/.mypy_cache
13+
**/__pycache__
14+
**/.pytest_cache

.drone.yml

Lines changed: 116 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,75 +1,149 @@
11
kind: template
2-
load: deploythatapp.jsonnet
2+
load: hostbutter.jsonnet
33
data:
4-
projectName: ${DRONE_REPO}
5-
gitSshKey: default
6-
ciImageRegistry: "registry.lokalhost.net"
74
domains: >-
8-
["lokalhost.net", "fresh2.dev"]
5+
["lokalhost.net"]
96
domainTriggers: >-
107
{
11-
"lokalhost.net": {
12-
"branch": ["main", "master"],
13-
"event": ["push", "custom"]
14-
},
15-
"fresh2.dev": {
16-
"event": ["tag"]
17-
}
8+
"lokalhost.net": {}
189
}
19-
imageTags: ""
20-
useDinD: false
21-
publishDockerHub: false
22-
deployStack: true
23-
deployCommands: >-
10+
domainClusterMap: >-
11+
{}
12+
publishRegistries: >-
2413
{}
2514
secrets: >-
2615
[]
2716
secretFiles: >-
28-
{}
29-
volumes: >-
30-
[]
31-
domainVars: >-
3217
{
33-
"lokalhost.net": {
34-
"PYPI_CREDS": {"from_secret": "lokalhost.net_pypi-creds"}
35-
}
18+
"ENV_FILE": ".env"
3619
}
20+
volumes: >-
21+
[]
3722
beforeSteps: >-
3823
[
3924
{
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-
}
25+
"name": "py-test",
26+
"image": "registry.lokalhost.net/fresh2dev/mykefiles:5de40c3",
27+
"environment": {
28+
"PIP_CONF": {"from_secret": "PIP_CONF"},
29+
"MYKE_MODULE": "mykefiles.python"
30+
},
31+
"commands": [
32+
"mkdir -p ~/.config/pip && echo \"$PIP_CONF\" > ~/.config/pip/pip.conf",
33+
"myke py-install",
34+
"myke py-reports",
35+
"myke py-build"
36+
],
37+
"when": {}
4638
}
4739
]
4840
afterSteps: >-
41+
[]
42+
finalSteps: >-
4943
[
5044
{
51-
"name": "publish-testpypi",
52-
"image": "registry.lokalhost.net/python:3.9-buster",
45+
"name": "py-build-package",
46+
"image": "registry.lokalhost.net/fresh2dev/mykefiles:5de40c3",
47+
"environment": {
48+
"PYPI_CREDS": {"from_secret": "PYPI_CREDS"},
49+
"PIP_CONF": {"from_secret": "PIP_CONF"},
50+
"MYKE_MODULE": "mykefiles.python"
51+
},
5352
"commands": [
54-
"echo -n \"$PYPI_CREDS\" > ~/.pypirc",
55-
"make publish"
53+
"echo \"$PYPI_CREDS\" > ~/.pypirc",
54+
"mkdir -p ~/.config/pip && echo \"$PIP_CONF\" > ~/.config/pip/pip.conf",
55+
"myke py-version-set --repository lokalhost",
56+
"myke py-build"
57+
],
58+
"when": {}
59+
},
60+
{
61+
"name": "py-publish-sandbox",
62+
"image": "registry.lokalhost.net/fresh2dev/mykefiles:5de40c3",
63+
"environment": {
64+
"PYPI_CREDS": {"from_secret": "PYPI_CREDS"},
65+
"PIP_CONF": {"from_secret": "PIP_CONF"},
66+
"TWINE_CERT": "/etc/ssl/certs/ca-certificates.crt",
67+
"MYKE_MODULE": "mykefiles.python"
68+
},
69+
"commands": [
70+
"echo \"$PYPI_CREDS\" > ~/.pypirc",
71+
"mkdir -p ~/.config/pip && echo \"$PIP_CONF\" > ~/.config/pip/pip.conf",
72+
"myke py-publish --repository lokalhost"
73+
],
74+
"when": {}
75+
},
76+
{
77+
"name": "py-publish-dev",
78+
"image": "registry.lokalhost.net/fresh2dev/mykefiles:5de40c3",
79+
"environment": {
80+
"PYPI_CREDS": {"from_secret": "PYPI_CREDS"},
81+
"PIP_CONF": {"from_secret": "PIP_CONF"},
82+
"TWINE_CERT": "/etc/ssl/certs/ca-certificates.crt",
83+
"MYKE_MODULE": "mykefiles.python"
84+
},
85+
"commands": [
86+
"echo \"$PYPI_CREDS\" > ~/.pypirc",
87+
"mkdir -p ~/.config/pip && echo \"$PIP_CONF\" > ~/.config/pip/pip.conf",
88+
"myke py-publish --repository codeberg"
89+
],
90+
"when": {
91+
"ref": ["refs/heads/dev", "refs/heads/main", "refs/tags/*"]
92+
}
93+
},
94+
{
95+
"name": "py-publish-test",
96+
"image": "registry.lokalhost.net/fresh2dev/mykefiles:5de40c3",
97+
"environment": {
98+
"PYPI_CREDS": {"from_secret": "PYPI_CREDS"},
99+
"PIP_CONF": {"from_secret": "PIP_CONF"},
100+
"TWINE_CERT": "/etc/ssl/certs/ca-certificates.crt",
101+
"MYKE_MODULE": "mykefiles.python"
102+
},
103+
"commands": [
104+
"echo \"$PYPI_CREDS\" > ~/.pypirc",
105+
"mkdir -p ~/.config/pip && echo \"$PIP_CONF\" > ~/.config/pip/pip.conf",
106+
"myke py-publish --repository testpypi"
56107
],
57108
"when": {
58-
"branch": ["main", "master"],
59-
"event": ["push", "custom"]
109+
"ref": ["refs/tags/*"]
60110
}
61111
},
62112
{
63-
"name": "publish-pypi",
64-
"image": "registry.lokalhost.net/python:3.9-buster",
113+
"name": "py-publish-prod",
114+
"image": "registry.lokalhost.net/fresh2dev/mykefiles:5de40c3",
115+
"environment": {
116+
"PYPI_CREDS": {"from_secret": "PYPI_CREDS"},
117+
"PIP_CONF": {"from_secret": "PIP_CONF"},
118+
"TWINE_CERT": "/etc/ssl/certs/ca-certificates.crt",
119+
"MYKE_MODULE": "mykefiles.python"
120+
},
65121
"commands": [
66-
"echo -n \"$PYPI_CREDS\" > ~/.pypirc",
67-
"VERSION=${DRONE_TAG} make publish-prod"
122+
"echo \"$PYPI_CREDS\" > ~/.pypirc",
123+
"mkdir -p ~/.config/pip && echo \"$PIP_CONF\" > ~/.config/pip/pip.conf",
124+
"myke py-publish --repository pypi"
68125
],
69126
"when": {
70-
"event": ["tag"]
127+
"ref": ["refs/tags/*"]
71128
}
72129
}
73130
]
74131
extraObjects: >-
75-
[]
132+
[
133+
{
134+
"kind": "secret",
135+
"name": "PYPI_CREDS",
136+
"get": {
137+
"path": "secret/data/hostbutter/global",
138+
"name": "PYPI_CREDS"
139+
}
140+
},
141+
{
142+
"kind": "secret",
143+
"name": "PIP_CONF",
144+
"get": {
145+
"path": "secret/data/hostbutter/global",
146+
"name": "PIP_CONF"
147+
}
148+
}
149+
]

.env

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,19 @@
22
COMPOSE_PROJECT_NAME=ezpq
33

44
### GLOBAL VARIABLES
5-
DOMAIN=
6-
PUBLIC_NETWORK=
7-
NFS_OPTS=
8-
IMAGE_REGISTRY=
5+
HB_DOMAIN=
6+
HB_PROXY_NETWORK=
7+
HB_NFS_OPTS=
8+
HB_IMAGE_REGISTRY=
99

1010
### PROJECT VARIABLES
1111

1212
## APP
1313
APP_SVC_ID=app
1414
APP_SUBDOMAIN=ezpq.
1515
APP_ROUTE_PREFIX=
16-
APP_STRIP_PREFIX=
16+
# APP_STRIP_PREFIX=
1717
APP_HTTP_PORT=80
18-
APP_PLACEMENT_LABEL=app-server
18+
APP_PLACEMENT_LABEL=frontend
19+
20+
PYTHONPATH=src

.gitignore

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,22 @@
1-
*.csv
2-
*.egg-info
3-
*.pyc
4-
.Rhistory
5-
.idea
6-
.ipynb_checkpoints
7-
.mypy_cache
8-
.pytest_cache
9-
.vscode
10-
__pycache__
11-
build
12-
dist
1+
**/secrets
2+
!**/*.keep
3+
**/*.tmp
4+
.python-version
5+
6+
/public
7+
8+
/requirements.txt
9+
/dist
10+
/build
11+
12+
**/.coverage
13+
**/.hypothesis
14+
**/.tox
15+
**/.idea
16+
**/.vscode
17+
**/*.egg-info
18+
**/.mypy_cache
19+
**/__pycache__
20+
**/.pytest_cache
21+
**/.ropeproject
22+
**/.ruff_cache

.python-base-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.7.16

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,4 @@
4343

4444
## v0.1.0
4545

46-
- Initial release
46+
- Initial release

Dockerfile

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,24 @@
1-
ARG IMAGE_REGISTRY=docker.io
2-
FROM ${IMAGE_REGISTRY}/nginx:1
1+
ARG HB_IMAGE_REGISTRY=docker.io
2+
FROM ${HB_IMAGE_REGISTRY}/python:3.10.10-slim-bullseye as build
3+
LABEL org.opencontainers.image.source=https://www.github.com/fresh2dev/ezpq
4+
LABEL org.opencontainers.image.description="None"
5+
LABEL org.opencontainers.image.licenses=GPLv3
6+
RUN apt-get update && apt-get install --upgrade -y build-essential git
7+
WORKDIR /app
8+
ENV PYTHONUNBUFFERED=1
9+
RUN python3 -m venv /app/venv
10+
ENV PATH="/app/venv/bin:$PATH"
11+
RUN python3 -m pip install --no-cache-dir --upgrade pip
12+
COPY ./dist /dist
13+
RUN find /dist -name "*.whl" -exec \
14+
pip install --no-cache-dir \
15+
--extra-index-url "https://codeberg.org/api/packages/Fresh2dev/pypi/simple" \
16+
"{}" \; \
17+
&& pip show "ezpq"
318

4-
COPY public /usr/share/nginx/html
19+
FROM ${HB_IMAGE_REGISTRY}/python:3.10.10-slim-bullseye
20+
COPY --from=build /app/venv /app/venv
21+
COPY --from=build /usr/local/bin /usr/local/bin
22+
ENV PATH="/app/venv/bin:$PATH"
23+
ENTRYPOINT ["ezpq"]
24+
WORKDIR /workspace

Dockerfile-docs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
ARG HB_IMAGE_REGISTRY=docker.io
2+
FROM ${HB_IMAGE_REGISTRY}/nginx:1
3+
LABEL org.opencontainers.image.source=https://www.github.com/fresh2dev/ezpq
4+
LABEL org.opencontainers.image.description="None"
5+
LABEL org.opencontainers.image.licenses=GPLv3
6+
ARG CONTENT_PATH=public
7+
COPY $CONTENT_PATH /usr/share/nginx/html

0 commit comments

Comments
 (0)