diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..94143827 --- /dev/null +++ b/.dockerignore @@ -0,0 +1 @@ +Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..fc4da7d8 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,34 @@ +# An image to run maintainer tools. +# gh auth login (https, browser) +# gh auth setup-git + +FROM debian:12-slim + +RUN apt-get update \ + && apt-get -y --no-install-recommends install \ + sudo curl git ca-certificates build-essential \ + libssl-dev zlib1g-dev \ + libbz2-dev libreadline-dev libsqlite3-dev curl \ + libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev \ + libffi-dev liblzma-dev \ + && rm -rf /var/lib/apt/lists/* + +ENV MISE_DATA_DIR="/mise" +ENV MISE_CONFIG_DIR="/mise" +ENV MISE_CACHE_DIR="/mise/cache" +ENV MISE_INSTALL_PATH="/usr/local/bin/mise" +ENV PATH="/mise/shims:$PATH" + +RUN curl https://mise.run | sh + +COPY mise.toml ${MISE_DATA_DIR}/config.toml +RUN mise install + +RUN uv venv /venv + +# Install maintainer-tools and its dependencies. +COPY . /app +RUN uv pip install --python /venv/bin/python -e /app \ + && ln -s /venv/bin/oca-copier-update /usr/local/bin/ + +COPY copier-update-all.sh /usr/local/bin diff --git a/copier-update-all.sh b/copier-update-all.sh new file mode 100755 index 00000000..fcadac14 --- /dev/null +++ b/copier-update-all.sh @@ -0,0 +1,39 @@ +#!/bin/bash + +# This is script is meant to run in the image built from this repository. + +set -eauxo pipefail + +REPOS=:all: + +gh auth login --hostname=github.com --git-protocol=https --web + +gh auth setup-git + +function install-pre-commit { + rm -fr /tmp/pre-commit-env /usr/local/bin/pre-commit + python3 -m venv /tmp/pre-commit-env + /tmp/pre-commit-env/bin/pip install pre-commit + ln -s /tmp/pre-commit-env/bin/pre-commit /usr/local/bin/pre-commit +} + +mise use -g python@3.6 +install-pre-commit +oca-copier-update \ + --repos $REPOS \ + --branches 12.0 \ + --git-protocol https + +mise use -g python@3.8 +install-pre-commit +oca-copier-update \ + --repos $REPOS \ + --branches 13.0 \ + --git-protocol https + +mise use -g python@3.11 +install-pre-commit +oca-copier-update \ + --repos $REPOS \ + --branches 14.0,15.0,16.0,17.0,18.0 \ + --git-protocol https diff --git a/mise.toml b/mise.toml new file mode 100644 index 00000000..5baab849 --- /dev/null +++ b/mise.toml @@ -0,0 +1,8 @@ +[settings.pipx] +uvx = true + +[tools] +github-cli = "latest" +"pipx:copier" = "latest" +python = ["3.13", "3.11", "3.8", "3.6"] +uv = "latest"