Skip to content

Commit

Permalink
Add Dockerfile and script to run a copier update on all repos
Browse files Browse the repository at this point in the history
  • Loading branch information
sbidoul committed Feb 1, 2025
1 parent fbdc894 commit a6a2853
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 0 deletions.
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"

0 comments on commit a6a2853

Please sign in to comment.