-
-
Notifications
You must be signed in to change notification settings - Fork 461
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Dockerfile and script to run a copier update on all repos
- Loading branch information
Showing
4 changed files
with
82 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Dockerfile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |