This commit is contained in:
2026-05-19 15:12:24 +00:00
parent 367568860a
commit f652b2bf72

View File

@@ -23,69 +23,31 @@ pipeline {
stage('Setup Python & Install Dependencies') {
steps {
sh '''
set -e
set -e # Exit immediately if a command exits with a non-zero status
# ── Create venv ────────────────────────────────────
# Create a virtual environment named 'venv'
python3 -m venv venv
# ── Upgrade pip toolchain ──────────────────────────
. venv/bin/activate
pip install --upgrade pip wheel setuptools
# Activate the virtual environment and install dependencies
. venv/bin/activate && \
pip install --upgrade pip && \
pip install -U atproto tweety-ns playwright httpx arrow python-dotenv moviepy grapheme
# ── Core dependencies ──────────────────────────────
pip install -U \
atproto \
playwright \
playwright-stealth \
httpx \
arrow \
python-dotenv \
moviepy \
beautifulsoup4 \
charset-normalizer \
Pillow \
grapheme
# Check if moviepy is installed
pip list | grep moviepy || { echo 'MoviePy installation failed!'; exit 1; }
# ── yt-dlp: always upgrade to latest ──────────────
pip install --upgrade yt-dlp
pip show yt-dlp | grep -E "^(Name|Version)"
# Check if FFmpeg is installed
ffmpeg -version || { echo 'FFmpeg is not installed!'; exit 1; }
# ── curl_cffi: TikTok impersonation support ────────
# Required by yt-dlp to bypass TikTok bot detection
pip install --upgrade curl-cffi
pip show curl-cffi | grep -E "^(Name|Version)"
# Verify that moviepy can be imported
python3 -c "import moviepy" || { echo 'MoviePy import failed!'; exit 1; }
# ── playwright-stealth version check ───────────────
pip show playwright-stealth | grep -E "^(Name|Version)"
python3 -c "
try:
from playwright_stealth import stealth_sync
print('playwright_stealth OK (v1.x - stealth_sync)')
except ImportError:
from playwright_stealth import Stealth
print('playwright_stealth OK (v2.x - Stealth class)')
"
# ── Sanity checks ──────────────────────────────────
python3 -c "import atproto; print('atproto OK')"
python3 -c "import playwright; print('playwright OK')"
python3 -c "import yt_dlp; print('yt_dlp OK')"
python3 -c "import curl_cffi; print('curl_cffi OK')"
python3 -c "import httpx; print('httpx OK')"
python3 -c "import arrow; print('arrow OK')"
python3 -c "import moviepy; print('moviepy OK')"
# ── System tools ───────────────────────────────────
ffmpeg -version | head -1
ffprobe -version | head -1
# ── Playwright browser binaries ────────────────────
# Install the local browser binaries for this environment
playwright install chromium
'''
}
}
stage('Run Script') {
steps {
// Securely injects Jenkins credentials as environment variables