From 2d0c9fdf3ec44d75086b7796c80dcedabffe134b Mon Sep 17 00:00:00 2001 From: Gabriel Bustamante Date: Wed, 24 Jul 2024 13:31:21 -0500 Subject: [PATCH] Add a `docker-compose run --rm ci-admin` command This commit introduces a new docker-compose command to run the ci-admin tool. Note: If the `requirements/test.txt` file changes, the Docker image needs to be rebuilt to include the updated dependencies. --- Dockerfile | 28 ++++++++++++++++++++++++++++ docker-compose.yml | 8 ++++++++ entrypoint.sh | 5 +++++ 3 files changed, 41 insertions(+) create mode 100644 Dockerfile create mode 100644 docker-compose.yml create mode 100644 entrypoint.sh diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..c5d3d487 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,28 @@ +FROM ubuntu:latest + +ENV DEBIAN_FRONTEND=noninteractive +ENV TASKCLUSTER_ROOT_URL=https://firefox-ci-tc.services.mozilla.com/ + +RUN apt update && \ + apt install -y software-properties-common curl git + +RUN add-apt-repository ppa:deadsnakes/ppa && \ + apt update && \ + apt install -y python3.11 python3.11-venv python3.11-dev + +RUN curl -sS https://bootstrap.pypa.io/get-pip.py -o get-pip.py && \ + python3.11 get-pip.py && \ + rm get-pip.py + +WORKDIR /home/fxci-config + +RUN mkdir -p /home/fxci-config/requirements + +COPY requirements/*.txt /home/fxci-config/requirements/ + +RUN python3.11 -m pip install -r /home/fxci-config/requirements/test.txt + +COPY entrypoint.sh /usr/local/bin/entrypoint.sh +RUN chmod +x /usr/local/bin/entrypoint.sh + +ENTRYPOINT ["entrypoint.sh"] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000..c707c3b6 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,8 @@ +version: '3.8' + +services: + ci-admin: + build: . + volumes: + - .:/home/fxci-config + working_dir: /home/fxci-config diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100644 index 00000000..1327c34d --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +python3.11 -m pip install --root-user-action=ignore -e . + +ci-admin "$@"