Skip to content

Commit

Permalink
Merge pull request #3 from heussd/bakentest
Browse files Browse the repository at this point in the history
Introduce tests and Docker bake
  • Loading branch information
heussd authored Jun 21, 2024
2 parents d20a250 + c95dcb1 commit c82bb5b
Show file tree
Hide file tree
Showing 6 changed files with 74 additions and 54 deletions.
71 changes: 39 additions & 32 deletions .github/workflows/build-and-push.yml
Original file line number Diff line number Diff line change
@@ -1,40 +1,47 @@
name: Docker build and push
name: Build, test and push Docker images

on:
push:
branches:
- master
paths-ignore:
- '**.md'
- 'docker-compose.yml'
schedule:
- cron: '0 13 * * 0'

push:
paths-ignore:
- '**.md'
schedule:
- cron: '0 13 * * 0'

jobs:
build:
runs-on: ubuntu-latest
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

steps:
- name: checkout code
uses: actions/checkout@v2

- name: Set up QEMU
uses: docker/setup-qemu-action@v1
with:
platforms: all
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
with:
platforms: all

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
with:
version: latest
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
with:
version: latest

- name: Login to docker hub
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
- name: Login to docker hub
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin

- name: build the image
run: |
docker buildx build --push \
--tag heussd/fivefilters-full-text-rss:latest \
--platform linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6 .
- name: Build amd64 image
run: |
docker buildx bake amd64 --load
- name: Test amd64 image
run: |
docker compose up --no-build --pull never -d
sleep 5s
curl --fail 'http://localhost:80'
curl --fail 'http://localhost:80/makefulltextfeed.php?url=sec%3A%2F%2Fwww.tagesschau.de%2Findex~rss2.xml&max=1&links=preserve'
docker compose down
- name: Build all images
run: |
docker buildx bake
- name: Release images to Dockerhub
if: github.ref == 'refs/heads/master'
run: |
docker buildx bake --push
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
# Enriches third-party RSS feeds with full text articles
# https://bitbucket.org/fivefilters/full-text-rss

FROM heussd/git as gitsrc
FROM alpine/git AS gitsrc
WORKDIR /ftr
RUN git clone https://bitbucket.org/fivefilters/full-text-rss.git . && \
git reset --hard 384d52fd83361ffd6e7f28bd39b322970a015a28


FROM heussd/git as gitconfig
FROM alpine/git AS gitconfig
WORKDIR /ftr-site-config
RUN git clone https://github.com/fivefilters/ftr-site-config .

Expand Down
33 changes: 16 additions & 17 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,31 +8,30 @@ This is a containerized version of [fivefilters full-text-rss](https://www.fivef

Not affiliated with [fivefilters.org](http://fivefilters.org/). The Dockerfile is licensed under [MIT conditions](LICENSE).


## User Guide

- Use the following [docker-compose.yml](docker-compose.yml)
- Use the following [compose.yml](compose.yml)

```yaml
services:
fullfeedrss:
image: "heussd/fivefilters-full-text-rss:latest"
environment:
# Leave empty to disable admin section
- FTR_ADMIN_PASSWORD=
volumes:
- "rss-cache:/var/www/html/cache/rss"
ports:
- "80:80"
fullfeedrss:
image: 'heussd/fivefilters-full-text-rss:latest'
environment:
# Leave empty to disable admin section
- FTR_ADMIN_PASSWORD=
volumes:
- 'rss-cache:/var/www/html/cache/rss'
ports:
- '80:80'
volumes:
rss-cache:
rss-cache:
```
- Start it with `docker-compose up`
- Visit [http://localhost:80](http://localhost:80) for the integrated web UI
- Start it with `docker-compose up`
- Visit [http://localhost:80](http://localhost:80) for the integrated web UI

![](webui.png)

- Interesting endpoints (see tab [Request & Response](http://localhost/#request)):
- Article extraction: `http://localhost/extract.php?url=[url]`
- Feed conversion: `http://localhost/makefulltextfeed.php?url=[url]`
- Interesting endpoints (see tab [Request & Response](http://localhost/#request)):
- Article extraction: `http://localhost/extract.php?url=[url]`
- Feed conversion: `http://localhost/makefulltextfeed.php?url=[url]`
File renamed without changes.
17 changes: 17 additions & 0 deletions docker-bake.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
variable "IMAGE" {
default = "heussd/fivefilters-full-text-rss:latest"
}

group "default" {
targets = ["all"]
}

target "all" {
tags = ["${IMAGE}"]
platforms = ["linux/amd64", "linux/arm64", "linux/arm/v7", "linux/arm/v6"]
}

target "amd64" {
tags = ["${IMAGE}"]
platforms = ["linux/amd64"]
}
3 changes: 0 additions & 3 deletions docker-compose.override.yml

This file was deleted.

0 comments on commit c82bb5b

Please sign in to comment.