Skip to content

Commit

Permalink
## 4.0.0 / 2023-08-04
Browse files Browse the repository at this point in the history
- Upgraded to Ansible 8.2.0

- Changed from [pipenv][] to [pdm][] and `pyproject.toml` because of
  ongoing issues with Dependabot not detecting dependencies in
  `Pipfile.lock` as opposed to only in `requirements.txt` (the inverse
  of dependabot/dependabot-core#6200). After trying Poetry (predates the
  latest Python packaging PEPs), rye (experimental), and hatch (no lock
  file), [pdm][] seems to fit the bill best for the limited needs that
  we have with this project.

- Experimentally removed the generated `requirements.txt` file. It isn't
  used, but it has been valuable in getting update notifications from
  Dependabot, although the update PRs are less useful. If required, we
  can add it back with `pdm export -f requirements > requirements.txt`.
  • Loading branch information
halostatue committed Aug 4, 2023
1 parent ccfe025 commit 51c3891
Show file tree
Hide file tree
Showing 12 changed files with 415 additions and 314 deletions.
15 changes: 12 additions & 3 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
version: 2
updates:
# Maintain dependencies for GitHub Actions
- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
interval: monthly
groups:
actions:
patterns:
- '*'

- package-ecosystem: docker
directory: /
schedule:
interval: weekly
interval: monthly

- package-ecosystem: pip
directory: /
schedule:
interval: monthly
4 changes: 2 additions & 2 deletions .github/workflows/build-test-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ jobs:
steps:
- uses: actions/checkout@v3

- uses: docker/setup-buildx-action@2a1a44ac4aa01993040736bd95bb470da1a38365 # v2.9.0
- uses: docker/setup-buildx-action@v2.9.0

- id: docker_build
uses: docker/build-push-action@2eb1c1961a95fc15694676618e422e8ba1d63825 # v4.1.1
uses: docker/build-push-action@v4.1.1
with:
context: .
load: true
Expand Down
16 changes: 9 additions & 7 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@ jobs:
if: github.event_name == 'workflow_dispatch'
with:
ref: refs/tags/${{ github.event.inputs.tag }}

- uses: ghalactic/github-release-from-tag@v4
with:
summaryEnabled: false

publish-image:
name: Build and Push to Docker Hub
runs-on: ubuntu-latest
Expand All @@ -35,19 +37,19 @@ jobs:
with:
ref: refs/tags/${{ github.event.inputs.tag }}

- uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc # v2.2.0
- uses: docker/login-action@v2.2.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc # v2.2.0
- uses: docker/login-action@v2.2.0
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- id: meta
uses: docker/metadata-action@818d4b7b91585d195f67373fd9cb0332e31a7175 # v4.6.0
uses: docker/metadata-action@v4.6.0
with:
images: |
kineticcafe/ansible
Expand All @@ -62,11 +64,11 @@ jobs:
type=semver,pattern={{major}}
type=sha
- uses: docker/setup-qemu-action@2b82ce82d56a2a04d2637cd93a637ae1b359c0a7 # v2.2.0
- uses: docker/setup-buildx-action@2a1a44ac4aa01993040736bd95bb470da1a38365 # v2.9.0
- uses: docker/setup-qemu-action@v2.2.0
- uses: docker/setup-buildx-action@v2.9.0

- id: docker_build
uses: docker/build-push-action@2eb1c1961a95fc15694676618e422e8ba1d63825 # v4.1.1
uses: docker/build-push-action@v4.1.1
with:
context: .
push: true
Expand All @@ -78,7 +80,7 @@ jobs:
cache-from: type=gha
cache-to: type=gha,mode=max

- uses: peter-evans/dockerhub-description@dc67fad7001ef9e8e3c124cb7a64e16d0a63d864 # v3.4.2
- uses: peter-evans/dockerhub-description@v3.4.2
with:
repository: kineticcafe/ansible
username: ${{ secrets.DOCKERHUB_USERNAME }}
Expand Down
162 changes: 162 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/#use-with-ide
.pdm.toml
.pdm-python
.pdm-build/

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
22 changes: 21 additions & 1 deletion Changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
# [ghcr.io/]kineticcafe/ansible Changelog

## 4.0.0 / 2023-08-04

- Upgraded to Ansible 8.2.0

- Changed from [pipenv][] to [pdm][] and `pyproject.toml` because of ongoing
issues with Dependabot not detecting dependencies in `Pipfile.lock` as
opposed to only in `requirements.txt` (the inverse of
dependabot/dependabot-core#6200). After trying Poetry (predates the latest
Python packaging PEPs), rye (experimental), and hatch (no lock file), [pdm][]
seems to fit the bill best for the limited needs that we have with this
project.

- Experimentally removed the generated `requirements.txt` file. It isn't used,
but it has been valuable in getting update notifications from Dependabot,
although the update PRs are less useful. If required, we can add it back with
`pdm export -f requirements > requirements.txt`.

## 3.3.0 / 2023-07-17

- Upgraded to Ansible 7.7.0
Expand All @@ -21,7 +38,7 @@
- Upgraded from Debian Buster (slim) to Debian Bullseye (slim) as the base
image. Using Python 3.10 instead of Python 3.9.

- Changed from `requirements.txt` to `Pipfile` with pipenv.
- Changed from `requirements.txt` to `Pipfile` with [pipenv][].

- Fixed issues for running the Ansible scripts in a non-interactive environment.

Expand Down Expand Up @@ -54,3 +71,6 @@
## 1.0 / 2021-05-21

- Initial released version.

[pipenv]: https://pipenv.pypa.io/en/latest/
[pdm]: https://github.com/pdm-project/pdm
14 changes: 7 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM python:3.11-slim-bullseye AS builder

ENV LC_ALL=C.UTF-8 \
LANG=C.UTF-8 EDITOR=nano \
PIPENV_VENV_IN_PROJECT=1
LANG=C.UTF-8 \
EDITOR=nano

RUN apt-get -qqy update \
&& apt-get -qqy upgrade \
Expand All @@ -19,15 +19,15 @@ RUN apt-get -qqy update \
USER ansible

ENV LC_ALL=C.UTF-8 \
LANG=C.UTF-8 EDITOR=nano \
PIPENV_VENV_IN_PROJECT=1
LANG=C.UTF-8 \
EDITOR=nano

WORKDIR /opt/ansible

ADD Pipfile Pipfile.lock /opt/ansible/
ADD pyproject.toml pdm.lock /opt/ansible/

RUN python3 -m pip install --user pipenv \
&& /home/ansible/.local/bin/pipenv sync
RUN python3 -m pip install --user pdm \
&& /home/ansible/.local/bin/pdm sync --clean --production --no-editable

FROM python:3.11-slim-bullseye AS runtime

Expand Down
12 changes: 0 additions & 12 deletions Pipfile

This file was deleted.

0 comments on commit 51c3891

Please sign in to comment.