From 1c58bbe3038f582dbec7006d573ed5bd50e73227 Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Sun, 14 Jan 2024 12:08:54 +0100 Subject: [PATCH 1/3] Adapt to `warc2zim2` branch of warc2zim. `warc2zim2` branch create zim files without service worker. --- Dockerfile | 2 +- test/integration.py | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 298f7ec..d471fb6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,7 +9,7 @@ RUN apt-get update \ # python setup (in venv not to conflict with browsertrix) && python3 -m venv /app/zimit \ && /app/zimit/bin/python -m pip install --no-cache-dir 'requests==2.31.0' 'inotify==0.2.10' 'tld==0.13' \ - 'git+https://github.com/openzim/warc2zim@main#egg_name=warc2zim' \ + 'git+https://github.com/openzim/warc2zim@warc2zim2#egg_name=warc2zim' \ # placeholder (default output location) && mkdir -p /output \ # disable chrome upgrade diff --git a/test/integration.py b/test/integration.py index 1782b34..95f7924 100644 --- a/test/integration.py +++ b/test/integration.py @@ -6,9 +6,9 @@ from warcio import ArchiveIterator -def get_zim_article(zimfile, path): +def get_zim_main_entry(zimfile): zim_fh = libzim.reader.Archive(zimfile) - return zim_fh.get_entry_by_path(path).get_item().content.tobytes() + return zim_fh.main_entry def test_is_file(): @@ -20,9 +20,9 @@ def test_zim_main_page(): """Main page specified, http://isago.rskg.org/, was a redirect to https Ensure main page is the redirected page""" - assert b'"https://isago.rskg.org/"' in get_zim_article( - "/output/isago.zim", "A/index.html" - ) + main_entry = get_zim_main_entry("/output/isago.zim") + assert main_entry.is_redirect + assert main_entry.get_redirect_entry().path == "isago.rskg.org/" def test_user_agent(): From e034b088521bc7ce053145682da125cd27e06abf Mon Sep 17 00:00:00 2001 From: benoit74 Date: Mon, 15 Jan 2024 08:01:35 +0100 Subject: [PATCH 2/3] Update CHANGELOG --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1a9c7a1..3332923 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,8 +10,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed -- Adapt to new `warc2zim` code structure -- Using `main` warc2zim ⚠️ change before releasing! +- Use `warc2zim` version 2, which works without Service Worker anymore +- Using `warc2zim2` warc2zim ⚠️ change before releasing! ### Added From a352c0c40207e0d625d3d5d980073da87bf1e151 Mon Sep 17 00:00:00 2001 From: benoit74 Date: Mon, 15 Jan 2024 08:03:58 +0100 Subject: [PATCH 3/3] Add temporary Github Actions workflow to build zimit2 image --- .github/workflows/docker_zimit2.yml | 31 +++++++++++++++++++++++++++++ CHANGELOG.md | 1 + 2 files changed, 32 insertions(+) create mode 100644 .github/workflows/docker_zimit2.yml diff --git a/.github/workflows/docker_zimit2.yml b/.github/workflows/docker_zimit2.yml new file mode 100644 index 0000000..e611038 --- /dev/null +++ b/.github/workflows/docker_zimit2.yml @@ -0,0 +1,31 @@ +name: Docker Zimit2 + +on: + push: + branches: + - zimit2 + +jobs: + build-and-push: + name: Deploy Docker Image + runs-on: ubuntu-22.04 + + steps: + - name: Retrieve source code + uses: actions/checkout@v3 + + - name: Build and push + uses: openzim/docker-publish-action@v10 + with: + image-name: openzim/zimit + manual-tag: zimit2 + restrict-to: openzim/zimit + registries: ghcr.io + credentials: + GHCRIO_USERNAME=${{ secrets.GHCR_USERNAME }} + GHCRIO_TOKEN=${{ secrets.GHCR_TOKEN }} + repo_description: auto + repo_overview: auto + platforms: | + linux/amd64 + linux/arm64 diff --git a/CHANGELOG.md b/CHANGELOG.md index 3332923..1008e29 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Use `warc2zim` version 2, which works without Service Worker anymore - Using `warc2zim2` warc2zim ⚠️ change before releasing! +- Build temporary `zimit2` Docker image for testing ⚠️ remove before releasing! ### Added