Skip to content

Commit

Permalink
feat: add emondada
Browse files Browse the repository at this point in the history
  • Loading branch information
mglants committed May 31, 2024
1 parent 5856600 commit cc7a17b
Show file tree
Hide file tree
Showing 4 changed files with 93 additions and 0 deletions.
38 changes: 38 additions & 0 deletions apps/emonoda/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
FROM python:3.10-slim as base

# Setup env
ENV LANG C.UTF-8
ENV LC_ALL C.UTF-8
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONFAULTHANDLER 1


FROM base AS python-deps
ARG VERSION
# Install pipenv and compilation dependencies
RUN pip install pipenv
RUN apt-get update && apt-get install -y --no-install-recommends gcc git g++

# Install python dependencies in /.venv
COPY Pipfile .
RUN PIPENV_VENV_IN_PROJECT=1 pipenv run pip install Cython
RUN PIPENV_VENV_IN_PROJECT=1 pipenv install --deploy


FROM base AS runtime
ARG TARGETPLATFORM
ARG TARGETARCH
ARG TARGETOS
LABEL xyz.glants.image.target_platform=$TARGETPLATFORM
LABEL xyz.glants.image.target_architecture=$TARGETARCH
LABEL xyz.glants.image.target_os=$TARGETOS
LABEL org.opencontainers.image.title="emonoda"
LABEL org.opencontainers.image.source="https://github.com/mdevaev/emonoda"
# Copy virtual env from python-deps stage
COPY --from=python-deps /.venv /.venv
ENV PATH="/.venv/bin:$PATH"

# Create and switch to a new user
RUN useradd --create-home app
WORKDIR /home/app
USER app
20 changes: 20 additions & 0 deletions apps/emonoda/Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
Cython = "*"
chardet = "*"
pyyaml = "*"
colorama = "*"
pygments = "*"
pytz = "*"
python-dateutil = "*"
Mako = "*"
emonoda = {editable = true, ref = "v${VERSION}", git = "git+https://github.com/mdevaev/emonoda.git"}

[dev-packages]

[requires]
python_version = "3"
23 changes: 23 additions & 0 deletions apps/emonoda/ci/latest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/env python

import requests
import json
import semver


# Get the latest version of matchbox

URL = "https://api.github.com/repos/mdevaev/emonoda/tags"

def get_latest(channel):
r = requests.get(URL)
data = json.loads(r.text)
versions = [ semver.Version.parse(release['name'].replace('v', '')) for release in data ]
latest_version = max(versions)

return str(latest_version)

if __name__ == "__main__":
import sys
channel = sys.argv[1]
print(get_latest(channel))
12 changes: 12 additions & 0 deletions apps/emonoda/metadata.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
app: "emonoda"
base: false
semantic_versioning: true
channels:
- name: "stable"
platforms:
- linux/arm64
- linux/amd64
stable: true
tests:
enabled: false

0 comments on commit cc7a17b

Please sign in to comment.