mirror of
https://github.com/YuCat-OVO/BaiduNetdisk-Docker
synced 2025-05-10 20:10:04 +08:00
Test action
This commit is contained in:
parent
16164b19aa
commit
29469a0159
5
.github/workflows/build.yml
vendored
5
.github/workflows/build.yml
vendored
@ -5,15 +5,16 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- "main"
|
- "main"
|
||||||
|
tags:
|
||||||
|
- "[0-9]+.[0-9]+.[0-9]+"
|
||||||
paths-ignore:
|
paths-ignore:
|
||||||
- ".github/**"
|
- ".github/**"
|
||||||
- "docs/**"
|
- "docs/**"
|
||||||
- "**.md"
|
- "**.md"
|
||||||
- "get_version.py"
|
|
||||||
|
|
||||||
env:
|
env:
|
||||||
IMAGE_NAME: baidunetdisk-docker
|
IMAGE_NAME: baidunetdisk-docker
|
||||||
DOCKERHUB_SLUG: yucatovo/baidunetdisk-docker
|
DOCKERHUB_SLUG: docker.io/yucatovo/baidunetdisk-docker
|
||||||
GHCR_SLUG: ghcr.io/yucat-ovo/baidunetdisk-docker
|
GHCR_SLUG: ghcr.io/yucat-ovo/baidunetdisk-docker
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|||||||
51
.github/workflows/test.yml
vendored
Normal file
51
.github/workflows/test.yml
vendored
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
name: test
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- "main"
|
||||||
|
- "develop"
|
||||||
|
tags:
|
||||||
|
- "[0-9]+.[0-9]+.[0-9]+"
|
||||||
|
paths-ignore:
|
||||||
|
- ".github/**"
|
||||||
|
- "docs/**"
|
||||||
|
- "**.md"
|
||||||
|
env:
|
||||||
|
BUILD_TAG: baidunetdisk-docker:test
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
platforms: ["linux/amd64", "linux/arm64"]
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set the value
|
||||||
|
id: set-vars
|
||||||
|
run: |
|
||||||
|
echo "TARGET=$(echo ${{ matrix.platforms }} | sed 's#/#-#g')" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
|
- name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v3
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
with:
|
||||||
|
platforms: ${{ matrix.platforms }}
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
uses: docker/bake-action@v4
|
||||||
|
with:
|
||||||
|
targets: ${{ steps.set-vars.outputs.TARGET }}
|
||||||
|
env:
|
||||||
|
DEFAULT_TAG: ${{ env.BUILD_TAG }}
|
||||||
|
|
||||||
|
- name: Test
|
||||||
|
run: |
|
||||||
|
docker run -t --rm ${{ env.BUILD_TAG }}
|
||||||
44
.github/workflows/version.yml
vendored
44
.github/workflows/version.yml
vendored
@ -1,44 +0,0 @@
|
|||||||
name: Get BaiduNetdisk Version
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
schedule:
|
|
||||||
- cron: "0 3 * * 0"
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- "main"
|
|
||||||
paths:
|
|
||||||
- "get_version.py"
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
get-version:
|
|
||||||
name: Get BaiduNetdisk Version
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Set variables
|
|
||||||
id: set-vars
|
|
||||||
run: |
|
|
||||||
RELEASE_NAME="Released on $(date +%Y%m%d%H%M)"
|
|
||||||
|
|
||||||
echo "RELEASE_NAME=${RELEASE_NAME}" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- name: Set up Python
|
|
||||||
uses: actions/setup-python@v5
|
|
||||||
with:
|
|
||||||
python-version: "3.11.7"
|
|
||||||
|
|
||||||
- name: Run Script
|
|
||||||
run: |
|
|
||||||
pip install -r requirements.txt
|
|
||||||
python get_version.py
|
|
||||||
|
|
||||||
- name: Git push assets to branch
|
|
||||||
run: |
|
|
||||||
git config --local user.name "github-actions[bot]"
|
|
||||||
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
|
||||||
git add *.json
|
|
||||||
git commit -m "${{ steps.set-vars.outputs.RELEASE_NAME }}" || true
|
|
||||||
git push
|
|
||||||
72
Dockerfile
72
Dockerfile
@ -1,14 +1,15 @@
|
|||||||
# syntax=docker/dockerfile:1
|
# syntax=docker/dockerfile:1
|
||||||
|
FROM docker.io/library/alpine:edge as download
|
||||||
|
|
||||||
FROM ghcr.io/linuxserver/baseimage-kasmvnc:debianbookworm
|
RUN \
|
||||||
|
sed -i 's/dl-cdn.alpinelinux.org/mirrors.lzu.edu.cn/g' /etc/apk/repositories && \
|
||||||
|
apk update && \
|
||||||
|
apk add wget curl jq &&\
|
||||||
|
wget $(curl 'https://yun.baidu.com/disk/cmsdata?platform=linux&page=1&num=1' | jq -r '.["list"][0]["url_1"]') -O /tmp/baidunetdisk.deb
|
||||||
|
|
||||||
# set version label
|
FROM ghcr.io/linuxserver/baseimage-kasmvnc:debianbookworm-062d5346-ls56
|
||||||
ARG BUILD_DATE
|
|
||||||
ARG VERSION
|
LABEL org.opencontainers.image.source="https://github.com/YuCat-OVO/BaiduNetdisk-Docker"
|
||||||
ARG TARGETPLATFORM
|
|
||||||
LABEL build_version="version:- ${VERSION} Build-date:- ${BUILD_DATE}"
|
|
||||||
LABEL maintainer="YuCat-OVO"
|
|
||||||
LABEL org.opencontainers.image.source="https://github.com/linuxserver/docker-baseimage-kasmvnc"
|
|
||||||
|
|
||||||
ENV \
|
ENV \
|
||||||
CUSTOM_PORT="8080" \
|
CUSTOM_PORT="8080" \
|
||||||
@ -16,67 +17,22 @@ ENV \
|
|||||||
HOME="/config" \
|
HOME="/config" \
|
||||||
TITLE="Baidunetdisk"
|
TITLE="Baidunetdisk"
|
||||||
|
|
||||||
COPY url.json /tmp/
|
COPY --from=download /tmp/baidunetdisk.deb /tmp/baidunetdisk.deb
|
||||||
|
|
||||||
# add local files
|
# add local files
|
||||||
COPY root/ /
|
COPY root/ /
|
||||||
|
|
||||||
RUN \
|
RUN \
|
||||||
TARGETPLATFORM=${TARGETPLATFORM:-linux/amd64} && \
|
sed -i "s/deb.debian.org/mirror.bfsu.edu.cn/g" /etc/apt/sources.list &&\
|
||||||
echo "**** arch: ${TARGETPLATFORM} ****" && \
|
sed -i "s/security.debian.org/mirror.bfsu.edu.cn/g" /etc/apt/sources.list &&\
|
||||||
echo "**** add icon ****" && \
|
|
||||||
curl -o \
|
|
||||||
/kclient/public/icon.png \
|
|
||||||
https://raw.githubusercontent.com/YuCat-OVO/BaiduNetdisk-Docker/master/docs/baidunetdisk.png && \
|
|
||||||
echo "**** fix trusted.gpg ****" && \
|
echo "**** fix trusted.gpg ****" && \
|
||||||
mv /etc/apt/trusted.gpg /etc/apt/trusted.gpg.d/docker.gpg && \
|
mv /etc/apt/trusted.gpg /etc/apt/trusted.gpg.d/docker.gpg && \
|
||||||
echo "**** install runtime packages ****" && \
|
apt-get update -y && \
|
||||||
if [ -n ${TZ} ]; then \
|
|
||||||
echo "**** TZ not found, setting up ****" && \
|
|
||||||
export TZ=Asia/Shanghai; \
|
|
||||||
fi && \
|
|
||||||
export DEBIAN_FRONTEND=noninteractive && \
|
|
||||||
apt-get update && \
|
|
||||||
apt-get -yy -qq install --no-install-recommends --no-install-suggests --fix-missing \
|
apt-get -yy -qq install --no-install-recommends --no-install-suggests --fix-missing \
|
||||||
wget \
|
|
||||||
fonts-wqy-microhei \
|
fonts-wqy-microhei \
|
||||||
fonts-wqy-zenhei \
|
fonts-wqy-zenhei \
|
||||||
dbus \
|
|
||||||
fcitx-rime \
|
|
||||||
libnss3 \
|
|
||||||
libopengl0 \
|
|
||||||
libxkbcommon-x11-0 \
|
|
||||||
libxcb-cursor0 \
|
|
||||||
libxcb-icccm4 \
|
|
||||||
libxcb-image0 \
|
|
||||||
libxcb-keysyms1 \
|
|
||||||
libxcb-randr0 \
|
|
||||||
libxcb-render-util0 \
|
|
||||||
libxcb-xinerama0 \
|
|
||||||
libxdamage1 \
|
|
||||||
poppler-utils \
|
|
||||||
python3 \
|
|
||||||
python3-xdg \
|
|
||||||
desktop-file-utils && \
|
desktop-file-utils && \
|
||||||
|
\
|
||||||
echo "**** install BaiduNetdisk ****" && \
|
echo "**** install BaiduNetdisk ****" && \
|
||||||
if [ "${TARGETPLATFORM}" = "linux/amd64" ]; then \
|
|
||||||
echo "**** ${TARGETPLATFORM}, reading from url.json ****"; \
|
|
||||||
BAIDUNETDISK_VERSION=$(jq -r ".[-2]" /tmp/url.json); \
|
|
||||||
BAIDUNETDISK_URL=$(jq -r ".[-2]" /tmp/url.json); \
|
|
||||||
elif [ "${TARGETPLATFORM}" = "linux/arm64" ]; then \
|
|
||||||
echo "**** ${TARGETPLATFORM}, reading from url.json ****"; \
|
|
||||||
BAIDUNETDISK_VERSION=$(jq -r ".[-1]" /tmp/url.json); \
|
|
||||||
BAIDUNETDISK_URL=$(jq -r ".[-1]" /tmp/url.json); \
|
|
||||||
echo "**** ${TARGETPLATFORM}, add args ****" && \
|
|
||||||
sed -i "s/baidunetdisk --no-sandbox/baidunetdisk --no-sandbox --disable-gpu-sandbox/g" /defaults/*; \
|
|
||||||
else \
|
|
||||||
echo "**** err, use default url ****" && \
|
|
||||||
BAIDUNETDISK_URL="https://issuepcdn.baidupcs.com/issue/netdisk/LinuxGuanjia/4.17.7/baidunetdisk_4.17.7_amd64.deb"; \
|
|
||||||
fi && \
|
|
||||||
echo "***** Getting ${BAIDUNETDISK_URL} ****" && \
|
|
||||||
curl -o \
|
|
||||||
/tmp/baidunetdisk.deb -L \
|
|
||||||
"$BAIDUNETDISK_URL" && \
|
|
||||||
for i in \
|
for i in \
|
||||||
$(dpkg -I /tmp/baidunetdisk.deb | grep "Depends" | cut -c11- | awk -F ', ' '{ for(i=1; i<=NF; i++) print $i }'); \
|
$(dpkg -I /tmp/baidunetdisk.deb | grep "Depends" | cut -c11- | awk -F ', ' '{ for(i=1; i<=NF; i++) print $i }'); \
|
||||||
do \
|
do \
|
||||||
|
|||||||
53
Dockerfile.arm64
Normal file
53
Dockerfile.arm64
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
# syntax=docker/dockerfile:1
|
||||||
|
FROM docker.io/library/alpine:edge as download
|
||||||
|
|
||||||
|
RUN \
|
||||||
|
sed -i 's/dl-cdn.alpinelinux.org/mirrors.lzu.edu.cn/g' /etc/apk/repositories && \
|
||||||
|
apk update && \
|
||||||
|
apk add wget curl jq &&\
|
||||||
|
wget $(curl 'https://yun.baidu.com/disk/cmsdata?platform=linux&page=1&num=1' | jq -r '.["list"][0]["url_1"]' | sed "s/amd64/arm64/g") -O /tmp/baidunetdisk.deb
|
||||||
|
|
||||||
|
FROM ghcr.io/linuxserver/baseimage-kasmvnc:debianbookworm-062d5346-ls56
|
||||||
|
|
||||||
|
LABEL org.opencontainers.image.source="https://github.com/YuCat-OVO/BaiduNetdisk-Docker"
|
||||||
|
|
||||||
|
ENV \
|
||||||
|
CUSTOM_PORT="8080" \
|
||||||
|
CUSTOM_HTTPS_PORT="8181" \
|
||||||
|
HOME="/config" \
|
||||||
|
TITLE="Baidunetdisk"
|
||||||
|
|
||||||
|
COPY --from=download /tmp/baidunetdisk.deb /tmp/baidunetdisk.deb
|
||||||
|
# add local files
|
||||||
|
COPY root/ /
|
||||||
|
|
||||||
|
RUN \
|
||||||
|
sed -i "s/deb.debian.org/mirror.bfsu.edu.cn/g" /etc/apt/sources.list &&\
|
||||||
|
sed -i "s/security.debian.org/mirror.bfsu.edu.cn/g" /etc/apt/sources.list &&\
|
||||||
|
echo "**** fix trusted.gpg ****" && \
|
||||||
|
mv /etc/apt/trusted.gpg /etc/apt/trusted.gpg.d/docker.gpg && \
|
||||||
|
apt-get update -y && \
|
||||||
|
apt-get -yy -qq install --no-install-recommends --no-install-suggests --fix-missing \
|
||||||
|
fonts-wqy-microhei \
|
||||||
|
fonts-wqy-zenhei \
|
||||||
|
desktop-file-utils && \
|
||||||
|
\
|
||||||
|
echo "**** install BaiduNetdisk ****" && \
|
||||||
|
sed -i "s/baidunetdisk --no-sandbox/baidunetdisk --no-sandbox --disable-gpu-sandbox/g" /defaults/*; \
|
||||||
|
for i in \
|
||||||
|
$(dpkg -I /tmp/baidunetdisk.deb | grep "Depends" | cut -c11- | awk -F ', ' '{ for(i=1; i<=NF; i++) print $i }'); \
|
||||||
|
do \
|
||||||
|
if [ -n "$(dpkg -l | grep ^ii | grep $i)" ]; \
|
||||||
|
then \
|
||||||
|
echo "${i} installed,skip"; \
|
||||||
|
else \
|
||||||
|
apt-get -yy -qq install --no-install-recommends --no-install-suggests --fix-missing ${i}; \
|
||||||
|
fi \
|
||||||
|
done && \
|
||||||
|
dpkg -i /tmp/baidunetdisk.deb && \
|
||||||
|
echo "**** cleanup ****" && \
|
||||||
|
apt-get clean && \
|
||||||
|
rm -rf \
|
||||||
|
/tmp/* \
|
||||||
|
/var/lib/apt/lists/* \
|
||||||
|
/var/tmp/*
|
||||||
25
docker-bake.hcl
Normal file
25
docker-bake.hcl
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
variable "TAG" {
|
||||||
|
default = "baidunetdisk-docker:latest"
|
||||||
|
}
|
||||||
|
|
||||||
|
group "linux-amd64" {
|
||||||
|
targets = ["image-amd64"]
|
||||||
|
}
|
||||||
|
group "linux-arm64" {
|
||||||
|
targets = ["image-arm64"]
|
||||||
|
}
|
||||||
|
|
||||||
|
target "docker-metadata-action" {
|
||||||
|
tags = ["${TAG}"]
|
||||||
|
}
|
||||||
|
|
||||||
|
target "image-amd64" {
|
||||||
|
platforms = ["linux/amd64"]
|
||||||
|
inherits = ["docker-metadata-action"]
|
||||||
|
dockerfile = "Dockerfile"
|
||||||
|
}
|
||||||
|
target "image-arm64" {
|
||||||
|
platforms = ["linux/arm64"]
|
||||||
|
inherits = ["docker-metadata-action"]
|
||||||
|
dockerfile = "Dockerfile.arm64"
|
||||||
|
}
|
||||||
31
docker.yml
Normal file
31
docker.yml
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
input:
|
||||||
|
job:
|
||||||
|
package-manager: docker
|
||||||
|
allowed-updates:
|
||||||
|
- update-type: all
|
||||||
|
source:
|
||||||
|
provider: github
|
||||||
|
repo: YuCat-OVO/BaiduNetdisk-Docker
|
||||||
|
directory: /
|
||||||
|
branch: develop
|
||||||
|
commit: 16164b19aa9c08da55b0bd26fb4b2228262d0eab
|
||||||
|
output:
|
||||||
|
- type: update_dependency_list
|
||||||
|
expect:
|
||||||
|
data:
|
||||||
|
dependencies:
|
||||||
|
- name: linuxserver/baseimage-kasmvnc
|
||||||
|
requirements:
|
||||||
|
- file: Dockerfile
|
||||||
|
groups: []
|
||||||
|
requirement: null
|
||||||
|
source:
|
||||||
|
registry: ghcr.io
|
||||||
|
tag: debianbookworm
|
||||||
|
version: debianbookworm
|
||||||
|
dependency_files:
|
||||||
|
- /Dockerfile
|
||||||
|
- type: mark_as_processed
|
||||||
|
expect:
|
||||||
|
data:
|
||||||
|
base-commit-sha: 16164b19aa9c08da55b0bd26fb4b2228262d0eab
|
||||||
Loading…
Reference in New Issue
Block a user