commit
0b7e73b633
9 changed files with 63 additions and 38 deletions
14
.github/workflows/auto-update.yml
vendored
14
.github/workflows/auto-update.yml
vendored
|
|
@ -14,14 +14,13 @@ jobs:
|
||||||
- name: Check version
|
- name: Check version
|
||||||
id: check_ver
|
id: check_ver
|
||||||
run: |
|
run: |
|
||||||
get_ver() (curl -s "$@" | grep -Po "(\d+\.)+\d+\-r\d+" | head -1)
|
OLD_TAG=$(curl -s "${GHCO_URL}" | grep -Po "(\d+\.)+\d+\-r\d+" | head -1)
|
||||||
OLD_VER=$(get_ver ${GHCO_URL})
|
NEW_TAG=$(curl -s "${REPO_TAGS}" | grep -Po "release-(\d+\.){2}\d+\.zip" | head -1)
|
||||||
NEW_VER=$(get_ver ${ALPINE_PKG_URL})
|
echo "::set-output name=old_ver::${OLD_TAG:0:5}"
|
||||||
echo "::set-output name=old_ver::${OLD_VER}"
|
echo "::set-output name=new_ver::${NEW_TAG:8:5}"
|
||||||
echo "::set-output name=new_ver::${NEW_VER}"
|
|
||||||
env:
|
env:
|
||||||
ALPINE_PKG_URL: https://pkgs.alpinelinux.org/package/edge/testing/x86_64/qbittorrent-nox
|
|
||||||
GHCO_URL: https://github.com/mogeko/docker-qbittorrent/pkgs/container/qbittorrent
|
GHCO_URL: https://github.com/mogeko/docker-qbittorrent/pkgs/container/qbittorrent
|
||||||
|
REPO_TAGS: https://github.com/qbittorrent/qBittorrent/tags
|
||||||
|
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
@ -71,7 +70,8 @@ jobs:
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
build-args: |
|
build-args: |
|
||||||
VERSION=${{ needs.check.outputs.new_ver }}
|
QBITTORRENT_VERSION=${{ needs.check.outputs.new_ver }}-r0
|
||||||
|
LIBTORRENT_VERSION=1.2.14
|
||||||
|
|
||||||
- name: Save metadata
|
- name: Save metadata
|
||||||
run: echo ${{ toJSON(steps.build.outputs.metadata) }} > ${{ github.workspace }}/meta.json
|
run: echo ${{ toJSON(steps.build.outputs.metadata) }} > ${{ github.workspace }}/meta.json
|
||||||
|
|
|
||||||
20
.github/workflows/build.yml
vendored
20
.github/workflows/build.yml
vendored
|
|
@ -17,22 +17,10 @@ jobs:
|
||||||
- name: Check version
|
- name: Check version
|
||||||
id: check_ver
|
id: check_ver
|
||||||
run: |
|
run: |
|
||||||
NEW_VER=$(curl -s "${ALPINE_PKG_URL}" | grep -Po "(\d+\.)+\d+\-r\d+" | head -1)
|
NEW_TAG=$(curl -s "${REPO_TAGS}" | grep -Po "release-(\d+\.){2}\d+\.zip" | head -1)
|
||||||
echo "::set-output name=new_ver::${NEW_VER}"
|
echo "::set-output name=new_ver::${NEW_TAG:8:5}"
|
||||||
env:
|
env:
|
||||||
ALPINE_PKG_URL: https://pkgs.alpinelinux.org/package/edge/testing/x86_64/qbittorrent-nox
|
REPO_TAGS: https://github.com/qbittorrent/qBittorrent/tags
|
||||||
|
|
||||||
build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
needs: check
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v2
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Build
|
|
||||||
run: make build
|
|
||||||
|
|
||||||
meta:
|
meta:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
@ -56,7 +44,7 @@ jobs:
|
||||||
tags: |
|
tags: |
|
||||||
type=edge
|
type=edge
|
||||||
type=schedule,pattern={{date 'YYYYMMDD'}}
|
type=schedule,pattern={{date 'YYYYMMDD'}}
|
||||||
type=raw,${{ needs.check.outputs.new_ver }}
|
type=raw,${{ needs.check.outputs.new_ver }}-r0
|
||||||
type=raw,latest
|
type=raw,latest
|
||||||
|
|
||||||
- name: Save status
|
- name: Save status
|
||||||
|
|
|
||||||
3
.gitignore
vendored
3
.gitignore
vendored
|
|
@ -74,3 +74,6 @@ $RECYCLE.BIN/
|
||||||
|
|
||||||
# End of https://www.toptal.com/developers/gitignore/api/macos,windows,linux
|
# End of https://www.toptal.com/developers/gitignore/api/macos,windows,linux
|
||||||
|
|
||||||
|
# Custom example dirs
|
||||||
|
example/config
|
||||||
|
!example/config/qBittorrent.conf
|
||||||
|
|
|
||||||
44
Dockerfile
44
Dockerfile
|
|
@ -1,10 +1,44 @@
|
||||||
FROM alpine:edge
|
FROM alpine:3.14 as libtorrent_builder
|
||||||
|
|
||||||
ARG VERSION
|
|
||||||
|
|
||||||
RUN apk add --no-cache \
|
RUN apk add --no-cache \
|
||||||
-X http://dl-cdn.alpinelinux.org/alpine/edge/testing \
|
autoconf automake binutils boost-dev cppunit-dev libtool linux-headers ncurses-dev openssl-dev zlib-dev \
|
||||||
qbittorrent-nox=${VERSION}
|
build-base clang tar
|
||||||
|
|
||||||
|
WORKDIR /workspace
|
||||||
|
|
||||||
|
ARG LIBTORRENT_VERSION
|
||||||
|
ADD https://github.com/arvidn/libtorrent/archive/refs/tags/v${LIBTORRENT_VERSION}.tar.gz /workspace
|
||||||
|
RUN tar -zxf v${LIBTORRENT_VERSION}.tar.gz -C . \
|
||||||
|
&& cd libtorrent-${LIBTORRENT_VERSION} \
|
||||||
|
&& ./autotool.sh \
|
||||||
|
&& ./configure CXXFLAGS="-std=c++14" --prefix=/workspace/pkg --with-libiconv \
|
||||||
|
&& CC=clang make -j$(nproc) \
|
||||||
|
&& make install-strip
|
||||||
|
|
||||||
|
FROM alpine:3.14 as qbittorrent_builder
|
||||||
|
|
||||||
|
RUN apk add --no-cache \
|
||||||
|
boost-dev qt5-qtbase-dev qt5-qttools-dev \
|
||||||
|
build-base clang tar
|
||||||
|
|
||||||
|
WORKDIR /workspace
|
||||||
|
|
||||||
|
COPY --from=libtorrent_builder /workspace/pkg /usr
|
||||||
|
|
||||||
|
ARG QBITTORRENT_VERSION
|
||||||
|
ADD https://github.com/qbittorrent/qBittorrent/archive/refs/tags/release-${QBITTORRENT_VERSION}.tar.gz /workspace
|
||||||
|
RUN tar -zxf release-${QBITTORRENT_VERSION}.tar.gz -C . \
|
||||||
|
&& cd qBittorrent-release-${QBITTORRENT_VERSION} \
|
||||||
|
&& ./configure --prefix=/workspace/pkg --disable-gui \
|
||||||
|
&& CC=clang make -j$(nproc) \
|
||||||
|
&& make install
|
||||||
|
|
||||||
|
FROM alpine:3.14
|
||||||
|
|
||||||
|
RUN apk add --no-cache busybox libgcc openssl qt5-qtbase zlib
|
||||||
|
|
||||||
|
COPY --from=libtorrent_builder /workspace/pkg /usr
|
||||||
|
COPY --from=qbittorrent_builder /workspace/pkg /usr
|
||||||
|
|
||||||
ADD --chown=1000:100 root /
|
ADD --chown=1000:100 root /
|
||||||
|
|
||||||
|
|
|
||||||
9
Makefile
9
Makefile
|
|
@ -1,6 +1,8 @@
|
||||||
|
LIBTORRENT_VERSION = $(shell jq -r '.libtorrent' ./latest.json)
|
||||||
|
QBITTORRENT_VERSION = $(shell jq -r '.qbittorrent' ./latest.json)
|
||||||
|
|
||||||
CMD = /usr/bin/docker
|
CMD = /usr/bin/docker
|
||||||
IMAGE = mogeko/qbittorrent
|
IMAGE = mogeko/qbittorrent
|
||||||
VERSION = 4.3.8-r0
|
|
||||||
PORT = 8080
|
PORT = 8080
|
||||||
CONF_DIR = $(shell pwd)/example/config
|
CONF_DIR = $(shell pwd)/example/config
|
||||||
DL_DIR = $(shell pwd)/example/data
|
DL_DIR = $(shell pwd)/example/data
|
||||||
|
|
@ -11,7 +13,8 @@ all: build run
|
||||||
|
|
||||||
build:
|
build:
|
||||||
@$(CMD) build . \
|
@$(CMD) build . \
|
||||||
--build-arg VERSION=$(VERSION) \
|
--build-arg LIBTORRENT_VERSION=$(LIBTORRENT_VERSION) \
|
||||||
|
--build-arg QBITTORRENT_VERSION=$(QBITTORRENT_VERSION) \
|
||||||
--tag $(IMAGE)
|
--tag $(IMAGE)
|
||||||
|
|
||||||
run: id := $(shell head -200 /dev/urandom | cksum | cut -f1 -d " ")
|
run: id := $(shell head -200 /dev/urandom | cksum | cut -f1 -d " ")
|
||||||
|
|
@ -30,5 +33,3 @@ help: id := $(shell head -200 /dev/urandom | cksum | cut -f1 -d " ")
|
||||||
help:
|
help:
|
||||||
@-$(CMD) run -it --name qbt-$(id) $(IMAGE) --help
|
@-$(CMD) run -it --name qbt-$(id) $(IMAGE) --help
|
||||||
@$(CMD) rm -f qbt-$(id)
|
@$(CMD) rm -f qbt-$(id)
|
||||||
|
|
||||||
rm: clean
|
|
||||||
|
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
[Stats]
|
|
||||||
AllStats=@Variant(\0\0\0\x1c\0\0\0\x2\0\0\0\x12\0\x41\0l\0l\0t\0i\0m\0\x65\0\x44\0L\0\0\0\x5\0\0\0\0\0\0\x1a\xb0\0\0\0\x12\0\x41\0l\0l\0t\0i\0m\0\x65\0U\0L\0\0\0\x5\0\0\0\0\0\0&\xb8)
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
{
|
|
||||||
}
|
|
||||||
5
latest.json
Normal file
5
latest.json
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
"qbittorrent": "4.3.8",
|
||||||
|
"libtorrent": "1.2.14",
|
||||||
|
"pkgrel": 1
|
||||||
|
}
|
||||||
Loading…
Add table
Reference in a new issue