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

Unify Compose environments for testing AM packages #355

Merged
merged 8 commits into from
Jun 20, 2024
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Unify Dockerfile and requirements.txt
replaceafill committed Jun 19, 2024
commit 2e1c277437a372bf4ccca50528fbec32191b370b
10 changes: 7 additions & 3 deletions .github/workflows/test-am-debs.yml
Original file line number Diff line number Diff line change
@@ -6,6 +6,8 @@ on:
- "debs/jammy/archivematica/**"
- "debs/jammy/archivematica-storage-service/**"
- "tests/archivematica/jammy/**"
- "tests/archivematica/requirements.txt"
- "tests/archivematica/Dockerfile"
push:
branches:
- "stable/**"
@@ -14,6 +16,8 @@ on:
- "debs/jammy/archivematica/**"
- "debs/jammy/archivematica-storage-service/**"
- "tests/archivematica/jammy/**"
- "tests/archivematica/requirements.txt"
- "tests/archivematica/Dockerfile"
jobs:
build-am-deb:
name: Build Archivematica Debian packages
@@ -98,20 +102,20 @@ jobs:
python-version: "3.10"
cache: "pip"
cache-dependency-path: |
tests/archivematica/jammy/requirements.txt
tests/archivematica/requirements.txt
- name: "Cache the virtual environment"
id: "venv-cache"
uses: "actions/cache@v4"
with:
path: |
tests/archivematica/jammy/.venv/
key: "os-${{ runner.os }}-python_version-${{ env.python_version }}-hash-${{ hashFiles('tests/archivematica/jammy/requirements.txt') }}"
key: "os-${{ runner.os }}-python_version-${{ env.python_version }}-hash-${{ hashFiles('tests/archivematica/requirements.txt') }}"
- name: "Set up the virtual environment"
if: "steps.venv-cache.outputs.cache-hit == false"
working-directory: "${{ github.workspace }}/tests/archivematica/jammy"
run: |
python3 -m venv .venv
.venv/bin/python -m pip install -r requirements.txt
.venv/bin/python -m pip install -r ../requirements.txt
- name: "Add virtual environment to PATH"
working-directory: "${{ github.workspace }}/tests/archivematica/jammy"
run:
10 changes: 7 additions & 3 deletions .github/workflows/test-am-rpms.yml
Original file line number Diff line number Diff line change
@@ -6,6 +6,8 @@ on:
- "rpms/EL9/archivematica/**"
- "rpms/EL9/archivematica-storage-service/**"
- "tests/archivematica/EL9/**"
- "tests/archivematica/requirements.txt"
- "tests/archivematica/Dockerfile"
push:
branches:
- "stable/**"
@@ -14,6 +16,8 @@ on:
- "rpms/EL9/archivematica/**"
- "rpms/EL9/archivematica-storage-service/**"
- "tests/archivematica/EL9/**"
- "tests/archivematica/requirements.txt"
- "tests/archivematica/Dockerfile"
jobs:
build-am-rpm:
name: Build Archivematica RPM packages
@@ -98,20 +102,20 @@ jobs:
python-version: "3.10"
cache: "pip"
cache-dependency-path: |
tests/archivematica/EL9/requirements.txt
tests/archivematica/requirements.txt
- name: "Cache the virtual environment"
id: "venv-cache"
uses: "actions/cache@v4"
with:
path: |
tests/archivematica/EL9/.venv/
key: "os-${{ runner.os }}-python_version-${{ env.python_version }}-hash-${{ hashFiles('tests/archivematica/EL9/requirements.txt') }}"
key: "os-${{ runner.os }}-python_version-${{ env.python_version }}-hash-${{ hashFiles('tests/archivematica/requirements.txt') }}"
- name: "Set up the virtual environment"
if: "steps.venv-cache.outputs.cache-hit == false"
working-directory: "${{ github.workspace }}/tests/archivematica/EL9"
run: |
python3 -m venv .venv
.venv/bin/python -m pip install -r requirements.txt
.venv/bin/python -m pip install -r ../requirements.txt
- name: "Add virtual environment to PATH"
working-directory: "${{ github.workspace }}/tests/archivematica/EL9"
run:
Original file line number Diff line number Diff line change
@@ -24,14 +24,27 @@ ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
ENV TZ=UTC

RUN ln -snf /usr/share/zoneinfo/${TZ} /etc/localtime && echo ${TZ} > /etc/timezone

FROM rockylinux:9 AS install_rockylinux_9

RUN set -ex \
&& dnf -y update \
&& dnf -y install coreutils --allowerasing \
&& dnf -y install \
glibc-langpack-en \
openssh-server \
python-unversioned-command \
selinux-policy \
sudo \
&& dnf clean all

FROM install_${DOCKER_IMAGE_NAME}_${DOCKER_IMAGE_TAG} as server

RUN useradd --home-dir /home/ubuntu --system ubuntu

RUN mkdir -p /etc/sudoers.d/ && echo 'ubuntu ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers.d/ubuntu

RUN ln -snf /usr/share/zoneinfo/${TZ} /etc/localtime && echo ${TZ} > /etc/timezone

COPY --chown=ubuntu:ubuntu . /src

EXPOSE 22
32 changes: 0 additions & 32 deletions tests/archivematica/EL9/Dockerfile

This file was deleted.

2 changes: 1 addition & 1 deletion tests/archivematica/EL9/README.md
Original file line number Diff line number Diff line change
@@ -21,7 +21,7 @@ source .venv/bin/activate
Install the Python requirements:

```shell
python3 -m pip install -r requirements.txt
python3 -m pip install -r ../requirements.txt
```

## Starting the Compose environment
2 changes: 2 additions & 0 deletions tests/archivematica/EL9/compose.yaml
Original file line number Diff line number Diff line change
@@ -5,6 +5,8 @@ services:

archivematica:
build:
context: "."
dockerfile: "../Dockerfile"
args:
DOCKER_IMAGE_NAME: "${DOCKER_IMAGE_NAME:-rockylinux}"
DOCKER_IMAGE_TAG: "${DOCKER_IMAGE_TAG:-9}"
2 changes: 1 addition & 1 deletion tests/archivematica/jammy/README.md
Original file line number Diff line number Diff line change
@@ -21,7 +21,7 @@ source .venv/bin/activate
Install the Python requirements:

```shell
python3 -m pip install -r requirements.txt
python3 -m pip install -r ../requirements.txt
```

## Starting the Compose environment
2 changes: 2 additions & 0 deletions tests/archivematica/jammy/compose.yaml
Original file line number Diff line number Diff line change
@@ -5,6 +5,8 @@ services:

archivematica:
build:
context: "."
dockerfile: "../Dockerfile"
args:
DOCKER_IMAGE_NAME: "${DOCKER_IMAGE_NAME:-ubuntu}"
DOCKER_IMAGE_TAG: "${DOCKER_IMAGE_TAG:-22.04}"
1 change: 0 additions & 1 deletion tests/archivematica/jammy/requirements.txt

This file was deleted.

File renamed without changes.