Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Dockerfile and script to run a copier update on all repos #640

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Dockerfile
34 changes: 34 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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
39 changes: 39 additions & 0 deletions copier-update-all.sh
Original file line number Diff line number Diff line change
@@ -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 [email protected]
install-pre-commit
oca-copier-update \
--repos $REPOS \
--branches 12.0 \
--git-protocol https

mise use -g [email protected]
install-pre-commit
oca-copier-update \
--repos $REPOS \
--branches 13.0 \
--git-protocol https

mise use -g [email protected]
install-pre-commit
oca-copier-update \
--repos $REPOS \
--branches 14.0,15.0,16.0,17.0,18.0 \
--git-protocol https
8 changes: 8 additions & 0 deletions mise.toml
Original file line number Diff line number Diff line change
@@ -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"