mirror of
https://github.com/NoCLin/LightMirrors
synced 2025-08-05 17:51:33 +08:00
Compare commits
No commits in common. "e8ffaa21aac11576fc2f67b90fd74657f7747cd8" and "37866ae72723976c856d646c09e9b165b10ccd6f" have entirely different histories.
e8ffaa21aa
...
37866ae727
@ -1,6 +1,7 @@
|
|||||||
# for caddy
|
# for caddy
|
||||||
CLOUDFLARE_DNS_API_TOKEN=xxxx
|
CLOUDFLARE_DNS_API_TOKEN=xxxx
|
||||||
|
|
||||||
|
SCHEME=http
|
||||||
BASE_DOMAIN=local.homeinfra.org
|
BASE_DOMAIN=local.homeinfra.org
|
||||||
|
|
||||||
# for aria2 and mirrors
|
# for aria2 and mirrors
|
||||||
|
51
.github/workflows/ci.yaml
vendored
51
.github/workflows/ci.yaml
vendored
@ -1,51 +0,0 @@
|
|||||||
name: Manual CI
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
integration-tests:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
permissions:
|
|
||||||
packages: write
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v2
|
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v3
|
|
||||||
|
|
||||||
- name: Login to GitHub Container Registry
|
|
||||||
uses: docker/login-action@v2
|
|
||||||
with:
|
|
||||||
registry: ghcr.io
|
|
||||||
username: noclin
|
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
- name: Set up Python
|
|
||||||
uses: actions/setup-python@v3
|
|
||||||
with:
|
|
||||||
python-version: "3.9"
|
|
||||||
|
|
||||||
- name: Build and push
|
|
||||||
uses: docker/build-push-action@v6
|
|
||||||
with:
|
|
||||||
push: true
|
|
||||||
context: ./src
|
|
||||||
tags: ghcr.io/noclin/lightmirrors:${{ github.sha }}
|
|
||||||
cache-from: type=gha
|
|
||||||
cache-to: type=gha,mode=max
|
|
||||||
|
|
||||||
- name: Build and push
|
|
||||||
uses: docker/build-push-action@v6
|
|
||||||
with:
|
|
||||||
push: true
|
|
||||||
context: ./aria2
|
|
||||||
tags: ghcr.io/noclin/lightmirrors_aria2:${{ github.sha }}
|
|
||||||
cache-from: type=gha
|
|
||||||
cache-to: type=gha,mode=max
|
|
||||||
|
|
||||||
- name: Integration Test
|
|
||||||
run: python3 test/runner.py
|
|
@ -1,5 +1,8 @@
|
|||||||
FROM alpine:3.19.1
|
FROM alpine:3.19.1
|
||||||
|
|
||||||
|
# Optimization for China
|
||||||
|
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories
|
||||||
|
|
||||||
RUN apk update && apk add --no-cache aria2
|
RUN apk update && apk add --no-cache aria2
|
||||||
|
|
||||||
ADD entrypoint.sh /
|
ADD entrypoint.sh /
|
||||||
|
@ -1 +0,0 @@
|
|||||||
**/__pycache__
|
|
@ -9,9 +9,7 @@ RUN unzip AriaNg-1.3.7.zip && rm AriaNg-1.3.7.zip
|
|||||||
|
|
||||||
ADD requirements.txt /app/requirements.txt
|
ADD requirements.txt /app/requirements.txt
|
||||||
|
|
||||||
RUN pip install -r /app/requirements.txt
|
RUN pip install -r /app/requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple/
|
||||||
|
|
||||||
ADD . /app
|
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
|
@ -24,18 +24,15 @@ services = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
os.chdir(root_dir)
|
os.chdir(root_dir)
|
||||||
|
call("docker-compose up -d --force-recreate --wait")
|
||||||
if not os.path.exists(".env"):
|
|
||||||
call("cp .env.example .env")
|
|
||||||
call("docker compose up -d --force-recreate --wait")
|
|
||||||
|
|
||||||
os.chdir(test_dir)
|
os.chdir(test_dir)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
for service in services:
|
for service in services:
|
||||||
call(f'docker compose up --force-recreate --abort-on-container-exit --exit-code-from {service} {service}')
|
call(f'docker-compose up --force-recreate --exit-code-from {service} {service}')
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
raise e
|
raise e
|
||||||
finally:
|
finally:
|
||||||
os.chdir(root_dir)
|
os.chdir(root_dir)
|
||||||
call("docker compose down")
|
call("docker-compose down")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user