Compare commits

...

2 Commits

Author SHA1 Message Date
5f6f18d8fe
Add build automation tooling 2024-05-02 17:39:18 -04:00
bed13653bc
Add containerfile and python tooling 2024-05-02 17:39:01 -04:00
4 changed files with 127 additions and 0 deletions

40
Containerfile Normal file
View File

@ -0,0 +1,40 @@
ARG PYTHON_VERSION=3.12
FROM docker.io/library/python:${PYTHON_VERSION} AS build
ARG POETRY_VERSION=1.8.1
RUN python -m pip install pip --upgrade
RUN curl -sSL -o /install-poetry.py https://install.python-poetry.org
RUN python /install-poetry.py --yes --version ${POETRY_VERSION}
ADD . /build
WORKDIR /build
RUN /root/.local/bin/poetry self add poetry-plugin-export
RUN /root/.local/bin/poetry export \
--format requirements.txt \
--output /build/requirements.txt \
--without-hashes
RUN python -m pip wheel \
--wheel-dir /build/wheels \
--requirement /build/requirements.txt \
--disable-pip-version-check \
--no-cache-dir
FROM docker.io/library/python:${PYTHON_VERSION}-slim AS final
COPY --from=build /build/wheels /tmp/wheels
RUN python -m pip install /tmp/wheels/*.whl \
--upgrade \
--pre \
--no-index \
--no-cache-dir \
--find-links /tmp/wheels \
--disable-pip-version-check
RUN rm -rf /tmp/wheels
ENTRYPOINT ["s3cmd"]
CMD ["--help"]

19
Makefile Normal file
View File

@ -0,0 +1,19 @@
REPOSITORY = vcs.enp.one/skylab/s3cmd-container
.PHONY: help docs
# source: https://marmelab.com/blog/2016/02/29/auto-documented-makefile.html
help: ## List Makefile targets
$(info Makefile documentation)
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-10s\033[0m %s\n", $$1, $$2}'
image: ## Build image
podman build . --tag $(REPOSITORY):latest
push: image ## Build and publish image
podman login $(shell echo $(REPOSITORY) | cut -d '/' -f 1)
podman push $(REPOSITORY):latest
dev: ## Setup local dev environment
poetry install

57
poetry.lock generated Normal file
View File

@ -0,0 +1,57 @@
# This file is automatically @generated by Poetry 1.8.1 and should not be changed by hand.
[[package]]
name = "python-dateutil"
version = "2.9.0.post0"
description = "Extensions to the standard Python datetime module"
optional = false
python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,>=2.7"
files = [
{file = "python-dateutil-2.9.0.post0.tar.gz", hash = "sha256:37dd54208da7e1cd875388217d5e00ebd4179249f90fb72437e91a35459a0ad3"},
{file = "python_dateutil-2.9.0.post0-py2.py3-none-any.whl", hash = "sha256:a8b2bc7bffae282281c8140a97d3aa9c14da0b136dfe83f850eea9a5f7470427"},
]
[package.dependencies]
six = ">=1.5"
[[package]]
name = "python-magic"
version = "0.4.27"
description = "File type identification using libmagic"
optional = false
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*"
files = [
{file = "python-magic-0.4.27.tar.gz", hash = "sha256:c1ba14b08e4a5f5c31a302b7721239695b2f0f058d125bd5ce1ee36b9d9d3c3b"},
{file = "python_magic-0.4.27-py2.py3-none-any.whl", hash = "sha256:c212960ad306f700aa0d01e5d7a325d20548ff97eb9920dcd29513174f0294d3"},
]
[[package]]
name = "s3cmd"
version = "2.4.0"
description = "Command line tool for managing Amazon S3 and CloudFront services"
optional = false
python-versions = "*"
files = [
{file = "s3cmd-2.4.0-py2.py3-none-any.whl", hash = "sha256:13ad8a44d44cc0535ba8c878c91fd68cd830dc48f6388722fa44a7aaf3f18017"},
{file = "s3cmd-2.4.0.tar.gz", hash = "sha256:6b567521be1c151323f2059c8feec85ded96b6f184ff80535837fea33798b40b"},
]
[package.dependencies]
python-dateutil = "*"
python-magic = "*"
[[package]]
name = "six"
version = "1.16.0"
description = "Python 2 and 3 compatibility utilities"
optional = false
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*"
files = [
{file = "six-1.16.0-py2.py3-none-any.whl", hash = "sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254"},
{file = "six-1.16.0.tar.gz", hash = "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926"},
]
[metadata]
lock-version = "2.0"
python-versions = "^3.10"
content-hash = "05345206c0052aef79fd8332a8e3b14f9b815e4e1a0ae08f9e4e09a14e824c1d"

11
pyproject.toml Normal file
View File

@ -0,0 +1,11 @@
[tool.poetry]
name = "s3cmd-container"
package-mode = false
description = "Container with s3cmd inside"
authors = ["Ethan Paul <e@enp.one>"]
license = "MIT"
[tool.poetry.dependencies]
python = "^3.10"
s3cmd = "^2.4.0"