revert
This commit is contained in:
@@ -23,69 +23,31 @@ pipeline {
|
|||||||
stage('Setup Python & Install Dependencies') {
|
stage('Setup Python & Install Dependencies') {
|
||||||
steps {
|
steps {
|
||||||
sh '''
|
sh '''
|
||||||
set -e
|
set -e # Exit immediately if a command exits with a non-zero status
|
||||||
|
|
||||||
|
# Create a virtual environment named 'venv'
|
||||||
|
python3 -m venv venv
|
||||||
|
|
||||||
|
# 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
|
||||||
|
|
||||||
|
# Check if moviepy is installed
|
||||||
|
pip list | grep moviepy || { echo 'MoviePy installation failed!'; exit 1; }
|
||||||
|
|
||||||
|
# Check if FFmpeg is installed
|
||||||
|
ffmpeg -version || { echo 'FFmpeg is not installed!'; exit 1; }
|
||||||
|
|
||||||
# ── Create venv ────────────────────────────────────
|
# Verify that moviepy can be imported
|
||||||
python3 -m venv venv
|
python3 -c "import moviepy" || { echo 'MoviePy import failed!'; exit 1; }
|
||||||
|
|
||||||
# ── Upgrade pip toolchain ──────────────────────────
|
# Install the local browser binaries for this environment
|
||||||
. venv/bin/activate
|
playwright install chromium
|
||||||
pip install --upgrade pip wheel setuptools
|
|
||||||
|
|
||||||
# ── Core dependencies ──────────────────────────────
|
|
||||||
pip install -U \
|
|
||||||
atproto \
|
|
||||||
playwright \
|
|
||||||
playwright-stealth \
|
|
||||||
httpx \
|
|
||||||
arrow \
|
|
||||||
python-dotenv \
|
|
||||||
moviepy \
|
|
||||||
beautifulsoup4 \
|
|
||||||
charset-normalizer \
|
|
||||||
Pillow \
|
|
||||||
grapheme
|
|
||||||
|
|
||||||
# ── yt-dlp: always upgrade to latest ──────────────
|
|
||||||
pip install --upgrade yt-dlp
|
|
||||||
pip show yt-dlp | grep -E "^(Name|Version)"
|
|
||||||
|
|
||||||
# ── 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)"
|
|
||||||
|
|
||||||
# ── 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 ────────────────────
|
|
||||||
playwright install chromium
|
|
||||||
'''
|
'''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
stage('Run Script') {
|
stage('Run Script') {
|
||||||
steps {
|
steps {
|
||||||
// Securely injects Jenkins credentials as environment variables
|
// Securely injects Jenkins credentials as environment variables
|
||||||
|
|||||||
Reference in New Issue
Block a user